Applying Time Series Analysis Builds Stock Price Forecast Model

Time series analysis is a theory that used random process and mathematical statistics theory to analyze time .It is apply comprehensive to national economy macroeconomic adjustment and control, area complex development plan, enterprise operating management, market potential forecasting, weather hydrology prediction. It is an important means for estimation and forecast. The stock price has very deep effect to the economic benefits of the nation and the macro-economy policy. So people pay close attention to it. In this article, SSE composite index of one year is fitted two kinds of time series models, then forecast in short-time. Comparing the estimated valve with the true valve, the result is the relative error is small. So I think the model is suited to the data. At last, compare the two models.

1. ARIMA model ARIMA (p, d, q) the model has the following structure: The abbreviated formula is ( ) ( ) , { } t ε zero average value white noise series.( ) , ∇ is the difference operator, d is the difference order, B is backward shift operator 1 t t Bx x − = .

Data processing
First judge the series whether to be steady or not by observing the autocorrelation coefficient figure and the partial autocorrelation coefficient figure.Second if the series is not steady, carries on the series difference or the season difference for eliminating the tendency fluctuation and the season fluctuation.If the difference can not make the series to be steady, taking the logarithm to the series to eliminates the different variance, then make the series difference.Third the steady time series is carried on the white noise check to judge whether it to be related.

Fix the step of the model
First observe the autocorrelation coefficient figure and the partial autocorrelation coefficient figure of steady non-white noise series to fix model autoregressive step p and moving average step q.But the model is not necessarily only.Second selects the suitable estimation method to estimate the unknown parameter the value.

Optimize model
Carries on the residuals white noise check and the parameter significance check to the fitting model, selects superior model in the through the check models.

Model prediction
Using fitting model forecast the series short-term trend.

ARCH model
The ARCH model full title is auto regressive conditional different variance model.
Its complete structure is ( ) .

Example analyses
The figure 1 shows the Shanghai Composite Index closing price data from January 18th, 2007 to January 13, 2008.

Establish the ARIMA model
The figure demonstrates that the series is not steady.The series has a certain trend, but does not have the season effect.
Because of that reason carries the first order difference on this sequence.The following is autocorrelation and the partial autocorrelation coefficient chart and ADF Unit Root tests diagram.Because figure 2 and figure 3 shows autocorrelations and the partial autocorrelation coefficient of the series after first order difference are first order truncation, the first order difference sequence is steady.Figure 4 show all of the P value is smaller than 0.001.It is also explained that the sequence is steady.Both the two checks have confirmed the first order difference series is steady.Figure 5 is the white noise check figure.It shows that under the level of =0.05, P value is all smaller than α .The result indicated that first order difference series is non-white noise sequence.Because the first order difference sequence is steady non-white noise sequence, it is can be used to established the ARIMA model.
Because the autocorrelation and the partial autocorrelation coefficient of the difference series is first order truncation try to establish ARIMA(1,1,0) model and ARIMA(0,1,1) model.Make comparison the two models After testing the parameters of the model are significant.The whole model's 2 R value is 0.9842.It is to meet the requirements.Figure 9 shows ARCH model fitting figure.The red is the fitted curve, and the black is the original curve.
Table 3 is the short-term predicted of model results.Comparing the predicted values with the true values, the relative errors are minor.Relative error's average value is 0.01902.

Conclusion
Comparing the two models, judging form the predicted outcome, the ARCH model relative error is smaller, so ARCH model fitting better than the ARIMA model.It is mainly because of the stock price change misalignment behavior; ARIMA model for time series prediction only considers the characteristics of the time series, without taking into account the stock price itself is affected by many unpredictable and complex factors; these factors can only indicated by the stochastic disturbing term in the ARIMA model that is actually unable to display in the forecast expectation value.In addition, ARIMA models generally assume that the model residuals are zero average value and same variance, but in fact stock index series of china often are different variance.

Figure
Figure 4. ADF Unit Root Tests figure

Table 1
Figure 7 shows fitting figure of ARIMA (1,1,0) model.The figure shows that the fitting figure and the original figure superpose basically.So we can decide the model build successfully.The modeling goal is the forecast.Table2shows the model short-term predicted results.Comparing the predicted values with the true values, the relative errors are minor.Relative error's average value is 0.04072.Check the residual series which have rejected the tendency item to judge whether it to be the autocorrelation or the different variance.Figure8shows residual series DW check amount P value is smaller than 0.001; it explained that the residual series is the autocorrelation.And the PortmanteaQ statistics and Lagrange number multiplication LM check amount P value is smaller than 0.001; it explained that residual series is different variance shows the AIC value and the SBC value and erroneous estimated value of the AR (1) model are smaller than those of MA (1) model.It can be determined that ARIMA (1,1,0) model is better than ARIMA (0,1,1) model.Therefore designate ARIMA (1,1,0) model to fit the sequence.The chart 6 is the model parameter estimated value and the significance check and the residual white noise check result.Because the P value is bigger than 0.05 in the residual white noise check result, the residual is the white noise series.