2014 UKSim-AMSS 16h Inernaional Conference on Compuer Modelling and Simulaion Sock Price Predicion Using he ARIMA Model 1 Ayodele A. Adebiyi., 2 Aderemi O. Adewumi 1,2 School of Mahemaic, Saisics & Compuer Science Universiy of KwaZulu-Naal Durban, Souh Africa email: {adebiyi, adewumia}@ukzn.ac.za 3 Charles K. Ayo 3 Deparmen of Compuer & Informaion Sciences Covenan Universiy Oa, Nigeria email: charles.ayo@covenanuniversiy.edu.ng Absrac Sock price predicion is an imporan opic in finance and economics which has spurred he ineres of researchers over he years o develop beer predicive models. The auoregressive inegraed moving average (ARIMA) models have been explored in lieraure for ime series predicion. This paper presens exensive process of building sock price predicive model using he ARIMA model. Published sock daa obained from New York Sock Exchange (NYSE) and Nigeria Sock Exchange (NSE) are used wih sock price predicive model developed. Resuls obained revealed ha he ARIMA model has a srong poenial for shor-erm predicion and can compee favourably wih exising echniques for sock price predicion. Keywords- ARIMA model, Sock Price predicion, Sock marke, Shor-erm predicion. I. INTRODUCTION Predicion will coninue o be an ineresing area of research making researchers in he domain field always desiring o improve exising predicive models. The reason is ha insiuions and individuals are empowered o make invesmen decisions and abiliy o plan and develop effecive sraegy abou heir daily and fuure endevours. Sock price predicion is regarded as one of mos difficul ask o accomplish in financial forecasing due o complex naure of sock marke [1, 2, 3]. The desire of many invesors is o lay hold of any forecasing mehod ha could guaranee easy profiing and minimize invesmen risk from he sock marke. This remains a moivaing facor for researchers o evolve and develop new predicive models [4]. In he pas years several models and echniques had been developed o sock price predicion. Among hem are arificial neural neworks (ANNs) model which are very popular due o is abiliy o learn paerns from daa and infer soluion from unknown daa. Few relaed works ha engaged ANNs model o sock price predicion are [5, 6, 7]. In recen ime, hybrid approaches has also been engaged o improve sock price predicive models by exploiing he unique srengh of each of hem [2]. ANNs is from arificial inelligence perspecives. ARIMA models are from saisical models perspecives. Generally, i is repored in lieraure ha predicion can be done from wo perspecives: saisical and arificial inelligence echniques [2]. ARIMA models are known o be robus and efficien in financial ime series forecasing especially shor-erm predicion han even he mos popular ANNs echniques ([8, 9, 10]. I has been exensively used in field of economics and finance. Oher saisics models are regression mehod, exponenial smoohing, generalized auoregressive condiional heeroskedasiciy (GARCH). Few relaed works ha has engaged ARIMA model for forecasing includes [11, 12, 13, 14, 15, 16]. In his paper exensive process of building ARIMA models for shor-erm sock price predicion is presened. The resuls obained from real-life daa demonsraed he poenial srengh of ARIMA models o provide invesors shor-erm predicion ha could aid invesmen decision making process. The res of he paper is organized as follows. Secion 2 presens brief overview of ARIMA model. Secion 3 describes he mehodology used while secion 4 discusses he experimenal resuls obained. The paper is concluded in secion 5. II. ARIMA MODEL Box and Jenkins in 1970 inroduced he ARIMA model. I also referred o as Box-Jenkins mehodology composed of se of aciviies for idenifying, esimaing and diagnosing ARIMA models wih ime series daa. The model is mos prominen mehods in financial forecasing [1, 12, 9]. ARIMA models have shown efficien capabiliy o generae shor-erm forecass. I consanly ouperformed complex srucural models in shor-erm predicion [17]. In ARIMA model, he fuure value of a variable is a linear combinaion of pas values and pas errors, expressed as follows: Y = φ + φy + φy +... θ ε 0 1 1 2 2... + φpy p + ε θε 1 1 θε 2 2 q q (1) where, Y is he acual value and ε is he random error a, φi and θ j are he coefficiens, p and q are inegers ha are ofen referred o as auoregressive and moving average, respecively. 978-1-4799-4923-6/14 $31.00 2014 IEEE DOI 10.1109/UKSim.2014.67 105
The seps in building ARIMA predicive model consis of model idenificaion, parameer esimaion and diagnosic checking [18]. III. METHODOLOGY The mehod used in his sudy o develop ARIMA model for sock price forecasing is explained in deail in subsecions below. The ool used for implemenaion is Eviews sofware version 5. Sock daa used in his research work are hisorical daily sock prices obained from wo counries sock exchanged. The daa composed of four elemens, namely: open price, low price, high price and close price respecively. In his research he closing price is chosen o represen he price of he index o be prediced. Closing price is chosen because i reflecs all he aciviies of he index in a rading day. To deermine he bes ARIMA model among several experimens performed, he following crieria are used in his sudy for each sock index. Relaively small of BIC (Bayesian or Schwarz Informaion Crierion) Relaively small sandard error of regression (S.E. of regression) Relaively high of adjused R 2 Q-saisics and correlogram show ha here is no significan paern lef in he auocorrelaion funcions (ACFs) and parial auocorrelaion funcions (PACFs) of he residuals, i means he residual of he seleced model are whie noise. The subsecions below described he processes of ARIMA model-developmen. A. ARIMA (p, d, q) Model for Nokia Sock Index Nokia sock daa used in his sudy covers he period from 25 h April, 1995 o 25 h February, 2011 having a oal number of 3990 observaions. Figure 1 depics he original paern of he series o have general overview wheher he ime series is saionary or no. From he graph below he ime series have random walk paern. Figure 2 is he correlogram of Nokia ime series. From he graph, he ACF dies down exremely slowly which simply means ha he ime series is nonsaionary. If he series is no saionary, i is convered o a saionary series by differencing. Afer he firs difference, he series DCLOSE of Nokia sock index becomes saionary as shown in figure 3 and figure 4 of he line graph and correlogram respecively. Figure 2: The correlogram of Nokia sock price index Figure 3: Graphical represenaion of he Nokia sock price index afer differencing. Figure 1: Graphical represenaion of he Nokia sock closing price index Figure 4: The correlogram of Nokia sock price index afer firs differencing 106
In figure 5 he model checking was done wih Augmened Dickey Fuller (ADF) uni roo es on DCLOSE of Nokia sock index. The resul confirms ha he series becomes saionary afer he firs-difference of he series. Figure 7 is he residual of he series. If he model is good, he residuals (difference beween acual and prediced values) of he model are series of random errors. Since here are no significan spikes of ACFs and PACFs, i means ha he residual of he seleced ARIMA model are whie noise, no oher significan paerns lef in he ime series. Therefore, here is no need o consider any AR(p) and MA(q) furher. Figure 5: ADF uni roo es for DCLOSE of Nokia sock index. Table 1 shows he differen parameers of auoregressive (p) and moving average (q) among he several ARIMA model experimened upon. ARIMA (2, 1, 0) is considered he bes for Nokia sock index as shown in figure 6. The model reurned he smalles Bayesian or Schwarz informaion crierion of 5.3927 and relaively smalles sandard error of regression of 3.5808 as shown in figure 6. Figure 7: Correlogram of residuals of he Nokia sock index. In forecasing form, he bes model seleced can be expressed as follows: Y = θ 1 Y 1 + θ 2Y 2 + ε (2) where, ε = Y Y (i.e., he difference beween he acual value of he series and he forecas value) TABLE I: STATISTICAL RESULTS OF DIFFERENT ARIMA PARAMETERS FOR NOKIA STOCK INDEX ARIMA BIC Adjused R 2 S.E. of Regression (1, 0, 0) 5.3936 0.9907 3.5824 (1, 0, 1) 5.3950 0.9907 3.5817 (2, 0, 0) 6.1061 0.9811 5.1157 (0, 0, 1) 8.8324 0.7126 19.9942 (0, 0, 2) 8.8871 0.6964 20.5490 (1, 1, 0) 5.3956 0.0002 3.5860 (0, 1, 0) 5.3937 0.0000 3.5859 (0, 1, 1) 5.3953 0.0002 3.5854 (1, 1,2) 5.3941 0.0035 3.5800 (2, 1, 0) 5.3927 0.0033 3.5808 (2, 1, 2) 5.3947 0.0031 3.5812 The bold row represen he bes ARIMA model among he several experimens. Figure 6: ARIMA (2, 1, 0) esimaion oupu wih DCLOSE of Nokia index. B. ARIMA (p, d, q) Model for Zenih Bank Index The sock daa of Zenih bank used in his sudy covered he period from 3 rd January, 2006 o 25 h February, 2011 wih oal of 1296 observaions. Figure 8 is he original paern of he series. From he graph here was upward movemen of he index from 2006 and downward movemen is observed 107
from 2008 possibly because of world financial crisis experienced a ha ime. Figure 10: Graphical represenaion of he Zenih bank sock index firs differencing Figure 8: Graphical represenaion of he Zenih Bank sock index closing price. Figure 9 is he correlogram of he ime series of Zenih bank sock index. From he graph of he correlogram, he ACF dies down exremely slowly which simply means ha he ime series is nonsaionary. If he series is no saionary, here is need o conver o saionary series by differencing. Afer he firs difference, he series DCLOSE of Zenih bank sock index becomes saionary as shown in figure 10 and figure 11 of he line graph and correlogram of he series afer firs differencing. Figure 11: The correlogram of Zenih bank sock price index afer firs differencing. Figure 12 is he ADF uni roo es on DCLOSE of he series which also indicaes he firs difference of he series becomes saionary. Figure 9: The correlogram of Zenih Bank sock price index 108
paerns lef in he ime series and here is no need for furher consideraion of anoher AR(p) and MA(q). Figure 12: ADF uni roo es for DCLOSE of Zenih bank sock index. Table 2 shows he differen parameers of auoregressive (p) and moveing average (q) of he ARIMA model in order o ge he bes fied model. ARIMA (1, 0, 1) is relaively he bes model as indicaed in figure 13. The model reurned he smalles Bayesian or Schwarz informaion crierion of 2.3736 and relaively smalles sandard error of regression of 0.7872 as shown in figure 13. Figure 13: ARIMA (1, 0, 1) esimaion oupu wih DCLOSE of Zenih bank index. Figure 14 is he correlogram of residual of he seies. From he figure i is obvious here is no significan spike of ACFs and PACFs. This means ha he residual of his seleced ARIMA model are whie noise. There is no oher significan Figure 14: Correlogram of residuals of he Zenih bank sock index. In forecasing form, he bes model seleced can be expressed as follows: Y = φ 1 Y 1 θ1ε 1 + ε (3) where, = Y Y ε (i.e., he difference beween he acual value of he series and he forecas value) TABLE II: STATISTICAL RESULTS OF DIFFERENT ARIMA PARAMETERS FOR ZENITH BANK STOCK INDEX ARIMA BIC Adjused R 2 S.E. of Regression (1, 0, 0) 2.4385 0.9970 0.8151 (1, 0, 1) 2.3736 0.9972 0.7872 (2, 0, 0) 3.3682 0.9925 1.2974 (0, 0, 1) 6.9285 0.7372 7.6951 (0, 0, 2) 6.9815 0.7228 7.9018 (1, 1, 0) 2.3659 0.0708 0.7860 (0, 1, 0) 2.4338 0.0000 0.8151 (0, 1, 1) 2.3693 0.0669 0.7873 (1, 1,2) 2.3714 0.0701 0.7863 (2, 1, 0) 2.4370 0.0031 0.8144 (2, 1, 2) 2.4412 0.0036 0.8142 The bold row represen he bes ARIMA model among he several experimens IV. RESULTS AND DISCUSSION The experimenal resuls of each of sock index are discussed in he subsecion below. 109
A. Resul of ARIMA Model for Nokia Sock Price Predicion Table 3 is he resul of he prediced values of ARIMA (2, 1, 0) considered he bes model for Nokia sock index. Figure 15 gives graphical illusraion of he level accuracy of he prediced price agains acual sock price o see he performance of he ARIMA model seleced. From he graph, is obvious ha he performance is saisfacory. TABLE III: SAMPLE OF EMPIRICAL RESULTS OF ARIMA (2,1,0) OF NOKIA STOCK INDEX. Sample Period Acual Values Prediced Values 1/3/2010 13.28 13.58 2/3/2010 13.51 13.69 3/3/2010 13.86 13.80 4/3/2010 13.78 13.91 5/3/2010 14.13 14.02 8/3/2010 14.17 14.13 9/3/2010 14.12 14.24 10/3/2010 14.56 14.35 11/3/2010 14.49 14.45 12/3/2010 14.84 14.56 15/3/2010 14.81 14.67 16/3/2010 15.14 14.77 17/3/2010 15.42 14.88 18/3/2010 15.28 14.98 19/3/2010 15.07 15.09 22/3/2010 15.11 15.19 23/3/2010 15.26 15.30 24/3/2010 15.07 15.40 25/3/2010 15.20 15.50 26/3/2010 15.46 15.60 29/3/2010 15.42 15.71 30/3/2010 15.41 15.81 31/3/2010 15.54 15.91 B. Resul of ARIMA Model for Zenih Bank Sock Price Predicion In his case, ARIMA (1, 0, 1) was seleced as he bes model for Zenih bank sock index afer several adjusmen of he auoregressive (p) and moving average (q) parameers in Eviews sofware used. Table 4 conained he prediced values of he model seleced and figure 16 is he graph of prediced price agains acual sock price o demonsrae he correlaion of accuracy. From he graph, he performance of he ARIMA model seleced is quie impressive as here are some insances of closely relaed of acual and prediced values. TABLE IV: SAMPLE OF EMPIRICAL RESULTS OF ARIMA (1,0,1) OF ZENITH BANK INDEX Sample Period Acual Values Prediced Values 1/3/2010 16.19 15.83 2/3/2010 15.98 15.86 3/3/2010 15.71 15.89 4/3/2010 15.50 15.91 5/3/2010 15.70 15.94 8/3/2010 15.75 15.97 9/3/2010 15.86 15.99 10/3/2010 16.00 16.02 11/3/2010 16.19 16.05 12/3/2010 16.99 16.08 15/3/2010 17.83 16.10 16/3/2010 17.71 16.13 17/3/2010 17.50 16.16 18/3/2010 16.85 16.18 19/3/2010 17.69 16.21 22/3/2010 18.00 16.24 23/3/2010 18.00 16.26 24/3/2010 17.85 16.29 25/3/2010 17.89 16.31 26/3/2010 18.11 16.34 29/3/2010 19.01 16.37 30/3/2010 19.96 16.39 31/3/2010 18.97 16.42 Figure 15: Graph of Acual Sock Price vs Prediced values of Nokia Sock Index 110
Figure 16: Graph of Acual Sock Price vs Prediced values of Zenih Bank Sock Index V. CONCLUSION This paper presens exensive process of building ARIMA model for sock price predicion. The experimenal resuls obained wih bes ARIMA model demonsraed he poenial of ARIMA models o predic sock prices saisfacory on shor-erm basis. This could guide invesors in sock marke o make profiable invesmen decisions. Wih he resuls obained ARIMA models can compee reasonably well wih emerging forecasing echniques in shor-erm predicion. REFERENCES [1] P. Pai and C. Lin, A hybrid ARIMA and suppor vecor machines model in sock price predicion, Omega vol.33 pp. 497-505, 2005 [2] J.J. Wang, J.Z. Wang, Z.G. Zhang and S.P. Guo, Sock index forecasing based on a hybrid model, Omega vol.40 pp.758-766, 2012. [3] L.Y. Wei, A hybrid model based on ANFIS and adapive expecaion geneic algorihm o forecas TAIEX, Economic Modelling vol. 33 pp. 893-899, 2013. [4] G.S. Asalakis, E.M Dimirakakis. and C.D. Zopounidis, Ellio Wave Theory and neuro-fuzzy sysems, sock marke predicion: The WASP sysem, Exper Sysems wih Applicaions, vol. 38, pp.9196 9206, 2011. [5] S. K.Mira, Opimal Combinaion of Trading Rules Using Neural Neworks, Inernaional Business Research, vol. 2, no. 1, pp. 86-99, 2009. [6] G.S. Asalakis and P.V. Kimon, Forecasing sock marke shor-erm rends using a neuro-fuzzy mehodology, Exper Sysems wih Applicaions, vol. 36, no. 7, pp.10696 10707, 2009. [7] M.M. Mohamed, Forecasing sock exchange movemens using neural neworks: empirical evidence from Kuwai, Exper Sysems wih Applicaions, vol. 27, no. 9, pp.6302 6309, 2010. [8] L.C. Kyungjoo, Y. Sehwan and J. John, Neural Nework Model vs. SARIMA Model In Forecasing Korean Sock Price Index (KOSPI), Issues in Informaion Sysem, vol. 8 no. 2, pp. 372-378, 2007. [9] N. Merh, V.P. Saxena, and K.R. Pardasani, A Comparison Beween Hybrid Approaches of ANN and ARIMA For Indian Sock Trend Forecasing, Journal of Business Inelligence, vol. 3, no.2, pp. 23-43, 2010. [10] J. Serba and Hilovska, The Implemenaion of Hybrid ARIMA Neural Nework Predicion Model for Aggregae Waer Consumpion Predicion, Aplima- Journal of Applied Mahemaics, vol.3, no.3, pp.123-131, 2010. [11] C. Javier, E. Rosario, J.N. Francisco and J.C. Anonio, ARIMA Models o Predic Nex Elecriciy Price, IEEE Transacions on Power Sysems vol. 18 no.3, pp.1014-1020, 2003. [12] N. Rangan and N. Tiida, ARIMA Model for Forecasing Oil Palm Price, Proceedings of he 2 nd IMT-GT Regional Conference on Mahemaics, Saisics and Applicaions, Universii Sains Malaysia, 2006. [13] M. Khasel, M. Bijari, and G.A.R Ardali,, Improvemen of Auo- Regressive Inegraed Moving Average models using Fuzzy logic and pp. 956-967, 2009. [14] C. Lee, C. Ho, Shor-erm load forecasing using lifing scheme and ARIMA model, Exper Sysem wih Applicaions, vol.38, no.5, pp.5902-5911, 2011. [15] M. Khashei, M. Bijari, G. A. R. Ardal, Hybridizaion of auoregressive inegraed moving average (ARIMA) wih probabilisic neural neworks, Compuers and Indusrial Engineering, vol. 63, no.1, pp.37-45, 2012 [16] C. Wang, A comparison sudy of beween fuzzy ime series model and ARIMA model for forecasing Taiwan Expor, Exper Sysem wih Applicaions, vol.38, no.8, pp.9296-9304, 2011. [17] A. Meyler, G. Kenny and T. Quinn, Forecasing Irish Inflaion using ARIMA Models, Cenral Bank of Ireland Research Deparmen, Technical Paper, 3/RT/1998. [18] B.G. Tabachnick and L.S. Fidell, Using mulivariae saisics, 4 h ed., Person Educaion Company, USA 2001. 111