# The Stock Index Prediction Based on SVR Model with Bat Optimization Algorithm
## 5 Empirical Research and Result Analysis
### Comparison and Analysis of Short-Term Forecast Results  
As mentioned above, the last 20, 60 and 250 days of the selected total sample time for the 18 indexes are used as short, medium and long term forecast groups for empirical testing, respectively. Furthermore, in order to verify that the proposed bat algorithm can optimize the parameters of the support vector regression model to obtain higher prediction accuracy. In this paper, the polynomial kernel function SVR with default parameters and the sigmoid kernel function SVR are selected for comparative analysis with the three evaluation metrics selected in the previous sections. Table 5 lists the three optimal initial parameters obtained after applying short-term training data andoptimizing them using the bat algorithm. Tables 6 and 7 list the short-term forecast results and comprehensive comparison results obtained under the three models of the 18 stock indexes selected in the previous article. \begin{table}
\begin{tabular}{l c c c} \hline \hline  & **Statistics** & **z-Value** & \(\mathbf{p}\)**-Value** \\ \hline Gt statistic & \(-35.907\) & \(-140.566\) & \(0.0000\) \\ \hline Ga statistic & \(-1.3\times e^{3}\) & \(-737.713\) & \(0.0000\) \\ \hline Pt statistic & \(-156.912\) & \(-121.865\) & \(0.0000\) \\ \hline Pa statistic & \(-1.4\times e^{3}\) & \(-723.217\) & \(0.0000\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Results of covariate cointegration test. As can be seen from Table 5, the bat algorithm seeking optimal SVR parameters is able to minimize the MSE as the fitness function based on the selected training set data of different stock indices and obtain the optimal parameters under different financial data sets. However, it should be clear that the optimal parameters obtained from the BA-SVR hybrid model optimization are based on the optimal fitness function set in the model. Therefore, when comparing the prediction performance of different models with other prediction accuracy evaluation indexes, different results may be obtained due to the different fitness functions. From Table 5, it can be concluded that the optimal parameter range of the penalty factor obtained by substituting the data of the 18 stock indices selected in this paper into the model ranges from 64.7818 to 97.6447. The absolute value of the optimal parameter range of the insensitive loss factor is between 0.0131 and 2.3154. The optimal range of the width parameter of the radial basis kernel function is between 1.1234 and 4.1270. Overall, the parameters of the 18 stock index short-term training group data are not significantly different after each optimization. The short-term prediction results of the BA-SVR hybrid model (column 3), which is the main model used in this paper, and the short-term prediction results of the default free-parameter polynomial kernel function SVR model (column 4) and the default free-parameter sigmoid kernel function SVR model (column 5), which are selected as the control models in this paper, are shown in Table 6 for the models trained on the test set of 18 stock index data, respectively RMSE, MAE and MAPE values. Based on the forecasting results of the 18 stock indices under the three models, it can be seen that, except for the SSE B-share, CSI 500 and SZSE B-index, the forecasting performance of the other 15 stock indices derived from the BA-SVR model forecasts and the three evaluation indicators are the best values in the three models. The two data sets of SSE B-shares and SZSE B-index are more suitable for forecasting by the sigmoid kernel function SVR model. For the CSI 500, the polynomial kernel function SVR model shows better forecasting performance.