Comparative Empirical Study on CAPM and Stock Price Prediction by BP Neural Network in Shanghai’s A-share

Capital Asset Pricing Model (CAPM) is aimed to quantify the relationship between risk and expected rate of return. It has been tested and improved constantly by a number of researchers both abroad and in China. This study achieves a comparative empirical test of CAPM on E-V model, E-S model and GLS model in Shanghai A-share market. However, all of three model cannot adapt to Shanghai A-share market wonderfully. Now, computer science is a new instrument that can be applied to describe the capital market. Therefore, as a comparison of results, we select a single stock and use the simplest neural network, BP neural network with algorithms to optimize the weights and thresholds between the network layers for prediction. The results show that machine learning is a good method for stock prediction compared with only considering a single factor, which should be further explored in our future learning.


INTRODUCTION
The Capital Asset Pricing Model (CAPM) is hailed as one of the cornerstones of modern financial theory. Since its creation, the CAPM model has undergone multiple tests. The results of early empirical tests are consistent with CAPM (Black, Jensen, Scholes, 1972) [1], it is believed that there is a significant positive correlation between the average stock return and the estimated β value. However, in the subsequent test, Campbell, Andrew, and McKinley (1997) examined the data of the US stock market for the 30 years from 1965 to 1994 and came to the conclusion that the CAPM was violated. (Meng Qingshun, 2006) [2]. In recent years, China is also committed to studying the effectiveness of CAPM in China's stock market. Chen Xiaoyue, Sun Aijun (2000) [3] selected 12-month stocks, and used group identification and interval regression tests to deny the effectiveness of CAPM in China's stock market. Jin Yunhui, Lin Liu (2001) [4] selected about 500 stocks for three years to test. finally, the linear relationship between the stock return and the β value is finally denied. Most of the early researches have denied the effectiveness of CAPM in China's securities market, but its existing data are limited, the time span is too short, the stock market is affected by policies, and the research methods are single. Here, the weekly closing price of 400 stocks during 851 weeks is selected to calculate the 850-week return data. The β factor is regressed according to the EV model, ES model, and GLS model, and an empirical test is performed to compare the applicability of three models based on the test results. Comprehensive analysis of the effectiveness of CAPM in China's securities market based on the results of three model tests. Because stock prices are often affected by many factors, and as mentioned above, the CAPM is mainly used to study the relationship between expected returns and risky assets, and as a consequence, the prediction results obtained by considering only a few factors are often relatively large. Machine learning has enormous advantage in processing financial data. It can accurately analyze the changes of a large number of stock data or financial data during a period, and quickly draw corresponding conclusions, which significantly improves the operating efficiency of the financial market. In stock market, it can use the relevant characteristics of stock price index to achieve stock price trend prediction [5].

Empirical Testing Method
In this paper, we use data in 851 weeks, from June 21, 2002 to March 29, 2019. The average repurchase rate of Treasury Bonds is converted into the weekly interest rate as the risk-free interest rate, and the Shanghai Stock Exchange A-Share composite index is taken as the market rate of return. From Shanghai Stock Exchange A-Share, 400 stocks with complete weekly closing prices is picked out randomly, and the rate of return in 850 weeks can be obtained through calculation. The common form of CAPM is = + − # 1 is the rate of return of asset , is the rate of return of the market portfolio, is risk-free rate of return. is used to assess the systemic risk of risky assets. With the deepening of research, scholars put forward different methods to calculate it. Here, we use the three model below. In GLS Model, here are stocks in a portfolio, is a × 1 matrix of , is a × 1 matrix of − , is the covariance matrix of the stocks. Based on the testing method of Fama-Macbeth [6] and the article written by Ali Jahankhani [7], we make empirical test on the above models. In this paper, the number of portfolios is 20, and each of them include 20 stocks. Besides, the data in 850 weeks are divided into 15 periods for research, each of which is divided into three stages: portfolio formation, estimation period and test period, as shown in Table 1.
Here, , shows the rate of return of the investment portfolio p in stage t (Test Period), that is, the weighted average value of the rate of return of each stock in the portfolio in stage t. , −1 is the value of portfolio p in stage t − 1(Estimation Period). (ε , −1 ) is the non-system risk.
is the number of samples in stage − 1 , and here = 50. , −1 is calculated by equation (1). , is error item related to the expected rate of return. There are four hypotheses of testing CAPM: H1: E(γ 2t ) = 0. If the hypothesis is held, it refuses the linear relationship between the rate of return and 2 , that may support expected rate of return and risk are linear; H2: E(γ 3t ) = 0 . If the hypothesis is held, it means unsystematic risk has no influence on expected rate of return; H3: E(γ 1t ) = ( ) − > 0 . If the hypothesis is held, the equation part represent that in regression function is in accordance with CAPM, and the inequation part means high risk will lead to high expected return; H4: γ 0t = . If the hypothesis is held, the constant in regression function accords with CAPM.
Then, under three model of CAPM, data in 15 periods is regressed. And the above four tests are tested at the significant level of 0.05.

The Example of E-S Model
Here, take the linear regression analysis of E-S model as an example. The results of stepwise linear regression are shown in Table 2. In Table 3, and ( ) are used to test H3. γ 1t = ( ) − is refused in 6 regressions, and looking at , the numbers of positive items and the negative ones have no obvious difference. These tell us γ 1t and ( ) − are neither close to each other nor obviously performing that one of them is greater than another. Besides, only one regression not only refuses γ 1t = 0 but also accepts γ 1t > 0. The actual data indicates that high risk may not be repaid by high return. In addition, and ( ) are calculated for testing H4. It is figured out that H4 is refused by 4 regressions, which means γ 0t and are not in strong accordance. And they neither have obvious greater or lesser relationship.

The Comparison of Three Models
Similarly, E-V model and GLS model are tested. The comparison of hypothesis testing result is shown in table4. Besides, they all tell γ 1t and ( ) − , γ 0t and have no greater or lesser relationship. Table 4 The comparison of the support proportion of each hypothesis The testing result of H1 and H2 shows that the linear relationship between expected rate of return and β 2 or ε can be refused under each of the three models. In addition, the result of H3 not supports positive relationship between high

Advances in Social Science, Education and Humanities Research, volume 428
risk and high return. Overall, E-S model is more accordant with CAPM than others, especially for hypothesis H3 and H4. Because theoretically depending more on , it can describe the influence of risk-free rate better. However, working on portfolio, with the acceptance proportion of most assumptions that not even higher than 80%, E-S model still cannot adapt to Shanghai A-share market wonderfully. Individual stocks, on the other hand, are more flexible and volatile, making it more difficult to be accurately predicted by E-S model.

Discussion
To find out the reason why all of three model not fit the real market, we analyze the limitations of CAPM from the perspective of investors and the securities market.

Investors
Firstly, against CAPM's assumptions, investors in reality are not completely rational. The psychological deviation of investors in decision-making will lead to a high overall price-earnings ratio, a high market turnover rate and a large market volatility. High price-earnings ratio affects the expected return, which in turn affects the value of obtained through regression. The high turnover rate and large market volatility will lead to a weakening of the applicability of the model. Secondly, it is not realistic for investors to focus on the return of the asset portfolio for only one period. It is relatively reasonable that investors should also pay attention to the risks and opportunity costs caused by time [8], which also reduces the risk to a certain extent.

Securities Market
Firstly, compared with western securities markets (such as the US securities market), China's securities market started relatively late. At a high-speed development stage, it is currently greatly affected by government actions and policies. Secondly, the prices in China's securities market have not yet fully reflected all valuable information. Insider information holders (including major shareholders, senior managers and fund managers, etc.) often get excess profits, which reduces the effectiveness of the market. Thirdly, Siquan Zheng [9] pointed out that the non-systematic risk of China's securities market is high. This is due to the existence of some institutional defects in China's securities market, such as the inability of state shares and legal person shares to circulate and the lack of risk-avoidance tools. The non-statutory and transparency of the amendments to these systems are not high, resulting in system uncertainty. Combined with our regression results, in these three models testing process, due to the large non-systematic risk and small value, more than half of the regression models shows a better F-test result when taking ε into consideration. Hence, the large systemic risk also affects the applicability of the capital asset pricing model in China's securities market to a certain extent.

Model
The structure of the BP neural network is shown as Figure 1 [10]. The input layer consists of the opening price, the maximum price, the minimum price, turnover and the closing price of the stock. And the output layer is the closing price of the next day. During the training process, genetic algorithms are used. The number of populations is the sum of the weights and thresholds from the input layer to the hidden layer, and the hidden layer to the output layer. The norm of the error matrix is used as the output of the fitness function. After selecting, crossing, and mutating, a new population is obtained, and then the weights and thresholds of the neural network are updated, which attempts to get an optimal solution.

Experience
The data of China World Trade for stocks with the code of 600007.SH was selected, and a total of 1,000 days from Advances in Social Science, Education and Humanities Research, volume 428 January 4, 2011 to February 17, 2015 (after excluding days without transaction information) were selected. The data set is divided into a training sample set and a test sample set according to 4:1, the previous 800 days were used as training sample sets. The next 200 days were used as the test sample set. The forecast data for the last 200 days is shown below.
When the number of trainings is 2000, the training target is 0.001, the learning rate is 0.2, and the number of hidden neurons is 5, the prediction result is shown in Figure 2 and Figure 3. The mean square error of the test sample set before and after optimization is 0.866964 and 0.216173.

Figure 2
Comparison of prediction results and actual results using BP neural network before optimization

Discussion
In the above two trainings, we find that after increasing the number of hidden neurons and training times, the mean square error of the prediction reduce both before and after optimization. Compared with CAPM, it seems smarter, and it can also be seen from the graph that more historical data will raise better short-term prediction effect. Nevertheless, The choice of learning rate often does not have a clear pattern on the effect of results, we can choose different values to train a few more times to achieve a better result.

CONCLUSION
In the aspect of CAPM empirical test, we work out that all of E-V model, E-S model and GLS model cannot adapt to Shanghai A-share market. These models are even not able to describe the trend of portfolios, which, to some extent, neutralize the non-system risk. Therefore, the future price of only one stock predicted by CAPM is more unreliable. For one hand, the internal cause is the limitation of CAPM itself, which relates to its presuppositions and the model simplification. For another, the external causes are that real investors are not so rational as they are expected to be, and that China's stock market is not completely efficient. There Advances in Social Science, Education and Humanities Research, volume 428 exists many effects surrounding the capital market, such as the government or policy intervene, the manipulation of insider information holders and its instability as a developing market. However, stock price prediction still draws widely attention, since its relationship to investors' return and economic level. As the rapid development of computer science, machine learning provides new methods to predict stock price. In this experiment, we only used the simplest BP neural network for stock price prediction. In the study of a lot of historical data, the results show that We can well predict the stock price in the short term in the future. Therefore, when more complex networks are established, We are also confident of looking forward to better results.