Comparison of ARIMA and Artificial Neural Networks Models for Stock Price Prediction

This paper examines the forecasting performance of ARIMA and artificial neural networks model with published stock data obtained from New York Stock Exchange. The empirical results obtained reveal the superiority of neural networks model over ARIMA model. The findings further resolve and clarify contradictory opinions reported in literature over the superiority of neural networks and ARIMA model and vice versa.


Introduction
Several research studies on stock predictions have been conducted with various solution techniques proposed over the years.The prominent techniques fall into two broad categories, namely, statistical and soft computing techniques.Statistical techniques include, among others, exponential smoothing, autoregressive integrated moving average (ARIMA), and generalized autoregressive conditional heteroskedasticity (GARCH) volatility [1].The ARIMA model, also known as the Box-Jenkins model or methodology, is commonly used in analysis and forecasting.It is widely regarded as the most efficient forecasting technique in social science and is used extensively for time series.The use of ARIMA for forecasting time series is essential with uncertainty as it does not assume knowledge of any underlying model or relationships as in some other methods.ARIMA essentially relies on past values of the series as well as previous error terms for forecasting [2,3].However, ARIMA models are relatively more robust and efficient than more complex structural models in relation to short-run forecasting [3].
Artificial neural networks (ANNs) as a soft computing technique are the most accurate and widely used as forecasting models in many areas including social, engineering, economic, business, finance, foreign exchange, and stock problems [4][5][6][7][8].Its wide usage is due to the several distinguishing features of ANNs that make them attractive to both researchers and industrial practitioners.As stated in [4], ANNs are data-driven, self-adaptive methods with few prior assumptions.They are also good predictor with the ability to make generalized observations from the results learnt from original data, thereby permitting correct inference of the latent part of the population.Furthermore, ANNs are universal approximator as a network can efficiently approximate a continuous function to the desired level of accuracy.Finally, ANNs have been found to be very efficient in solving nonlinear problems including those in real world [4].This is in contrast to many traditional techniques for time series predictions, such as ARIMA, which assume that the series are generated from linear processes and as a result might be inappropriate for most real-world problems that are nonlinear [5,6].There is growing need to solve highly nonlinear, time-variant problems as many applications such as stock markets are nonlinear with uncertain behaviour that changes with time [7,8].ANNs are known to provide competitive results to various traditional time series models such as ARIMA model [4,[9][10][11].In this paper, the performance of ANN and ARIMA models is studied and compared for a case of stock prediction, which also further clarify and/or confirm contradictory opinions reported in literature about superiority of each of the model over one another.
The rest of the paper is organized as follows: Section 2 presents some related works on the comparison of the

Related Works
The search for efficient stock price prediction techniques is profound in literature.This is motivated partly by the dynamic nature of the problem as well as the need for better results.Tansel et al. [12] compared the performance of linear optimization, ANNs, and genetic algorithms (GAs) in modelling time series data based on modelling accuracy, convenience, and computational time.The study revealed that linear optimization techniques gave the best estimates with GAs providing similar results if the boundaries of the parameters and the resolution were carefully selected, while NNs gave the worst estimates.The work reported in [13] also compared the forecasting performance of ARIMA and ANN models in forecasting Korean Stock Price Index.The ARIMA model generally provided more accurate forecasts than the back-propagation neural network (BPNN) model used.This is more pronounced for the midrange forecasting horizons.Merh et al. [14] presented a comparison between hybrid approaches of ANN and ARIMA for Indian stock trend forecasting with many instances of the ARIMA predicted values shown to be better than those of the ANNs predicted values in relation to the actual stock value.Sterba and Hilovska [15] argued that ARIMA model and ANN model achieved good prediction performance in many real-world applications especially time series prediction.Experimental results obtained by the authors further revealed that ARIMA model generally performs better in the prediction of linear time series, while ANNs perform better in the prediction of nonlinear time series.In a similar study for financial forecasting reported in [16], ANNs model was shown to perform better than ARIMA model in value forecasting, while ARIMA model performed better than ANNs in directional forecasting.
Yao et al. [17] compared the stock forecasting performance of ANN and ARIMA models and showed that the ANN model obtained better returns than the conventional ARIMA models Similarly, Hansen et al. [18] compared the prediction performance of ANNs and ARIMA on time series prediction to show that the ANNs outperformed ARIMA in predicting stock movement direction as the latter was able to detect hidden patterns in the data used.Prybutok et al. [19] also compared the forecasting performance of ANN and ARIMA model in forecasting daily maximum ozone concentration.Empirical results obtained also showed that the ANN model is superior to the ARIMA model.Wijaya et al. [20] did similar comparison based on the Indonesia stock exchange and got better accuracy with ANN than the ARIMA model.More literature has shown the prevalent use of ANNs as an effective tool for stock price prediction [10,[21][22][23][24][25][26][27][28][29].This makes ANN a promising technique or potential hybrid for the prediction of movement in time series.
However, literature has shown different view on the relative performance and superiority of ARIMA and ANNs models to time series prediction, especially for different data used; hence the need for further study that can help unified a coherent view on the better methodology.This paper therefore seeks to further clarify contradictory opinions reported in literature on the superiority of ANN model over ARIMA model and vice versa in the effective prediction of stock prices.Results obtained are based on empirical study on time series stock prediction using data from the New York Stock Exchange (NYSE).

Methodology
The research methodology used in this study is summarized below.The study used published stock data from NYSE on ARIMA and ANN models developed.EViews software and Matlab Neural Network Tools Box version 7 were used for ARIMA and ANNs models, respectively.The open price is the opening price of the index (PoI) at the start of the trading day, the low price represents the minimum PoI during the trading day, the high price represents the maximum PoI during the trading day, and the closing price indicates the PoI when the market closes.In this research the closing price is chosen to represent the PoI to be modeled and predicted.This is because the closing price reflects all the activities of the index of the day.

ARIMA (𝑝, 𝑑, 𝑞) Model Development for Stock Price of Dell
Incorporation.This study used the Dell Inc. stock data used that covered the period from August 17, 1988, to February 25, 2011, having a total number of 5680 observations.It was observed that the original pattern of the time series of the index is not stationary.The time series have random walk pattern and vary randomly with no global trend or seasonality pattern observed.
A correlogram is used to determine whether a particular series is stationary or nonstationary.Usually, a stationary time series will give an autocorrelation function (ACF) that decay rapidly from its initial value of unity at zero lag.In the case of nonstationary time series, the ACF dies out gradually over time.The correlogram of the time series of Dell stock index was observed to be nonstationary as the ACF dies down extremely slowly.Differencing is used to make this nonstationary time series become stationary.The value of difference () is determined by the number of times the differencing is performed on the time series.
In order to construct the best ARIMA model for Dell stock index, the autoregressive () and moving average () parameters have to be effectively determined for an effective model.To determine the best model, we set the criteria as follows (also depicted in Table 1): relatively small Bayesian Information Criterion (BIC) and Standard Error of regression (SER), relatively high adjusted  2 .The -statistics and correlogram done showed no significant pattern left in the ACFs and partial autocorrelation functions (PACFs) of the residuals which implies that the residual of the selected model is white noise.Table 2 shows the different parameters  and  in the ARIMA model.ARIMA (1, 0, 0) is considered the best for Dell stock index as shown in Table 1.
In forecasting form, the best model selected can be expressed as follows: where   =   − Ŷ is the difference between the actual value and the forecast value of the series.

ANN Model Construction for the Dell Stock
Index.This study employed a three-layer (one hidden layer) multilayer perceptron model trained with back-propagation algorithm.
The creation of the ANN predictive model with Matlab for the Dell stock index involves the following.
(i) Creating the network topology.This involves the selection of the number of input neurons (in this case 10 inputs), the number of hidden layers, the number of hidden neurons in the hidden layer (see Table 3), and the number of output neurons (one, in this case).The training parameters were set as follows: learning rate = 0.01, momentum term = 0.9, and epoch size = 1000, 2000, 5000.Finally, the network was tested with the data set to estimate its generalization ability.
To determine the best performing model, simulation experiment was run on different ANN model configurations.Both training and testing data were carefully selected.However, the training was not done with test data.The model was trained with 1000, 2000, and 5000 epochs, respectively, while the mean squared error (MSE) for each training session of the different network structure was noted.
Figure 1 is the graph of network training showing the best performance in each of the network structure models in the different training sessions.The network structure that returns the smallest MSE in each of the models was adjudged the best model that can give the best accurate prediction.Similarly, Table 3 presents the outcome of the various training sessions in each of the ANN network structure.It was observed in most cases that the best model was obtained when the network was well trained.

Experimental Results and Discussion
The tools for simulation of the models are Matlab 2007 and EViews software for ANN model and ARIMA model, respectively.The results obtained are presented in the subsection below.

Result of ARIMA Model.
We experimented with different parameters of autoregressive () and moving average () in order to determine the best model that will give best forecast as indicated in Table 2. ARIMA (1, 0, 0) is considered the best for Dell stock index as shown in Table 1; hence it was selected as the best model based on the criteria listed in the previous section.The actual stock price and predicted values are presented in Table 4, while Figure 2 gives the graph of predicted price against actual stock price to see the performance of the ARIMA model selected.From the predicted values, it was observed that a constant number is added to the subsequent values from the previous value and this accounted for the linear graph of the predicted values in Figure 2.However, the forecast error is quite low and impressive as the predicted values are close to the actual values and move in the direction of the forecast values in many instances as shown in Figure 2, which depicts the correlation of the level of accuracy.The forecast error is determined by Forecast Error (FE) = (actual − predicted) actual . (3)

Results of ANN Model.
After several experiments with different network architectures based on our ANN algorithm, the network structure that returns the smallest MSE was noted to give the best forecasting accuracy with the test data.The MSE recorded in the experiments are presented in Table 3, from where we observed that 10-17-1 (10 input neurons, 17 hidden neurons, and 1 output neuron) is the predictive model with the most accurate daily price prediction.
The results presented in Table 5 were the findings from testing period (out of sample test data), while Figure 3 illustrates the correlation of the level accuracy.The forecast error of ANN model is equally low which demonstrated good forecast performance as indicated in Table 5.

Comparison of ARIMA and ANN Model.
From the empirical results presented in Table 6 and Figure 4, we observed that the forecasting accuracy level of the ANN model compared with that of the ARIMA model is not quite significant.It can be argued that both models achieved good forecast performance judging from the forecast error of both models which are quite low.This finding agrees with the work of [15].However, the performance of ANN model is  better than ARIMA model in terms of forecasting accuracy on many occasions from the test data.Results of Figure 4 show that the ANN model is better than the ARIMA model for stock price prediction.We also observed that the pattern of ARIMA model is directional, which accounted for the linear pattern observed in the graph of Figure 2, while ANN model is toward value forecasting.This finding also agrees with the work of [16].Statistical test was carried out, which also showed that there is no significant difference between the actual and predicted values of the two models as the  values of ANN and ARIMA are 0.439 and 0.604, respectively.Notwithstanding, ANN is still better.Hence, this research work also further clarifies the contrary opinions reported in literature about the superiority of ANN model over ARIMA model in time series prediction.

Conclusion
The empirical results obtained with published stock data on the performance of ARIMA and ANN model to stock price prediction have been presented in this study.The performance of the ANN predictive model developed in this study was compared with the conventional Box-Jenkins ARIMA model, which has been widely used for time series forecasting.Our findings revealed that both ARIMA model and ANN model can achieve good forecast in application to real-life problems and thus can be effectively engaged profitably for stock price prediction.We also observed that the pattern of ARIMA forecasting models is directional.
The developed stock price predictive model with the ANNbased approach demonstrated superior performance over the ARIMA models; indeed, the actual and predicted values of the developed stock price predictive model are quite close.In future studies, hybrid of intelligent techniques similar to that reported in [11,15,30] can be engaged to improve existing predictive models with recent stock data and more stock index.

3. 1 .
Input Data.The data used in this research work were historical daily stock prices.The stock data consists of open price, low price, high price, close price, and volume traded.

(Figure 1 :
Figure 1: Graph of the best result achieved in network training of ANN of Dell index.

Figure 3 :
Figure 3: Graph of ANN model of predicted values against actual values for Dell stock index.

Table 2 :
Statistical results of different ARIMA parameters for Dell stock index.

Table 3 :
Statistical performance of ANN model of Dell stock index * .
*The bold characters indicate the best results for each of the epoch sessions.

Table 5 :
Sample results of ANN model for Dell stock index.

Table 6 :
Sample results of ANN and ARIMA models for Dell stock index.
Figure 4: Graph of predicted values of ARIMA and ANN model against actual stock price.