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

Authors: Ayodele Ariyo Adebiyi; Aderemi Oluyinka Adewumi; Charles Korede Ayo
Journal: Journal of Applied Mathematics
 (2014)

---

## Abstract

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.


---

## Body

## 1. 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–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–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: Section2 presents some related works on the comparison of the ARIMA and ANNs model, while the methodology used in this work is presented in Section 3. Section 4 presents and discusses the experimental results obtained in this work, while useful conclusions are provided in Section 5.


## 2. 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–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).


## 3. 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.


### 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. 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.


### 3.2. ARIMA(p,d,q) 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 (d) 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 (p) and moving average (q) 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 R2. The Q-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 1
ARIMA (1, 0, 0) estimation output with CLOSE of Dell index.
Dependent variable: CLOSE
Method: least squares
Date: 03/21/11 Time: 15:54
Sample (adjusted): 8/18/1988–2/25/2011
Included observations: 5679 after adjustments
Convergence achieved after 4 iterations
Variable
Coefficient
Standard error
t-statistic
Prob.
C
34.11484
6.028238
5.659173
0.0000
AR (1)
0.994802
0.001346
739.1456
0.0000
R-squared
0.989716
Mean dependent variable
33.91262
AdjustedR-squared
0.989714
S.D. dependent variable
23.28046
S.E. of regression
2.361101
Akaike info criterion
4.556485
Sum squared residual
31648.13
Schwarz criterion
4.558825
Log likelihood
−12936.14
F-statistic
546336.2
Durbin-Watson static
2.015870
Prob. (F-statistic)
0.000000
Inverted AR roots
0.99Table2 shows the different parameters p and q in the ARIMA model. ARIMA (1,0,0) is considered the best for Dell stock index as shown in Table 1.Table 2
Statistical results of different ARIMA parameters for Dell stock index.
ARIMA
BIC
AdjustedR2
SER
(1, 0, 0)
4.5588
0.9897
2.3611
(1, 0, 1)
4.5602
0.9897
2.3612
(2, 0, 0)
5.2389
0.9796
3.3174
(0, 0, 1)
7.8883
0.7127
12.4770
(0, 0, 2)
7.9369
0.6984
12.7839
(1, 1, 0)
4.5615
−0.0000
2.3642
(0, 1, 0)
4.5599
0.0000
2.3639
(0, 1, 1)
4.5615
−0.0000
2.3642
(1, 1, 2)
4.5630
−0.0002
2.3644
(2, 1, 0)
4.5617
−0.0001
2.3645
(2, 1, 2)
4.5610
0.0019
2.3621In forecasting form, the best model selected can be expressed as follows:(1)Yt=ϕ1Yt-1+θ0+εt,
where εt=Yt-Yt^ is the difference between the actual value and the forecast value of the series.


### 3.3. 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 ANN model used for the nonlinear data is represented as follows:(2)yt=w0+∑j=1qwj·g(w0j+∑i=1pwij·yt-1)+εt,
where wij(i=0,1,2,…,p,j=1,2,…,q) and wj(j=0,1,2,…,q) are the connection weights, p is the number of input nodes, and q is the number hidden nodes. Ten input variables, each grouped into two as inputs for day i-1 and day i-2, were supplied into the model. These variables are the opening price (Oi-1,Oi-2), daily high price (Hi-1,Hi-2), daily low price (Li-1,Li-2), daily closing price (Ci-1,Ci-2), and trading volume (Vi-1,Vi-2).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).(ii)
Training the network.This involves selecting the network type/training algorithm, in our case feed-forward back-propagation algorithm, inputting the training and target data, selecting the training function (TRAINGDM), selecting the adaptation learning function (LEARNGDM), selecting the performance function (MSE), and selecting the transfer function (TANSIG).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.Table 3
Statistical performance of ANN model of Dell stock index*.
MSE
Network structure
1000 epochs
2000 epochs
5000 epochs
10-10-1
0.129054
0.112363
0.093539
10-11-1
0.144086
0.108245
0.090521
10-12-1
0.125668
0.099301
0.088157
10-13-1
0.148646
0.115732
0.092649
10-14-1
0.141474
0.099241
0.085206
10-15-1
0.118226
0.096651
0.083664
10-16-1
0.116773
0.099222
0.080534
10-17-1
0.097826
0.085111
0.071589
10-18-1
0.119719
0.093576
0.079150
*The bold characters indicate the best results for each of the epoch sessions.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.Figure1 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.Figure 1
Graph of the best result achieved in network training of ANN of Dell 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. 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.


## 3.2. ARIMA(p,d,q) 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 (d) 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 (p) and moving average (q) 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 R2. The Q-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 1
ARIMA (1, 0, 0) estimation output with CLOSE of Dell index.
Dependent variable: CLOSE
Method: least squares
Date: 03/21/11 Time: 15:54
Sample (adjusted): 8/18/1988–2/25/2011
Included observations: 5679 after adjustments
Convergence achieved after 4 iterations
Variable
Coefficient
Standard error
t-statistic
Prob.
C
34.11484
6.028238
5.659173
0.0000
AR (1)
0.994802
0.001346
739.1456
0.0000
R-squared
0.989716
Mean dependent variable
33.91262
AdjustedR-squared
0.989714
S.D. dependent variable
23.28046
S.E. of regression
2.361101
Akaike info criterion
4.556485
Sum squared residual
31648.13
Schwarz criterion
4.558825
Log likelihood
−12936.14
F-statistic
546336.2
Durbin-Watson static
2.015870
Prob. (F-statistic)
0.000000
Inverted AR roots
0.99Table2 shows the different parameters p and q in the ARIMA model. ARIMA (1,0,0) is considered the best for Dell stock index as shown in Table 1.Table 2
Statistical results of different ARIMA parameters for Dell stock index.
ARIMA
BIC
AdjustedR2
SER
(1, 0, 0)
4.5588
0.9897
2.3611
(1, 0, 1)
4.5602
0.9897
2.3612
(2, 0, 0)
5.2389
0.9796
3.3174
(0, 0, 1)
7.8883
0.7127
12.4770
(0, 0, 2)
7.9369
0.6984
12.7839
(1, 1, 0)
4.5615
−0.0000
2.3642
(0, 1, 0)
4.5599
0.0000
2.3639
(0, 1, 1)
4.5615
−0.0000
2.3642
(1, 1, 2)
4.5630
−0.0002
2.3644
(2, 1, 0)
4.5617
−0.0001
2.3645
(2, 1, 2)
4.5610
0.0019
2.3621In forecasting form, the best model selected can be expressed as follows:(1)Yt=ϕ1Yt-1+θ0+εt,
where εt=Yt-Yt^ is the difference between the actual value and the forecast value of the series.


## 3.3. 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 ANN model used for the nonlinear data is represented as follows:(2)yt=w0+∑j=1qwj·g(w0j+∑i=1pwij·yt-1)+εt,
where wij(i=0,1,2,…,p,j=1,2,…,q) and wj(j=0,1,2,…,q) are the connection weights, p is the number of input nodes, and q is the number hidden nodes. Ten input variables, each grouped into two as inputs for day i-1 and day i-2, were supplied into the model. These variables are the opening price (Oi-1,Oi-2), daily high price (Hi-1,Hi-2), daily low price (Li-1,Li-2), daily closing price (Ci-1,Ci-2), and trading volume (Vi-1,Vi-2).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).(ii)
Training the network.This involves selecting the network type/training algorithm, in our case feed-forward back-propagation algorithm, inputting the training and target data, selecting the training function (TRAINGDM), selecting the adaptation learning function (LEARNGDM), selecting the performance function (MSE), and selecting the transfer function (TANSIG).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.Table 3
Statistical performance of ANN model of Dell stock index*.
MSE
Network structure
1000 epochs
2000 epochs
5000 epochs
10-10-1
0.129054
0.112363
0.093539
10-11-1
0.144086
0.108245
0.090521
10-12-1
0.125668
0.099301
0.088157
10-13-1
0.148646
0.115732
0.092649
10-14-1
0.141474
0.099241
0.085206
10-15-1
0.118226
0.096651
0.083664
10-16-1
0.116773
0.099222
0.080534
10-17-1
0.097826
0.085111
0.071589
10-18-1
0.119719
0.093576
0.079150
*The bold characters indicate the best results for each of the epoch sessions.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.Figure1 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.Figure 1
Graph of the best result achieved in network training of ANN of Dell index.


## 4. 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.


### 4.1. Result of ARIMA Model

We experimented with different parameters of autoregressive (p) and moving average (q) 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
(3)ForecastError(FE)=(actual-predicted)actual.Table 4
Sample of empirical results of ARIMA (1, 0, 0) of Dell stock index.
Sample period
Actual values
Predicted values
Forecast error
01/03/2010
13.57
13.35
0.016212
02/03/2010
13.68
13.46
0.016082
03/03/2010
13.71
13.56
0.010941
04/03/2010
13.67
13.67
0
05/03/2010
13.88
13.78
0.007205
08/03/2010
14.01
13.88
0.009279
09/03/2010
14.18
13.99
0.013399
10/03/2010
14.31
14.09
0.015374
11/03/2010
14.21
14.2
0.000704
12/03/2010
14.26
14.3
−0.00281
15/03/2010
14.26
14.4
−0.00982
16/03/2010
14.3
14.51
−0.01469
17/03/2010
14.59
14.61
−0.00137
18/03/2010
14.55
14.71
−0.011
19/03/2010
14.41
14.81
−0.02776
22/03/2010
14.62
14.91
−0.01984
23/03/2010
15.22
15.01
0.013798
24/03/2010
14.99
15.11
−0.00801
25/03/2010
14.87
15.21
−0.02286
26/03/2010
14.99
15.31
−0.02135
29/03/2010
14.96
15.4
−0.02941
30/03/2010
14.97
15.5
−0.0354
31/03/2010
15.02
15.6
−0.03862Figure 2
Graph of actual stock price versus predicted values for Dell stock index using ARIMA.


### 4.2. 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 Table3, 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.Table 5
Sample results of ANN model for Dell stock index.
Sample period
Actual value
Predicted value
Forecast error
01/03/2010
13.57
13.16
0.03021
02/03/2010
13.68
13.55
0.0095
03/03/2010
13.71
13.7
0.00073
04/03/2010
13.67
13.55
0.00878
05/03/2010
13.88
13.53
0.02522
08/03/2010
14.01
13.89
0.00857
09/03/2010
14.18
13.92
0.01834
10/03/2010
14.31
13.85
0.03215
11/03/2010
14.21
14.18
0.00211
12/03/2010
14.26
14.31
−0.0035
15/03/2010
14.26
14.15
0.00771
16/03/2010
14.3
14.49
−0.0133
17/03/2010
14.59
14.5
0.00617
18/03/2010
14.55
14.25
0.02062
19/03/2010
14.41
14.28
0.00902
22/03/2010
14.62
14.67
−0.0034
23/03/2010
15.22
15.19
0.00197
24/03/2010
14.99
14.66
0.02201
25/03/2010
14.87
14.96
−0.0061
26/03/2010
14.99
14.75
0.01601
29/03/2010
14.96
14.89
0.00468
30/03/2010
14.97
15.01
−0.0027
31/03/2010
15.02
14.97
0.00333Figure 3
Graph of ANN model of predicted values against actual values for Dell stock index.


### 4.3. Comparison of ARIMA and ANN Model

From the empirical results presented in Table6 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 P 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.Table 6
Sample results of ANN and ARIMA models for Dell stock index.
Sample period
Actual value
Predicted values
Forecast error
ANN
ARIMA
ANN
ARIMA
01/03/2010
13.57
13.16
13.35
0.03021
0.016212
02/03/2010
13.68
13.55
13.46
0.0095
0.016082
03/03/2010
13.71
13.7
13.56
0.00073
0.010941
04/03/2010
13.67
13.55
13.67
0.00878
0
05/03/2010
13.88
13.53
13.78
0.02522
0.007205
08/03/2010
14.01
13.89
13.88
0.00857
0.009279
09/03/2010
14.18
13.92
13.99
0.01834
0.013399
10/03/2010
14.31
13.85
14.09
0.03215
0.015374
11/03/2010
14.21
14.18
14.2
0.00211
0.000704
12/03/2010
14.26
14.31
14.3
−0.0035
−0.00281
15/03/2010
14.26
14.15
14.4
0.00771
−0.00982
16/03/2010
14.3
14.49
14.51
−0.0133
−0.01469
17/03/2010
14.59
14.5
14.61
0.00617
−0.00137
18/03/2010
14.55
14.25
14.71
0.02062
−0.011
19/03/2010
14.41
14.28
14.81
0.00902
−0.02776
22/03/2010
14.62
14.67
14.91
−0.0034
−0.01984
23/03/2010
15.22
15.19
15.01
0.00197
0.013798
24/03/2010
14.99
14.66
15.11
0.02201
−0.00801
25/03/2010
14.87
14.96
15.21
−0.0061
−0.02286
26/03/2010
14.99
14.75
15.31
0.01601
−0.02135
29/03/2010
14.96
14.89
15.4
0.00468
−0.02941
30/03/2010
14.97
15.01
15.5
−0.0027
−0.0354
31/03/2010
15.02
14.97
15.6
0.00333
−0.03862Figure 4
Graph of predicted values of ARIMA and ANN model against actual stock price.


## 4.1. Result of ARIMA Model

We experimented with different parameters of autoregressive (p) and moving average (q) 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
(3)ForecastError(FE)=(actual-predicted)actual.Table 4
Sample of empirical results of ARIMA (1, 0, 0) of Dell stock index.
Sample period
Actual values
Predicted values
Forecast error
01/03/2010
13.57
13.35
0.016212
02/03/2010
13.68
13.46
0.016082
03/03/2010
13.71
13.56
0.010941
04/03/2010
13.67
13.67
0
05/03/2010
13.88
13.78
0.007205
08/03/2010
14.01
13.88
0.009279
09/03/2010
14.18
13.99
0.013399
10/03/2010
14.31
14.09
0.015374
11/03/2010
14.21
14.2
0.000704
12/03/2010
14.26
14.3
−0.00281
15/03/2010
14.26
14.4
−0.00982
16/03/2010
14.3
14.51
−0.01469
17/03/2010
14.59
14.61
−0.00137
18/03/2010
14.55
14.71
−0.011
19/03/2010
14.41
14.81
−0.02776
22/03/2010
14.62
14.91
−0.01984
23/03/2010
15.22
15.01
0.013798
24/03/2010
14.99
15.11
−0.00801
25/03/2010
14.87
15.21
−0.02286
26/03/2010
14.99
15.31
−0.02135
29/03/2010
14.96
15.4
−0.02941
30/03/2010
14.97
15.5
−0.0354
31/03/2010
15.02
15.6
−0.03862Figure 2
Graph of actual stock price versus predicted values for Dell stock index using ARIMA.


## 4.2. 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 Table3, 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.Table 5
Sample results of ANN model for Dell stock index.
Sample period
Actual value
Predicted value
Forecast error
01/03/2010
13.57
13.16
0.03021
02/03/2010
13.68
13.55
0.0095
03/03/2010
13.71
13.7
0.00073
04/03/2010
13.67
13.55
0.00878
05/03/2010
13.88
13.53
0.02522
08/03/2010
14.01
13.89
0.00857
09/03/2010
14.18
13.92
0.01834
10/03/2010
14.31
13.85
0.03215
11/03/2010
14.21
14.18
0.00211
12/03/2010
14.26
14.31
−0.0035
15/03/2010
14.26
14.15
0.00771
16/03/2010
14.3
14.49
−0.0133
17/03/2010
14.59
14.5
0.00617
18/03/2010
14.55
14.25
0.02062
19/03/2010
14.41
14.28
0.00902
22/03/2010
14.62
14.67
−0.0034
23/03/2010
15.22
15.19
0.00197
24/03/2010
14.99
14.66
0.02201
25/03/2010
14.87
14.96
−0.0061
26/03/2010
14.99
14.75
0.01601
29/03/2010
14.96
14.89
0.00468
30/03/2010
14.97
15.01
−0.0027
31/03/2010
15.02
14.97
0.00333Figure 3
Graph of ANN model of predicted values against actual values for Dell stock index.


## 4.3. Comparison of ARIMA and ANN Model

From the empirical results presented in Table6 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 P 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.Table 6
Sample results of ANN and ARIMA models for Dell stock index.
Sample period
Actual value
Predicted values
Forecast error
ANN
ARIMA
ANN
ARIMA
01/03/2010
13.57
13.16
13.35
0.03021
0.016212
02/03/2010
13.68
13.55
13.46
0.0095
0.016082
03/03/2010
13.71
13.7
13.56
0.00073
0.010941
04/03/2010
13.67
13.55
13.67
0.00878
0
05/03/2010
13.88
13.53
13.78
0.02522
0.007205
08/03/2010
14.01
13.89
13.88
0.00857
0.009279
09/03/2010
14.18
13.92
13.99
0.01834
0.013399
10/03/2010
14.31
13.85
14.09
0.03215
0.015374
11/03/2010
14.21
14.18
14.2
0.00211
0.000704
12/03/2010
14.26
14.31
14.3
−0.0035
−0.00281
15/03/2010
14.26
14.15
14.4
0.00771
−0.00982
16/03/2010
14.3
14.49
14.51
−0.0133
−0.01469
17/03/2010
14.59
14.5
14.61
0.00617
−0.00137
18/03/2010
14.55
14.25
14.71
0.02062
−0.011
19/03/2010
14.41
14.28
14.81
0.00902
−0.02776
22/03/2010
14.62
14.67
14.91
−0.0034
−0.01984
23/03/2010
15.22
15.19
15.01
0.00197
0.013798
24/03/2010
14.99
14.66
15.11
0.02201
−0.00801
25/03/2010
14.87
14.96
15.21
−0.0061
−0.02286
26/03/2010
14.99
14.75
15.31
0.01601
−0.02135
29/03/2010
14.96
14.89
15.4
0.00468
−0.02941
30/03/2010
14.97
15.01
15.5
−0.0027
−0.0354
31/03/2010
15.02
14.97
15.6
0.00333
−0.03862Figure 4
Graph of predicted values of ARIMA and ANN model against actual stock price.


## 5. 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 ANN-based 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.



---

*Source: 614342-2014-03-05.xml*