COMPARATIVE ANALYSIS OF ARTIFICIAL NEURAL NETWORK'S BACK PROPAGATION ALGORITHM TO STATISTICAL LEAST SQURE METHOD IN SECURITY PREDICTION USING NIGERIAN STOCK EXCHANGE MARKET AkiwaJe, A.T., IbharaJu, F.T. ad Arogudade, 0.1'. Departmet of Computer Scieces Uiversity of Agriculture, Abeokuta, Nigeria Abstract Statistical aalysis has ofte bee used i predictig fiacial operatios i Nigeria ecoomy. I this work. artificial eural etwork was used to predict movemets i stock prices i Nigeria Stock Exchage market. Studies were carried out for the predictio of stock idex values as well as daily directio of chages i the idex. A etwork was desiged usig Back Propagatio Algorithm (BPA) to predict stock idex values ad prices i the exchage for a period of 90 days. The data collected durig this period was processed usig the BPA algorithm to get a output such that the error betwee the actual idices ad prices, ad the computed output was brought to miimum. About 90% of the data was used for the actual traiig while the remaiig 10% was used as test data. The same data was also processed usig the Least Squares (LS) method. The results show that BPA algorithm has superior performaces i terms of the accuracy of predictio over the LS method. ihis result of the study is useful to stock market operators. Itroductio The paper focuses o predictig the value of stock shares traded i the Nigeria Stock Exchage usig Back Propagatio Algorithm (BPA) of Artificial Neural Network (ANN). I Nigeria, evaluatio, estimatio ad predictio are ofte doe usig statistical packages such as SAS, SPSS, GENST AT, MATLab, etc. Most of these packages are based o covetioal algorithms such as the least square method, movig average. time series. curvig fittig, etc. The performaces of these algorithms are ot robust eough whe the data set becomes very large. For a example, whe the movig average algorithm i time series was implemeted usig a programmig laguage with a set of data ad, outputs were geerated ad compared to the outputs obtaied from GENSTA T usig the same data, the two results were ot the same whe the data set becomes very large. Also, the begiig ad ed of the time series data are lost i movig averages. Movig averages i statistical methods ca geerate cycle that is ot preset i the iput data. Algorithm that implemeted the multivariate least square method i statistical packages is ot efficiet whe the dataset becomes very large (Vacoillie A). To overcome this somewhat, BPA algorithm has o'\v bee widely proposed by the research commuity to predict large set of data. The idea of usig BPA algorithm to predict large data set has assisted i derivig precise result from imprecise data. Neural Networks are self traiig systems that imitate the work of huma brai. It ca be defied as etirely ew paradigm i computig that are based o replicatig the fuctio ad the structure of huma brai. It is composed of a large umber bf highly itercoected processig elemets (euros) workig i uiso to solve specific problems. Data model The iput parameters that affect the stock market idex value are as follows: previous day stock idex value accordig to closig price quatity of stock idex values daily chages i idex values correspodig values of stock share idex value traded i Naira.
The umber of compaies used for the study was 35. The first 30 compaies' stock data collected were used for traiig while the last 5 compaies' data were used for testig after traiig. Experimetal data were gathered directly from Nigeria Stock Exchage website (www.igeriastockexchage.com) for a period of 90 days. For the data model, back propagatio euro model ad least square method were applied. Statistical methods ad artificial eural etwork The usual statistical methods for estimatio, evaluatio ad predictig are least square, move averages i time series, liear regressio, etc. We used Least Square algorithm as our statistical method, ad employed Back Propagatio Algorithm as the Artificial Neural etwork model. Back propagatio algorithm was employed due to its multi-layer perceptio structures. Least square method The least squares regressio of y o x is Y = 0 0 + OjX where 0 0 ad 0 1 are obtaied from the ormal equatios: L.Yi = 0o+OIL.Xi i~l ;~l L. XYi = 0 0 L. Xi + OJL. X 2 j i~1 ;~l i~l '\ L.XYj - i~l tt x2 ttx ; - t x, t~ ()2 ; Similarly, the least square lie of x o y is.give by x = b o + b1y This equatio is writte as '.'~ '"I''' 1 :.. :"~~opagatio (learig algorithm) 'The~le~rig algorithm of a eural etwork ca either be supervised or usupervised. A eural etwork is said to be.lc;~;'l~g supervised if the desire output is already kow. Durig the learig of supervised method, oe of the ipuf patters is applied to the etwork iput layer. The patter is propagated through the etwork to the etwork outp!!t layer. The output layer geerates a output patter which is the compared to the target patter. Depedig o the differece betwee output ad target, a error value is outputted. This outputted error idicates the
etwork's learig effort which ca be cotrolled by the imagiary supervisor. The greater the computed error value is, the more the weight will be chaged. Neural etworks that lear usupervised have o such target output value. It caot be determied what the result of the learig process will look like. Durig the learig process, the uits' weight values are arraged iside a certai rage, depedig o give iput values. The paper used supervised lealig to predict Nigeria stock exchage market idices because of its ability to use biary umber ad XOR operatio. It also employs geeralized delta rule for supervised traiig. The model receives a iput patter vector from the eviromet through its iput layer ad distributes it uchageable to the first hidde layer of euros. Ulike euros i the iput layer, those of the hidde ad output layers are o-liear uits. They receive weighted sum of output from the previous layer as iput. The etwork iput for euro j deoted by etwork j is defie as: where OJ is the threshold or bias for euro j (it is a costat uit ad always set to either 0 or I. 0; is the output of euro i coected to euro j through the itercoectio weight W ij Figure I illustrates the simple structure of Attificial Neural Network. owoo [ order to produce cosistetly correct result or output, etwork weights have to be traied. Back propagatio learig algorithm is illustrated as follows: 1. radomize all etwork weight to small umber e.g. -1 :::;0:::; 1. 2. apply a iput traiig vector X ad calculate the ANN_NET sigalfrom each euro usig the stadard formula: ANN_NE~ = LXjW jj i=1 OUT= {l, if ANN _ NE~ is greater tha threshold (j J 0, otherwise error j = target j - OUT
Implemetatio of back propagatio algorithm Back propagatio algorithm as described above was implemeted i Java Programmig Laguage. The data was read i sequetially i the order i which they were collected ad the maximum ad miimum of each attribute obtaied, followed by ormalizatio. The programme was writte i such a way that the hidde ode was icreased gradually i other to attai proper covergece. The sigmoid of all iputs to the hidde layers with the bias value multiplied by the radomly geerated weight for each uit was computed. To compute the output layer. the summatio of the sigmoid from hidde layer was also computed. The update of the iput layer with two iput odes was also computed. This ivolves the product of the learig rate ad error of output. After iteratio, the correspodig calculated output was closed to the actual output from the data set. 2y2 -ooly; -OILX;Y; The Least Square Method S~.x = ;=1 ;=1 ;=1 was also implemeted usig java programmig laguage ad the same set of data was applied as iput. takig the same precautios as i the case of the BPA algorithm. Compariso of back propagatio algorithm to the least square method The back propagatio performaces are compared to the performaces of the least square method. Table I shows the two models with average relative percetage errors that were derived from the set of Nigeria stock idex values that served as iput data to the both least square ad back propagatio algorithms. Model Back propagatio with oe hidde layer Back propagatio with two hidde layer Back propagatio with three hidde layer Least square method with 30 compaies Least square method with 35 compaies Average relative percetage'error (%) 1.430 1.486 1.512 2.43 3.15 As show i Table 1, the relative percetage error of back propagatio with oe, two ad three layer is still lower tha the Least Square Method, although the efficiecy of Back Propagatio Algorithm varied with the umber of hidde layers. For example, back propagatio with oe hidde layer had the highest accuracy ( 1.43). Lookig at the table agai, the average relative percetage errors calculated betwee back propagatio ad least square model showed that back propagatio model was superior to the least square method. The predictio models of back propagatio were more robust tha the least square method.,more so, usig oe hidde layer durig the processig performs better tha usig two or more layers. This also reduces the time complexity of the algorithm. Coclusio The work is ot sayig that statistical formulas are ot robust eough to predict or evaluate the data or whe the data become large. Most of the statistical packages use cov~tioal algorithms which require approximatio for better performaces. The work employed back propagatio of ANN because it is used to trai data for predictio while statistical methods calculate data for predictio, estimatio or evaluatio. From the results of the two methods (Least Square ad Back Propagatio Algorithm), it is better to use artificial eural etwork to predict a
large set of data. For example, the average relative percetage errors of back propagatio are always lower tha the average relative percetage of least square method. This idicates the efficiecy of the back propagatio algorithm over least square method. It ca be cocluded that back propagatio as oe of the Artificial Neural Networks is a better architecture to evaluate, estimate ad predict a set of large data tha ay statistical methods such as least square method. Refereces Bishop CM. 1995. Neural Networksfor Patter Recogitio, Oxford Uiversity Press, Oxford. Surada J.M. 1992. Itroductioll to Artificial Neural Systems, West Publishig Co, St Paul, MN. Vacoillie A. 2003. Desig ad applicatio of artificial eural etwork for digital image classificatio of tropical savaah vegetatio, PhD thesis, Ghat Uiversity. Phua P.K.H. Mirig D, Li W. 2000. Neural Network with Geetic Algorithms for Stocks Predictio, Fifth coferece of the Associatio of Asia-Pacific Operatios Research Societies, 5th-7th July, Sigapore. Mizuo H, Kosaka M, Yajima Had Komoda N. 1998. Applicatio of Neural Network to Techical Aalysis or Stock Market Predictio, Studies i Iformatics ad Cotrol, Vol. 7. No.3, pp. 111-120. Murray R.S. 2000. Problems ~fstatistics. 3rd Edit~o, Chapma ad Hall, New York. Park D.C, Elsharkaw M.A. Marks RJ. Atlasm L.E ad Damborg J. 1991. Electric load forecastig usig Artificial Neural Network, IEEE Tras, PAS. Vol. 6. Lee K.Y., Clay Y.T., Park T.H. 1992. Short Term :Ioad forecastig usig Artificial Neural Network. IEEE TrailS. PAS, ~l.~.