Time series forecasting of stock market index based on ENWMPCA model

Aiming at the high dimension of factors affecting the stock market index, and the problem that MPCA algorithm cannot distinguish the contribution of different eigenvectors to financial time series forecasting, eigenvalue normalization weighted multilinear principal component analysis (ENW-MPCA) is put forward. Due to the existence of correlation between stock markets, 34 technical indexes of 7 stock markets are selected to construct a three-dimensional tensor model. Eigenvectors of different eigenvalues have different contributions to the prediction accuracy of MPCA algorithm, thus adopt ENW-MPCA algorithm for the feature extraction, which can distinguish the different contribution of eigenvectors corresponding to different eigenvalues to the prediction while reducing dimension. Then using support vector machine for regression prediction, the prediction value of financial time series is obtained. Experimental results on the Hang Seng Index shows that, compared with the MPCA, the forecasting error of ENW-MPCA is smaller and the prediction accuracy is improved to a certain extent. This indicates that the proposed algorithm can fully retain the internal structure of stock time series, proving its validity and practicability.


Introduction
As main body of financial market, stock market plays an important role in development of national economy. The change of the stock market index reflects the law of the stock market to a certain extent. Therefore, time series forecasting of stock market index has become a hot spot for both investors and academic researchers [1][2][3][4].
Due to the characteristics of high dimension and numerous related indexes of stock market index time series, directly using the prediction model for classification or regression often lead to the dimension disaster, greatly increasing the computational complexity. Therefore, many existing methods combine feature extraction algorithm and prediction model to predict [5]. Grigoryan.H et al. [6] put forward an integrated forecasting model (ICA-SVM) based on ICA and SVM. Guo.Z et al. [7] proposed a time series prediction method of stock market index based on feature fusion, combining independent component analysis and canonical correlation analysis to extract and fuse features, and then SVM model was adopted to predict.Using the correlation between related stock markets, after building a three-dimensional tensor model with a certain amount of input indexes, Guo.Z et al. [8] extracted features of the model by using multilinear principal component analysis (MPCA). And then regression prediction was carried out, and good results were obtained. However, MPCA algorithm treats the eigenvectors of each dimension equally, and does not distinguish the influence of each eigenvector in the feature matrix on the feature extraction. Therefore, in view of the fact that the MPCA algorithm cannot distinguish the influences of different eigenvectors on the prediction of financial time series, this paper proposes a eigenvalue normalization weighted multilinear principal component analysis (ENW-MPCA). The contribution of eigenvectors of different eigenvalues to the prediction accuracy is distinguished by weighting the eigenvectors of the projection matrix in all the modes of the tensor. It can not only preserve the characteristics of the original MPCA algorithm, but also increase the prediction accuracy of the algorithm by adding feature weights.

Multilinear principal component analysis (MPCA)
MPCA is a multilinear method for dimensionality reduction in all tensor modes, seeking bases in each mode that allow projected tensors to capture the majority of variation of the original tensor. It captures most of the changes of the original tensor, including the structural information and correlation, so it can achieve dimension reduction while avoiding the destruction of correlation between the sample data of PCA and overcome the shortcoming of the destruction of data structure. , project the tensor to subspace so as to achieve dimension reduction:

ENW-MPCA algorithm
Aiming at the problem that MPCA algorithm cannot distinguish the contributions of different eigenvectors on the prediction of financial time series, a eigenvalue normalization weighted multilinear principal component analysis (ENW-MPCA) is proposed in this paper. By weighting the eigenvectors of projection matrix in all the modes of the tensor, the contributions of eigenvectors of different eigenvalues to the prediction accuracy are distinguished. It can not only preserve the characteristics of the original MPCA algorithm, but also increase the prediction accuracy by adding feature weights. In this paper, the eigenvalues after normalizing are used as the weights of corresponding eigenvectors, so as to highlight the important role of eigenvectors of large eigenvalues and also reflect the auxiliary function of eigenvectors of small eigenvalues. After normalizing the eigenvalues selected The eigenvalue normalization formula is: (4) Where,P n is the dimension of eigenvectors and N is the order of the tensor sample. λ ni represents the i-th eigenvalues in the n order of the tensor sample and λ n represents the sum of eigenvalues chosen in the direction of n order.
For feature matrix U (n) (n=1,…,N), the weights are diagonal matrices consisting of , which is calculated as equation (5) Therefore, the linear transformation formula of the ENW-MPCA algorithm can be reformulated by equation (6):

Steps of ENW-MPCA algorithm
The steps to implement the algorithm are as follows: (1) Input the tensor samples: (4) Calculate the data samples after projection: ; (5) Utilize circulation to update projection matrix U (n) (n=1,…,N) constantly，and narrow the ψ y steadily until it is less than the threshold, and output the optimal projection matrix U (n) (n=1,…,N); (6) Normalize the eigenvalues of eigenvectors chosen as the projection matrix: , 1, 2 , , , 1, 2 , ,

Experimental results and analysis
In order to verify the feasibility and robustness of feature extraction of three-order tensor financial data by ENW-MPCA algorithm, experimental researches and analyses were carried out on data of the Hang Seng Index and the Nikkei 225 index, and the prediction effects were compared with MPCA algorithm and feature extraction algorithms based on vector, KPCA and PCA. The SVR of SVM

Data set preparation
The stock data collected from January 4, 2010 to December 9, 2014 contains of 34 stock indexes of 7 stock markets. Three-order tensor model is constructed and is segmented by moving sliding window. Take the empirical value 20 days for sliding window length. So the data are divided into 1000 groups and the first 800 groups are training data, and the latter are testing data. To measure the performance of the ENW-MPCA, 5 performance indicators are selected. The descriptions and formulae of these indicators are described in Table 1. Among them, y(t) is the predicted value, ( ) y t is the real value, ( ) y t is the average value of the predicted value sequence and ( ) y t is the average value of the real value sequence.

Experiments on Hang Seng Index
For SVM, there are some parameters which need to be chosen, including kernel function type t, penalty parameter c, kernel function parameter g and loss function p. Experiments show that when the value of t is 0, the effect is better than other kernel functions, that is, linear kernel function is the best. p is determined by repeated experiments and the cross validation method is used to find the optimal parameters c and g. For the prediction of the Hang Seng Index, the parameters of SVM of all algorithms are as shown in Table 2.  1. SCC verses the change of testQ When using ENW-MPCA and MPCA algorithms for the feature extraction of Hang Seng Index,testQ , which is the ratio of eigenvalues and sum of eigenvalues, is an important parameter. It determines the dimension of projection matrix of each mode, and has a strong influence on the prediction results. The dimension of tensor data is 20*34*7 . To determine the best projection space, change the value of testQ , and Figure 2 shows the curves of the SCC versus the variation of testQ . From Figure 1, ENW-MPCA and MPCA algorithm are basically increasing with the increase of SCC. Curves do not change in the former period, for the reason that the dimensions of features retained remain the same, which causes the changeless of SCC. When testQ increases to 0.9994, the feature tensor extracted is 14*7*6 and SCC of both algorithms reach the maximum. SCC for ENW-MPCA is 0.9133, and for MPCA is 0.9058. But when testQ continues to increase, SCC of the two algorithms fall instead, because the increase of redundancy leads to the decrease of prediction accuracy. Figure 2 shows the closing price prediction of Hang Seng Index based on ENW-MPCA, MPCA, KPCA and PCA algorithms. As can be seen from Figure 3, comparing ENW-MPCA with MPCA, the change of the two curves are similar, but ENW-MPCA has better agreement, smaller fluctuation and smoother curve. MPCA agrees better than KPCA and PCA, and the results are better than the two algorithms, which shows that the feature extraction algorithm based on tensor is better than algorithms based on vector.  When achieving the optimal prediction accuracy, measure indicators on Hang Seng Index by the four algorithms are shown in Tab.4. Compared with MPCA, KPCA and PCA, the performance of ENW-MPCA is optimal, and the prediction accuracy is the highest. MSE of ENW-MPCA is 69050, and the SCC is 0.9136, better than 77783 and 0.9065 of MPCA, which indicates that its predictive effect is better. This shows that using the normalized eigenvalue as the weight of corresponding eigenvector can effectively distinguish the role of different eigenvalues and has a good inhibitory effect on the inherent redundancy information extraction of MPCA algorithm, which makes a better prediction accuracy. But the error limit is -852, error of the twenty-seventh trading days, so the error range of ENW-MPCA is from -900 to 600, the scope is slightly larger than that of MPCA, which is from -800 to 600.
The predictive effect of MPCA algorithm is better than KPCA and PCA, and is more stable. This shows that MPCA, based on tensor, can better retain the original information of data, and has better prediction performance. The measure indicators of KPCA are superior to PCA, which is because the introduction of the kernel function makes KPCA enable to consider the nonlinear correlation between sample data, so the error is small. ,700] The selection of feature dimension is also related to the prediction accuracy and efficiency. The relationship between the square correlation coefficient and the feature dimension of the prediction result is analyzed. Figure 3 shows the curve of the square correlation coefficient of Hang Seng Index with the change of feature dimension. For ENW-MPCA, MPCA, KPCA and PCA, when the feature dimension alters, SCC will be different. This indicates that the chosen of feature dimension can affect the discriminant feature of the four algorithms. From the experimental results, we can see that when the feature dimension is very small, the value of SCC is slow, which is because a small number of features cannot retain enough information of data. SCC of the four algorithms increases with the increase of feature dimension firstly, then increases slowly, and then decreases after the highest point is reached. But in the whole process, the movement trend is slightly fluctuation and not smooth enough. Compared with MPCA, SCC of ENW-MPCA fluctuates more slowly with the increase of feature dimension, and the maximum of it is higher than that of the MPCA algorithm.

Conclusion
This paper puts forward a prediction method of stock market index time series based on ENW-MPCA algorithm, using tensor method to predict stock price. Making no distinction, MPCA algorithm equally treats the role of different eigenvalues, without reflecting the different influences of the major and minor eigenvalues on the eigenvectors. Therefore, improve the MPCA algorithm, using the eigenvalues after normalizing as weight of the corresponding eigenvector, and ENW-MPCA algorithm is proposed. A three-dimensional tensor model is constructed by using the historical data of the stock market indexes. After adopting ENW-MPCA algorithm to reduce the dimension and extract the features, the support vector machine is used for the regression prediction, and finally the prediction results are obtained.
Experimental results show that compared with MPCA, ENW-MPCA has better predictive effect and higher accuracy. Compared with KPCA and PCA, which are based on vector, the performance of feature extraction of ENW-MPCA is better. This shows the relationship between the structure of internal information and data retention data algorithm based on tensor can better retain the structure information of internal data the relationship between data, showing a better prediction performance. This paper verifies the feasibility of applying tensor model to predict the stock market index time series. With the development of stock market in China, it is believed that the proposed algorithm can be applied in a wide range of fields and areas.