Article Information
Corresponding Author: Zahid Latif** (zahid25latif@yahoo.com)
Ximei Liu*, School of Economics and Management, Zhejiang Sci-Tech University, Hangzhou, China, 1092457487@qq.com
Zahid Latif**, School of Economics and Management, Beijing University of Posts and Telecommunications, Beijing, China, zahid25latif@yahoo.com
Daoqi Xiong***, Zhejiang Huayun Information Technology Co. Ltd., Hangzhou, China, sehrishkhan5259@gmail.com
Sehrish Khan Saddozai**, School of Economics and Management, Beijing University of Posts and Telecommunications, Beijing, China, mzzddt@qq.com
Kaif Ul Wara****, Islamia University, Peshawar Campus, Khyber Pakhtunkhwa, Pakistan, kaifulwara01@gmail.com
Received: November 15 2017
Revision received: May 17 2018
Revision received: June 26 2018
Accepted: September 2 2018
Published (Print): October 31 2019
Published (Electronic): October 31 2019
1. Introduction
Investing in stock is one of the important ways of managing peoples’ finance. Like other goods on the trade market, stock has its own market and market price. The stock prices are easily affected by operating conditions including supply and demand, the bank interest rates and mass psychology. Consequently, its fluctuation can result in many uncertainties on the market. It is, therefore, necessary for us to establish a way to forecast the direction of the stock market price. The time series analysis is an effective method which is widely used in the areas of finance and stock prices [1-3]. The autoregressive integrated moving average (ARIMA) model is widely used in time series forecasting. It is a useful linear model that can be combined with other non-linear models in time series and regression analysis. The use of a hybrid ARIMA and neural network model has gained extensive application in forecasting stock price patterns. In this article, the hybrid ARIMA and neural model is used for forecasting the prices for the Shanghai and Shenzhen stock markets.
Given that the stock market system is quite complex and non-linear, it is generally difficult to forecast the stock prices using the ARIMA model. However, the neural network is a non-linear dynamic system and has been applied in solving non-linear regression problems. It can be used to solve the problems with unclear environmental information and unclear background knowledge. Therefore, the neural network model is a powerful tool to research the stock market [4].
The paper is organized as follows: Section 2 provides a brief discussion and structure of the model and Section 3 presents a discussion of the data collection process. In Section 4, we introduce the empirical analysis of the ARIMA model while in Section 5, the principle, algorithm and the related parameter configuration of the neural network model for stock exchanges of Shanghai and Shenzhen is proposed. This section also includes a discussion of the results, while Section 6 makes a comparison between the two stock exchange markets in China. Lastly but not least, Section 7 presents the summary and the conclusion of the study.
2. Structure Chart
Fig. 1 shows the structure chart used for forecasting the Shanghai and Shenzhen stock market prices. The underlying assumption is that the structure chart provides a useful theoretical framework for the exploration and interpretation of the research ideas developed in this article.
The structure chart for forecasting the Shanghai and Shenzhen stock markets.
3. Stock Price Index and the Data Collection
Stock price index, also referred to as stock index or index, is an indicator of the stock market behavior which can reflect the change of stock price trends. Usually we use “dot” to represent the unit of the stock price index. The rise and fall of stock price index can be used by investors. The investors make use of the stock index to judge the behavior of the stock price and this also reflects the trends of the stock markets [5].
In this article, the data were collected from the closing month prices from January 2001 to December 2014 from two stock markets in China, namely, Shanghai composite index and Shenzhen component index. About 336 data samples were collected for analysis. The source of data is wind information system. The analysis of part 4 was based on EVIEWS and SPSS, while the analysis of part 5 was based on MATLAB.
4. The Empirical Analysis of the ARIMA Model
4.1 Seasonal Analysis
In the field of data statistics, seasonal variable is one component of the time series analysis and is defined as a period equivalent to 1 year or shorter. In addition, seasonal variable is repetitive and predictable in a trend change shown in a line graph. It is calculated by measuring short time intervals (for example, daily, weekly, monthly, or quarterly).
In a time series sequence, if similarity is presented after a time interval (S), we say the sequence cycle characteristic is S. Sequence is, therefore, referred to as the seasonal time series with cyclical characteristics where S is the cycle length. We should eliminate the influence of seasonality when predicting the stock price [6-9].
The monthly closing price of Shanghai composite index and Shenzhen component index.
Seasonal index of the Shanghai and Shenzhen stock markets
Fig. 2 shows the monthly data of Shanghai composite index and Shenzhen component index from January 2001 to December 2014 and these indices are represented by {SH} and {SZ}, respectively.
Using the structure method of the seasonal index, the seasonal indices of the two stock markets are shown in Table 1.
Table 1 above show that there is no seasonal effect on Shanghai and Shenzhen stock markets, respectively. Therefore, there is no need to eliminate seasonal fluctuations while using the ARIMA model.
4.2 Stability Analysis
As can be seen from Fig. 2, {SH} and {SZ} are stationary series. In addition, the ARIMA model sequence is smooth so we needed a differential stationary series. Fig. 3 represents the second order differential sequence diagram of the {SH} and {SZ}.
The sequences after second order differential.
We can comprehend from Fig. 3 that the ADF value of the second order differential sequences of Shanghai and Shenzhen stock markets is greater than the absolute value of the critical value at 1%, 5%, and 10% significant levels. Consequently, the null hypothesis of the unit root is excluded, so sequences are smooth and d = 2.
4.3 Pattern Recognition [10-12]
We usually use the sample autocorrelation and partial autocorrelation analysis for model identification and order determination. However, this judgment is very subjective, hence, we use EVIEWS software to establish multiple models as well as the BIC criteria to compare the models. The results are shown in Table 2.
According to the minimum BIC criterion, we finally choose ARIMA (4, 2, 6) to forecast the Shanghai and Shenzhen stock markets.
The comparison of BIC criteria for multiple ARIMA models
5. The Empirical Analysis of the Neural Network Model
5.1 The Principle, Algorithm and the Related Parameter Configuration of the Neural Network Model
An integrated neural network is mainly composed of the input layer, hidden layer, input delay layer, and output layer. We should therefore set the number of delay layers between the input and output layer, and the hidden layer of the study neural network before applying the actual model.
Firstly, the algorithm involves importing of the historical data, setting up of the training set, validation set, test set, and the number of delay layers and the hidden layers. Secondly, the algorithm should train the network. Thirdly, the algorithm should decide which network to choose according to the error autocorrelation curve. Finally, the algorithm should give the predictive output and detect the neural network model.
Data can be divided into the following three categories: the training set that is used to train the data; the validation set that is used to validate the network model, that is, whether it is feasible or not; the test set is used to assess the prediction ability of the network model. In this article, the data set parameters include: training set, 70%; validation set, 15%; and the test set, 15% [13-15].
5.2 The Feasibility Analysis for the Network [16]
In this study, we used MATLAB tools to construct the network model which is combined with the dynamic neural network GUI toolkit to build a sequence prediction model. The effect of the neural network prediction model is shown mainly by visual analysis through error and error autocorrelation figures.
Difference between the forecast value and the actual value of Shanghai stock market.
Difference between the forecast value and the actual value of Shenzhen stock market.
We can see from Figs. 4 and 5 that the coarser line in the vertical direction is the difference between the target value and the forecast value. It is important to observe that the thinner the line, the better would be the forecast. We can see from Figs. 6 and 7 that when lag = 0, the error of the lag has the largest value; the other cases with values that are less than the confidence interval are preferred. These figures show that the model error within the confidence interval and the effect of the neural network model is good.
The error figure of Shanghai stock market.
The error figure of Shenzhen stock market.
5.3 The Prediction using the Neural Network Model
In this section, we used the neural network model to predict the Shanghai composite index and the Shenzhen component index. This was followed by the analysis of the training and test values. These results show that the test values and the actual values are close to each other, and the precision is very high; hence, it is proved that the neural network model is effective. It provides great reference value for investors. The forecast for Shanghai and Shenzhen are shown in Figs. 8 and 9, respectively.
6. Comparative Model
In order to analyze and compare the ARIMA and neural network models (Table 3), we chose the average absolute error as the evaluation index. The average absolute error values of the ARIMA and the neural network models for Shanghai and Shenzhen stock markets are shown in Table 4.
Table 4 shows that the prediction accuracy of the neural network model is higher than the prediction accuracy of the ARIMA model. The neural network model depicts the changing pattern of the stock price in a comprehensive way; therefore, the neural network is a more effective forecasting method than the ARIMA model.
The forecast of Shanghai stock market.
The forecast of Shenzhen stock market.
The three forecast values based on ARIMA and the neural network model
The average absolute error value of Shanghai and Shenzhen stock markets
7. Conclusions
The stock market is facing a rapidly changing external environment that increases the uncertainty of the prediction factors. In order to describe the changing pattern of the stock price more accurately and comprehensively, we used a hybrid ARIMA and neural network model to forecast the Shanghai and Shenzhen stock markets.
Firstly, we used the monthly closing prices of Shanghai composite index and Shenzhen component index from January 2001 to December 2014. This is because these data are the latest and most representative.
Secondly, we selected the optimal ARIMA model to forecast Shanghai and Shenzhen stock markets by using the BIC criteria, EVIEWS and the SPSS software.
Thirdly, we used the neural network model to forecast the Shanghai and Shenzhen stock markets using the MATLAB software.
Finally, we compared the optimal ARIMA model with the neural network model. The calculated results show that the neural network model improved the predictive ability of the Shanghai and Shenzhen stock markets. This model is also able to reflect the development trends of stock markets and can provide investors with more constructive investment advice.
Acknowledgement
This work is supported by the Scientific Research Foundation of Zhejiang Sci-Tech University (No.18092249-Y).