# Frequency-Division Combination Forecasting of Stock Market Based on Wavelet Multiresolution Analysis

Authors: Shihua Luo; Jiangyou Huo; Zian Dai
Journal: Discrete Dynamics in Nature and Society
 (2018)

---

## Abstract

Put forward a novel combination forecasting method (M-ARIMA-BP) that could make a more accurate and concise prediction of stock market based on wavelet multiresolution analysis. This innovative method operated by parsing of the low-frequency trend series and the high-frequency volatility series of stock market and gives an insight into the price series. Using the daily closing price data of SSE (Shanghai Stock Exchange) Composite Index and Shenzhen Component Index as samples, compared with conventional wavelet prediction model, ARIMA model, and BP neural network model, the empirical results show that the new algorithm M-ARIMA-BP can improve the accuracy of volatility forecasting and perform better in predicting prices rising and falling.


---

## Body

## 1. Introduction

The research of forecasting the stock market fluctuation is getting more and more popular since it is the premise for the macroeconomic regulation of the market. However, the stock market is extremely complicated and difficult to predict since the stock price will be affected by various factors such as currency, unexpected occurrences, and other external factors [1, 2]. Not only the effects of single factor but also the cross effects among these factors will cause the expansion of the complexity and difficulties in prediction. Therefore many intelligent models and simulation platforms are developed to optimize the researches [3].Previously, many kinds of single-method model were applied, such as ARIMA [4–6], GARCH [7, 8], Markov-Chain [9], SVM [10], and neural network [11–13]. Although these methods illustrate the law of stock market at a certain extent and provide very optimal effects in both theoretical and practice work, the limitation of single method and complexity of market determines that these researches still need to be improved. For instance, ARIMA is a mature method, but its assumption has limit capability on nonlinear fitting of the market fluctuation. Neural network algorithm can reasonably deal with the nonlinear component of the series while it suffers with the problems of “over study” and “lacking study”. Recently combined-method, such as ARMA-GARCH, SVM-GARCH, and PCA-FOA-SVR [14–17], had been applied frequently and provides very positive results. Although combined-methods were proved to be valuable, there are still shortages such as complexity of models, difficulty in explaining the process and results. It is worth improving and interesting to improve these methods in order to provide a more optimized result in the future.Peter and other experts used to point out that stock market is formed up by the investors with different trading frequency [18]. The diversity of fluctuations that result from different trading frequency is decentralization reflected on various time measurements. Praised as the microscope of mathematics, wavelet analysis theory can factorize the stock price series into diversified frequency and thus provide the capability to capture information from multiple measurements. Being smooth, low-frequency components always reflect the fluctuated trend of original series; thus concise and suitable models like ARIMA possess the capability to predict it. At the same time, the high-frequency part always fluctuates heavily; therefore, intelligent models, such as neutral network, provide advanced advantages in fitting and forecasting. Based on the foregoing, in this paper, a new organically combined stock price predicting method (M-ARIMA-BP) is presented by combining wavelet Mallat algorithm, ARIMA, and BP neutral network. The framework of this algorithm can be described as follows: at the very beginning, the stock price index series (such as SSE Composite Index and the Shenzhen Component Index) will be factorized into approximate signal and detail signals by Mallta factorization algorithm; furthermore, the two kinds of signals will be manipulated separately in the reconstruction procedure in order to get the reconstructed low-frequency trend series and high-frequency volatility series; then, ARIMA with simplicity is applied to predict the low-frequency trend series while BP neutral network with strong ability of fitting is applied to forecast the high-frequency volatility series; finally, the final value will be carried out by the rational superposition of the two prediction results. By dividing low-frequency and high-frequency, the composite algorithm is able to play up strengths and avoid weakness, and its complexity is acceptable. The simulation suggests that the research carried out in this essay is positively effective.


## 2. M-ARIMA-BP Estimation

### 2.1. Mallat Algorithm

Mallat algorithm, also known as Pyramid Algorithm, is based on multiresolution analysis proposed by S. Malla during 1988-1990. It includes both factorization and reconstruction algorithms which enable orthogonal wavelets function to factorize or reconstruct the signals with a high speed:(1)Cj+1=HCj⟺cj,n=2-1/2∑k∈Zh2k-ncj-1,kDj+1=GCj⟺dj,n=2-1/2∑k∈Zg2k-ncj-1,kj=0,1,2…J(2)Cj=HCj+1+GDj+1j=0,1,2…JEquation (1) is the factorization algorithm. Affected by low-pass filter and high-pass filter, signal Cj-1 is factorized into approximate signal Cj and detail signal Dj under the circumstance of resolution ratio of 2-j, and j is the number of layers during the factorization process. Equation (2) is the Mallat reconstruction algorithm; it is the reserve process of factorization algorithm.Applying Mallat algorithm, the fluctuation with varies measurements and frequencies can be captured and expressed much better by choosing a suitable filter approach. The variation trend can be recognized by low-pass filter, while with high-pass filter the high-frequency component can be captured from original series, which provides the possibility for frequency-division research of original series.


### 2.2. ARIMA

Presented in the 1970s by Box and Jenkins, ARIMA (Autoregressive integrated Moving Average Model) is an applicable predicting method for nonstationary time series. A common ARIMA (p, d, q) can be represented by the following equations:(3)Wt=∇dYtWt=α1Wt-1+α2Wt-2+⋯+αpWt-p+et-β1et-1-⋯-βqet-qParameter p stands for the order of autoregressive, d is the times of difference, and q is the order of moving average. The prediction can be processed after the necessary inspection and parameter estimation. Taking ARIMA (1, 1, 1) as an example, the one-step predicting results after time t can be calculated by the following equations:(4)Yt-Yt-1=c+αYt-1-Yt-2+et-βet-1Y^t1=c^+1+α^Yt-α^Yt-1-β^etBeing one of the time series models, ARIMA not only has its own dependency but also considers the interference from random fluctuation. Performing simply and efficiently in short-term trend forecasting, ARIMA is a kind of typical choice in many areas.


### 2.3. BP Neutral Network

BP (Backpropagation) neural network model, proposed by Rumelhart, Geoffrey Hinton, and Mc. Celland in the 1980s separately, is one of the most widely used neural network models. It includes both the forward propagation of signals and the backward propagation of errors. During the process of signal forward propagation, sample will be input from the input layer and then manipulated in the hidden layer after it reaches the output layer and outputs the result. If the error between the reality and expectation is not satisfied, the process turns to the step of error backward propagation. In this procedure, the error will be propagated backwardly from hidden layer to input layer and proportioned to the all units of each layer, in order to gather the entire error signal which will be the gauge for units adjusting. The whole process will keep running until the error is in an acceptable level. Although, in fitting nonlinear high-frequency signal, BP neural network usually provides more flexibility and advantages than classical time series models, many drawbacks, such as overfitting and local optimal solution, still need to be avoided and considered systematically.


### 2.4. Frequency-Divided Composite Predicting Model Based on Wavelet Multiresolution Analysis (M-ARIMA-BP)

Based on Mallat algorithm, ARIMA, and BP neural network methods, considering the multifrequency coupling of stock market time series, we obtained an ARIMA-BP neutral network combined algorithm named as M-ARIMA-BP. In this algorithm, the original series is divided into low-frequency and high-frequency through factorization and reconstruction, after which ARIMA is applied for low-frequency trend prediction while BP neutral network is applied for high-frequency volatility analyze. Finally, the analysis results from the ARIMA and BP neutral network will be combined. Figure1 describes the whole forecasting.Figure 1
Topological graph of combination forecasting algorithm.The forecasting steps are as follows:( 1 ) Factorization: with original stock index time series {xn;n=1,2,…,N}, suitable wavelet generating function ψ and factorization level J will be selected to factorize the time series in order to get the approximate signal CJ and detail signals D1,D2…DJ.( 2 ) High-frequency volatility series reconstruction: the approximate signal CJ will be replaced by its mean CMean, while detail signals are ignored, after which the high-frequency volatility series {xnh;n=1,2,…,N} will be reconstructed by predetermined wavelet function ψ.( 3 ) Low-frequency trend series reconstruction: all the detail signals will be replaced by 0 series, while approximate signal is ignored, after which the low-frequency trend series {xnl;n=1,2,…,N} will be reconstructed by predetermined wavelet function ψ.( 4 ) Frequency-divided prediction: BP neutral network is applied for high-frequency volatility series prediction while ARIMA is applied for low-frequency trend series prediction.( 5 ) Prediction of original series by superposition: the result of prediction in step 3 and step 4 will be combined by suitable superposition rule. In this paper the superposition rule is selected as x¯n+1=xn+1-h+xn+1-l-xmean-l.Factorized and reconstructed by Mallat algorithm, low-frequency series eliminated the disturbing of detail signals. It smoothens the original series and presents the long-term trend of stock price. High-frequency volatility series has notable nonlinearity; it is the fluctuation along the mean level of the original series, which represents the random fluctuation of stock price. Dividing original series into two series by frequency level then forecasting by ARIMA and BP neutral network, both take the advantages of these two models and limit their shortages. M-ARIMA-BP considered the variety measurement level and frequency level of original data; what is more it avoids the limitation of single model.


## 2.1. Mallat Algorithm

Mallat algorithm, also known as Pyramid Algorithm, is based on multiresolution analysis proposed by S. Malla during 1988-1990. It includes both factorization and reconstruction algorithms which enable orthogonal wavelets function to factorize or reconstruct the signals with a high speed:(1)Cj+1=HCj⟺cj,n=2-1/2∑k∈Zh2k-ncj-1,kDj+1=GCj⟺dj,n=2-1/2∑k∈Zg2k-ncj-1,kj=0,1,2…J(2)Cj=HCj+1+GDj+1j=0,1,2…JEquation (1) is the factorization algorithm. Affected by low-pass filter and high-pass filter, signal Cj-1 is factorized into approximate signal Cj and detail signal Dj under the circumstance of resolution ratio of 2-j, and j is the number of layers during the factorization process. Equation (2) is the Mallat reconstruction algorithm; it is the reserve process of factorization algorithm.Applying Mallat algorithm, the fluctuation with varies measurements and frequencies can be captured and expressed much better by choosing a suitable filter approach. The variation trend can be recognized by low-pass filter, while with high-pass filter the high-frequency component can be captured from original series, which provides the possibility for frequency-division research of original series.


## 2.2. ARIMA

Presented in the 1970s by Box and Jenkins, ARIMA (Autoregressive integrated Moving Average Model) is an applicable predicting method for nonstationary time series. A common ARIMA (p, d, q) can be represented by the following equations:(3)Wt=∇dYtWt=α1Wt-1+α2Wt-2+⋯+αpWt-p+et-β1et-1-⋯-βqet-qParameter p stands for the order of autoregressive, d is the times of difference, and q is the order of moving average. The prediction can be processed after the necessary inspection and parameter estimation. Taking ARIMA (1, 1, 1) as an example, the one-step predicting results after time t can be calculated by the following equations:(4)Yt-Yt-1=c+αYt-1-Yt-2+et-βet-1Y^t1=c^+1+α^Yt-α^Yt-1-β^etBeing one of the time series models, ARIMA not only has its own dependency but also considers the interference from random fluctuation. Performing simply and efficiently in short-term trend forecasting, ARIMA is a kind of typical choice in many areas.


## 2.3. BP Neutral Network

BP (Backpropagation) neural network model, proposed by Rumelhart, Geoffrey Hinton, and Mc. Celland in the 1980s separately, is one of the most widely used neural network models. It includes both the forward propagation of signals and the backward propagation of errors. During the process of signal forward propagation, sample will be input from the input layer and then manipulated in the hidden layer after it reaches the output layer and outputs the result. If the error between the reality and expectation is not satisfied, the process turns to the step of error backward propagation. In this procedure, the error will be propagated backwardly from hidden layer to input layer and proportioned to the all units of each layer, in order to gather the entire error signal which will be the gauge for units adjusting. The whole process will keep running until the error is in an acceptable level. Although, in fitting nonlinear high-frequency signal, BP neural network usually provides more flexibility and advantages than classical time series models, many drawbacks, such as overfitting and local optimal solution, still need to be avoided and considered systematically.


## 2.4. Frequency-Divided Composite Predicting Model Based on Wavelet Multiresolution Analysis (M-ARIMA-BP)

Based on Mallat algorithm, ARIMA, and BP neural network methods, considering the multifrequency coupling of stock market time series, we obtained an ARIMA-BP neutral network combined algorithm named as M-ARIMA-BP. In this algorithm, the original series is divided into low-frequency and high-frequency through factorization and reconstruction, after which ARIMA is applied for low-frequency trend prediction while BP neutral network is applied for high-frequency volatility analyze. Finally, the analysis results from the ARIMA and BP neutral network will be combined. Figure1 describes the whole forecasting.Figure 1
Topological graph of combination forecasting algorithm.The forecasting steps are as follows:( 1 ) Factorization: with original stock index time series {xn;n=1,2,…,N}, suitable wavelet generating function ψ and factorization level J will be selected to factorize the time series in order to get the approximate signal CJ and detail signals D1,D2…DJ.( 2 ) High-frequency volatility series reconstruction: the approximate signal CJ will be replaced by its mean CMean, while detail signals are ignored, after which the high-frequency volatility series {xnh;n=1,2,…,N} will be reconstructed by predetermined wavelet function ψ.( 3 ) Low-frequency trend series reconstruction: all the detail signals will be replaced by 0 series, while approximate signal is ignored, after which the low-frequency trend series {xnl;n=1,2,…,N} will be reconstructed by predetermined wavelet function ψ.( 4 ) Frequency-divided prediction: BP neutral network is applied for high-frequency volatility series prediction while ARIMA is applied for low-frequency trend series prediction.( 5 ) Prediction of original series by superposition: the result of prediction in step 3 and step 4 will be combined by suitable superposition rule. In this paper the superposition rule is selected as x¯n+1=xn+1-h+xn+1-l-xmean-l.Factorized and reconstructed by Mallat algorithm, low-frequency series eliminated the disturbing of detail signals. It smoothens the original series and presents the long-term trend of stock price. High-frequency volatility series has notable nonlinearity; it is the fluctuation along the mean level of the original series, which represents the random fluctuation of stock price. Dividing original series into two series by frequency level then forecasting by ARIMA and BP neutral network, both take the advantages of these two models and limit their shortages. M-ARIMA-BP considered the variety measurement level and frequency level of original data; what is more it avoids the limitation of single model.


## 3. Simulation and Analysis

### 3.1. Data Source

In order to test and verify M-ARIMA-BP algorithm in reality, the closing price of SSE (Shanghai Stock Exchange) Composite Index and Shenzhen Component Index was collected and analyzed. From Shanghai exchange 913 data were selected during 11th Jan. 2013 to 18th Oct. 2016 as modeling sample while 20 data were selected during 19th Oct. 2016 to 15th Nov. 2016 as testing sample. From Shenzhen exchange 929 data were selected during 4th Jan. 2013 to 2nd Nov. 2016 as modeling sample while 20 data were selected during 3rd Nov. 2016 to 30th Nov. 2016 as testing sample.


### 3.2. Empirical Analysis

The process of modeling will be explained by taking Shanghai exchange as an example.( 1 ) Wavelet factorization: due to the strong fluctuation of stock price during the period that was selected, db wavelet with orthogonality and approximated symmetry was selected. Avoiding the potential huge information loss, the vanishing moments and factorization level should not be over stated. After times of experiments, db3 wavelet function and 3-level factorization were chosen.( 2 ) Wavelet reconstruction: approximate signal and detail signals from Mallat factorization were replaced. Formed up by these data, the reconstructed series possess stronger homo-frequency components and characteristics. The short-term fluctuation was eliminated in low-frequency series and long-term trend effects were removed in high-frequency series as illustrated in Figure 2.Figure 2
LF trend series and HF volatility series.( 3 ) Modeling and forecasting: being nonstationary, low-frequency series should be first-order difference and then test the unit root. It is illustrated in Figure 3 that the autocorrelation and partially autocorrelation are falling into an acceptable error range, which can be considered as the typical characteristics of heavy-tailed. Therefore, classical ARIMA is a reasonable model for modeling.Figure 3
Autocorrelation and partial correlation function of the differential series.BIC (Bayesian Information Criterion) method is applied to help estimating the orders of models. As illustrated in Figure4, each row presents an ARIMA subset while the shadowed units present the lag so that models with lower BIC value are positioned in higher rows. It can be found that models placed in the first and second row is better. After experiments and comparisons between models ARIMA (4, 1, 8) was selected to simulated low-frequency series.Figure 4
The BIC of the ARIMA model.The autocorrelation function of residual series is demonstrated in Figure5; the residual value fits white noise well. Therefore, it is can be concluded that the established model has captured most of information of sample. Further predictive analysis can be conducted.Figure 5
Autocorrelation function of residual sequence.When fitting nonlinear high-frequency volatility signals, neutral network model provides much better flexibility and advantages than classical time series models. Therefore, BP neutral network model is selected to model and analyze the high-frequency volatility series. In the modeling process, the performance of the model will be affected by the topology structure, learning algorithms, and parameters of the network.Topology structure: it is commonly accepted that increasing the number of hidden layer nodes can reduce the network error and promote the accuracy, but it may complicate the network, which costs more training time and lead to overfitting problem. In this paper, 3-layer BP neutral network (thus include 1 hidden layer) was selected. The choice of hidden layer is very significant, since it will not only affect the function of neutral network strongly but also it is the direct reason causing overfitting problem during training. However, until nowadays there is still no universal method to estimate it. Most published methods are based on the assumption of tremendous data, which cannot be sure in reality. After times of experiments and comparison a 3-layer BP neutral network with 5 input layer nodes, 18 middle layer nodes and 1 output layer node were established and presented as BP (5, 18, 1).Learning algorithm: standard BP algorithm is essentially a gradient descent algorithm which has the drawbacks as slow in convergence and trapped into local minimum, if the objective function is complex. In this essay, a momentum attached and self-adaption learning rate BP network were selected. The momentum term helped to get out of flat area, in order to avoid local minimum, while self-adaption learning rate is a promotion for standard BP algorithm. Since a fixed learning rate is difficult to guarantee great performance throughout the training process and may cause the problem of oscillation (if it is overstated) or slow in convergence (if it is understated), self-adaption learning rate may choose its own learning rate depending on the current situation and then improve the accuracy and speed of training.Parameter of network: the determination of BP neural network parameters needs to undergo a large number of tests. During the test process, a large step size can be used to determine the range of the parameters, and then the small step size can be used to locate the optimal parameters. In establishing initial learning constant, the first step is to estimate the order of magnitude such that we start training fromη=0.01. If the global error keeps reducing in the training process, we then increase the learning constant such as η=0.1,1.0,…, until learning limit. If we find a η that will lead to the fluctuation of increase of global error, then the magnitude of the previous learning rate is relatively optimal. After several experiments we choose 0.2 as our learning constant.For the estimation of threshold value, we applied the method mentioned in Neural Networks and Deep Learning. The N ~ (0,1/n) (n stands for the number of weight or bias) distribution was selected to initialize the weight and bias. By the downward extrusion of this distribution, the neuron will not reach the saturation, thus the learning process can avoid from speed reduction [19]. In this essay the same method was picked up to initialize the weight and threshold value.After many times of attempts, the following parameters were selected in Table1.Table 1
Network parameter table.
learningrate learning rateincremental factor learning ratereduction factor momentum targeterror maximum numberof iterations 0.2 1.05 0.7 0.9 0.01 1000It can be found from Figure6 that, along with the iteration, training error keeps reducing and convergent at the 66th time with order of magnitude of 10-2 at the best level. In addition, the error curves of the three data set of the train, validation, and test did not deviate significantly, indicating that there is no overfitting problem in the network.Figure 6
The error characteristic curve.Modeling of low-frequency trend series and high-frequency volatility series separately, Figures7 and 8, respectively, provides predicted results of the two series, which are 20 days beyond modeling samples. It can be seen that the ARIMA model can predict the future trend of stock price very accurately, while BP neural network has a good performance in predicting the fluctuation of stock price in noisy environment.Figure 7
ARIMA prediction results.Figure 8
BP neural network prediction results.( 4 ) Result: the superposition algorithm should be tested before predicting process based on the results of frequency-division prediction. Figure 9 shows the comparison between the superimposed series and the original stock price series. It can be seen that the tow series are almost overlapped. Focusing on 20 sample points in the prediction set, it can also be found that the error caused by the superposition process is small, as shown in Table 2. Therefore, the superposition rule is effective.Table 2
Error caused by the superposition process.
Day 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th  Error -0.002 -0.005 -0.020 -0.040 -0.022 0.002 0.009 0.014 0.010 0.001  Day 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th  Error 0.017 0.013 0.028 0.026 0.019 0.013 -0.026 -0.030 -0.021 -0.011Figure 9
Superimposed series and original series.After the test of superposition method, we choose the period from 19th Oct. 2016 to 15th Nov. 2016 as the extension test period. The results are shown in Table3. The composite algorithm provides a very satisfied result with relative mean error of 0.108% and absolute mean error of 3.409.Table 3
Combination prediction results.
Data Original Prediction Relative error Error 2016/10/19 3084.719 3084.729 0.00% 0.010 2016/10/20 3084.458 3084.131 0.01% -0.327 2016/10/21 3090.941 3090.266 0.02% -0.675 2016/10/24 3128.247 3127.211 0.03% -1.035 2016/10/25 3131.939 3130.542 0.04% -1.397 2016/10/26 3116.312 3114.556 0.06% -1.756 2016/10/27 3112.350 3110.236 0.07% -2.114 2016/10/28 3104.270 3101.802 0.08% -2.468 2016/10/31 3100.492 3097.670 0.09% -2.822 2016/11/1 3122.436 3119.258 0.10% -3.177 2016/11/2 3102.733 3099.203 0.11% -3.530 2016/11/3 3128.936 3125.056 0.12% -3.880 2016/11/4 3125.317 3121.078 0.14% -4.239 2016/11/7 3133.333 3128.722 0.15% -4.610 2016/11/8 3147.888 3142.894 0.16% -4.993 2016/11/9 3128.370 3122.979 0.17% -5.391 2016/11/10 3171.282 3165.483 0.18% -5.799 2016/11/11 3196.044 3189.827 0.19% -6.217 2016/11/14 3210.371 3203.724 0.21% -6.647 2016/11/15 3206.986 3199.895 0.22% -7.091


### 3.3. Simulation Results Comparison between Models

In order to represent the accuracy of M-ARIMA-BP, the comparison had been made between M-ARIMA-BP, ARIMA, and BP neutral network. In this essay we brought suitable conventional wavelet prediction model, ARIMA (8, 1, 8), and BP neutral network with structure of (5, 20, 1) to analyze the original data separately. The result was demonstrated by Figures10 and 11 and Table 4.Table 4
Comparison of the prediction results of Shanghai Stock Index.
M-ARIMA-BP Conventional wavelet BPNN ARIMA mean absolute error 3.409 3.957 13.621 15.604 mean relative error 0.108% 0.126% 0.434% 0.497% accuracy in predictionsof prices rise and fall 100% 80% 50% 50%Figure 10
Comparison of the prediction results of Shanghai Stock Index.Figure 11
Absolute error of single point prediction of Shanghai Stock Index.Compared with ARIMA and BP neutral network method, M-ARIMA-BP provides a better prediction result with lower value of relative mean error and absolute mean error. It is worth pointing out that, at some time point, such as 24th Oct. 2016 and 10th Nov. 2016, single method brought a huge error while M-ARIMA-BP did not suffer the same problem. What is more, M-ARIMA-BP also performs more stationary in the forecasting of directions. In addition, compared with conventional wavelet prediction, M-ARIMA-BP performs better. The reason might be that conventional wavelet method requires more series to be fit during the process (in the essay, the original series was decomposed into three levels, which means one low-frequency series and three high-frequency series were need to be modeled and analyzed). However, due to the data itself and subjective of human, models are always difficult to be established accurately. Therefore, the conventional wavelet prediction method generates more cumulative prediction errors.The simulation of Shenzhen exchange has similar result as of Shanghai exchange. M-ARIMA-BP provides lower error and more stable in prediction of direction. The result can be found in Figures12 and 13 and Table 5.Table 5
Comparison of the prediction results of Shenzhen Stock Index.
M-ARIMA-BP Conventional wavelet BPNN ARIMA mean absolute error 28.531 37.912 45.417 48.880 mean relative error 0.262% 0.349% 0.418% 0.450% accuracy in predictionsof prices rise and fall 70% 55% 50% 60%Figure 12
Comparison of the prediction results of Shenzhen Stock Index.Figure 13
Absolute error of single point prediction of Shenzhen Stock Index.


## 3.1. Data Source

In order to test and verify M-ARIMA-BP algorithm in reality, the closing price of SSE (Shanghai Stock Exchange) Composite Index and Shenzhen Component Index was collected and analyzed. From Shanghai exchange 913 data were selected during 11th Jan. 2013 to 18th Oct. 2016 as modeling sample while 20 data were selected during 19th Oct. 2016 to 15th Nov. 2016 as testing sample. From Shenzhen exchange 929 data were selected during 4th Jan. 2013 to 2nd Nov. 2016 as modeling sample while 20 data were selected during 3rd Nov. 2016 to 30th Nov. 2016 as testing sample.


## 3.2. Empirical Analysis

The process of modeling will be explained by taking Shanghai exchange as an example.( 1 ) Wavelet factorization: due to the strong fluctuation of stock price during the period that was selected, db wavelet with orthogonality and approximated symmetry was selected. Avoiding the potential huge information loss, the vanishing moments and factorization level should not be over stated. After times of experiments, db3 wavelet function and 3-level factorization were chosen.( 2 ) Wavelet reconstruction: approximate signal and detail signals from Mallat factorization were replaced. Formed up by these data, the reconstructed series possess stronger homo-frequency components and characteristics. The short-term fluctuation was eliminated in low-frequency series and long-term trend effects were removed in high-frequency series as illustrated in Figure 2.Figure 2
LF trend series and HF volatility series.( 3 ) Modeling and forecasting: being nonstationary, low-frequency series should be first-order difference and then test the unit root. It is illustrated in Figure 3 that the autocorrelation and partially autocorrelation are falling into an acceptable error range, which can be considered as the typical characteristics of heavy-tailed. Therefore, classical ARIMA is a reasonable model for modeling.Figure 3
Autocorrelation and partial correlation function of the differential series.BIC (Bayesian Information Criterion) method is applied to help estimating the orders of models. As illustrated in Figure4, each row presents an ARIMA subset while the shadowed units present the lag so that models with lower BIC value are positioned in higher rows. It can be found that models placed in the first and second row is better. After experiments and comparisons between models ARIMA (4, 1, 8) was selected to simulated low-frequency series.Figure 4
The BIC of the ARIMA model.The autocorrelation function of residual series is demonstrated in Figure5; the residual value fits white noise well. Therefore, it is can be concluded that the established model has captured most of information of sample. Further predictive analysis can be conducted.Figure 5
Autocorrelation function of residual sequence.When fitting nonlinear high-frequency volatility signals, neutral network model provides much better flexibility and advantages than classical time series models. Therefore, BP neutral network model is selected to model and analyze the high-frequency volatility series. In the modeling process, the performance of the model will be affected by the topology structure, learning algorithms, and parameters of the network.Topology structure: it is commonly accepted that increasing the number of hidden layer nodes can reduce the network error and promote the accuracy, but it may complicate the network, which costs more training time and lead to overfitting problem. In this paper, 3-layer BP neutral network (thus include 1 hidden layer) was selected. The choice of hidden layer is very significant, since it will not only affect the function of neutral network strongly but also it is the direct reason causing overfitting problem during training. However, until nowadays there is still no universal method to estimate it. Most published methods are based on the assumption of tremendous data, which cannot be sure in reality. After times of experiments and comparison a 3-layer BP neutral network with 5 input layer nodes, 18 middle layer nodes and 1 output layer node were established and presented as BP (5, 18, 1).Learning algorithm: standard BP algorithm is essentially a gradient descent algorithm which has the drawbacks as slow in convergence and trapped into local minimum, if the objective function is complex. In this essay, a momentum attached and self-adaption learning rate BP network were selected. The momentum term helped to get out of flat area, in order to avoid local minimum, while self-adaption learning rate is a promotion for standard BP algorithm. Since a fixed learning rate is difficult to guarantee great performance throughout the training process and may cause the problem of oscillation (if it is overstated) or slow in convergence (if it is understated), self-adaption learning rate may choose its own learning rate depending on the current situation and then improve the accuracy and speed of training.Parameter of network: the determination of BP neural network parameters needs to undergo a large number of tests. During the test process, a large step size can be used to determine the range of the parameters, and then the small step size can be used to locate the optimal parameters. In establishing initial learning constant, the first step is to estimate the order of magnitude such that we start training fromη=0.01. If the global error keeps reducing in the training process, we then increase the learning constant such as η=0.1,1.0,…, until learning limit. If we find a η that will lead to the fluctuation of increase of global error, then the magnitude of the previous learning rate is relatively optimal. After several experiments we choose 0.2 as our learning constant.For the estimation of threshold value, we applied the method mentioned in Neural Networks and Deep Learning. The N ~ (0,1/n) (n stands for the number of weight or bias) distribution was selected to initialize the weight and bias. By the downward extrusion of this distribution, the neuron will not reach the saturation, thus the learning process can avoid from speed reduction [19]. In this essay the same method was picked up to initialize the weight and threshold value.After many times of attempts, the following parameters were selected in Table1.Table 1
Network parameter table.
learningrate learning rateincremental factor learning ratereduction factor momentum targeterror maximum numberof iterations 0.2 1.05 0.7 0.9 0.01 1000It can be found from Figure6 that, along with the iteration, training error keeps reducing and convergent at the 66th time with order of magnitude of 10-2 at the best level. In addition, the error curves of the three data set of the train, validation, and test did not deviate significantly, indicating that there is no overfitting problem in the network.Figure 6
The error characteristic curve.Modeling of low-frequency trend series and high-frequency volatility series separately, Figures7 and 8, respectively, provides predicted results of the two series, which are 20 days beyond modeling samples. It can be seen that the ARIMA model can predict the future trend of stock price very accurately, while BP neural network has a good performance in predicting the fluctuation of stock price in noisy environment.Figure 7
ARIMA prediction results.Figure 8
BP neural network prediction results.( 4 ) Result: the superposition algorithm should be tested before predicting process based on the results of frequency-division prediction. Figure 9 shows the comparison between the superimposed series and the original stock price series. It can be seen that the tow series are almost overlapped. Focusing on 20 sample points in the prediction set, it can also be found that the error caused by the superposition process is small, as shown in Table 2. Therefore, the superposition rule is effective.Table 2
Error caused by the superposition process.
Day 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th  Error -0.002 -0.005 -0.020 -0.040 -0.022 0.002 0.009 0.014 0.010 0.001  Day 11th 12th 13th 14th 15th 16th 17th 18th 19th 20th  Error 0.017 0.013 0.028 0.026 0.019 0.013 -0.026 -0.030 -0.021 -0.011Figure 9
Superimposed series and original series.After the test of superposition method, we choose the period from 19th Oct. 2016 to 15th Nov. 2016 as the extension test period. The results are shown in Table3. The composite algorithm provides a very satisfied result with relative mean error of 0.108% and absolute mean error of 3.409.Table 3
Combination prediction results.
Data Original Prediction Relative error Error 2016/10/19 3084.719 3084.729 0.00% 0.010 2016/10/20 3084.458 3084.131 0.01% -0.327 2016/10/21 3090.941 3090.266 0.02% -0.675 2016/10/24 3128.247 3127.211 0.03% -1.035 2016/10/25 3131.939 3130.542 0.04% -1.397 2016/10/26 3116.312 3114.556 0.06% -1.756 2016/10/27 3112.350 3110.236 0.07% -2.114 2016/10/28 3104.270 3101.802 0.08% -2.468 2016/10/31 3100.492 3097.670 0.09% -2.822 2016/11/1 3122.436 3119.258 0.10% -3.177 2016/11/2 3102.733 3099.203 0.11% -3.530 2016/11/3 3128.936 3125.056 0.12% -3.880 2016/11/4 3125.317 3121.078 0.14% -4.239 2016/11/7 3133.333 3128.722 0.15% -4.610 2016/11/8 3147.888 3142.894 0.16% -4.993 2016/11/9 3128.370 3122.979 0.17% -5.391 2016/11/10 3171.282 3165.483 0.18% -5.799 2016/11/11 3196.044 3189.827 0.19% -6.217 2016/11/14 3210.371 3203.724 0.21% -6.647 2016/11/15 3206.986 3199.895 0.22% -7.091


## 3.3. Simulation Results Comparison between Models

In order to represent the accuracy of M-ARIMA-BP, the comparison had been made between M-ARIMA-BP, ARIMA, and BP neutral network. In this essay we brought suitable conventional wavelet prediction model, ARIMA (8, 1, 8), and BP neutral network with structure of (5, 20, 1) to analyze the original data separately. The result was demonstrated by Figures10 and 11 and Table 4.Table 4
Comparison of the prediction results of Shanghai Stock Index.
M-ARIMA-BP Conventional wavelet BPNN ARIMA mean absolute error 3.409 3.957 13.621 15.604 mean relative error 0.108% 0.126% 0.434% 0.497% accuracy in predictionsof prices rise and fall 100% 80% 50% 50%Figure 10
Comparison of the prediction results of Shanghai Stock Index.Figure 11
Absolute error of single point prediction of Shanghai Stock Index.Compared with ARIMA and BP neutral network method, M-ARIMA-BP provides a better prediction result with lower value of relative mean error and absolute mean error. It is worth pointing out that, at some time point, such as 24th Oct. 2016 and 10th Nov. 2016, single method brought a huge error while M-ARIMA-BP did not suffer the same problem. What is more, M-ARIMA-BP also performs more stationary in the forecasting of directions. In addition, compared with conventional wavelet prediction, M-ARIMA-BP performs better. The reason might be that conventional wavelet method requires more series to be fit during the process (in the essay, the original series was decomposed into three levels, which means one low-frequency series and three high-frequency series were need to be modeled and analyzed). However, due to the data itself and subjective of human, models are always difficult to be established accurately. Therefore, the conventional wavelet prediction method generates more cumulative prediction errors.The simulation of Shenzhen exchange has similar result as of Shanghai exchange. M-ARIMA-BP provides lower error and more stable in prediction of direction. The result can be found in Figures12 and 13 and Table 5.Table 5
Comparison of the prediction results of Shenzhen Stock Index.
M-ARIMA-BP Conventional wavelet BPNN ARIMA mean absolute error 28.531 37.912 45.417 48.880 mean relative error 0.262% 0.349% 0.418% 0.450% accuracy in predictionsof prices rise and fall 70% 55% 50% 60%Figure 12
Comparison of the prediction results of Shenzhen Stock Index.Figure 13
Absolute error of single point prediction of Shenzhen Stock Index.


## 4. Conclusion

In this paper, M-ARIMA-BP algorithm was established based on wavelet multiresolution analysis and applied in the prediction of fluctuation of stock market. The main conclusions are as follows.Dividing the original series, estimating M-ARIMA-BP algorithm provides more accurate and simple condition for prediction.M-ARIMA-BP algorithm was proved to be better than single method (ARIMA and BP neutral network) with lower error value and more stable direction forecasting.Compared with other Black-box algorithm, M-ARIMA-BP is easier to be expressed and applied.Compared with the conventional wavelet combination prediction method, the new algorithm can not only retain the advantages of wavelet “digital microscope” and improve the accuracy of model prediction but also reduce the subsequent modeling workload. It provides a convenient way for uniting wavelet method with other complex algorithms, such as Deep BP network.Frequency-divided prediction is a very efficient and interesting method in financial market. The promotion of it will not only provide evidence for decision makers (both investors and regulation department) but also strengthen the theory and methods of complex prediction system. In the future, in order to improve the forecasting accuracy, the way of combining different methods still needs deeper research.



---

*Source: 1259156-2018-06-13.xml*