2011 Iteratoal Coferece o Ecoomcs ad Face Research IPEDR vol.4 (2011 (2011 IACSIT Press, Sgapore Forecastg Tred ad Stoc Prce wth Adaptve Exteded alma Flter Data Fuso Betollah Abar Moghaddam Faculty of Maagemet ad Accoutg Scece Islamc Azad Uversty-Qazv Brach Qazv, Ira e-mal: fa@qau.ac.r Hassa Haleh, Saeed Ebrahmjam Faculty of Idustral ad Mechacal Egeerg Islamc Azad Uversty-Qazv Brach Qazv, Ira e-mal: hhaleh@cc.ut.ac.r, ebrahmjam@mrl.r Abstract obtag to the method wth the least predcto error s oe of the challegg ssues of facal ad vestmet marets aalyzers. Ivestors ofte use two dfferet vews of techcal ad fudametal aalyss of prces for buyg ad sellg ther desred shares. But each of these two methods aloe may have ot eough performace due to dffereces betwee the actual value of the share ad ts maret prce. Ths paper presets a predctve model amed exteded alma flter whch smultaeously fuses formato ad parameters of techcal ad fudametal aalyss. The as a real test, the model mplemeted for the shares of oe of dustral compay Ira. Fally, the obtaed results wll be compared wth other methods results such as regresso ad eural etwors whch shows ts desrablty short-term predctos eywords- Stoc exchage, data fuso, Exteded alma flter, techcal ad fudametal aalyss. I. INTRODUCTION The developmet ad ecoomc growth each coutry has drect relato wth the vestmets doe that coutry. So that the developg coutry, captal formato s cosdered as a mportat factor ecoomc growth ad mag the process for developmet. I developed coutres stoc exchage s a offcal orgazato for captal, through attractg vestmet ad stagat savgs of the socety ad coduct ther affars producto whch led to crease ecoomc growth ad prosperty has bee produced ad ths way effect o macroecoomc varables such as GDP, moey, flato ad terest rates. That's why stoc maret boom ad moblty ow as a crtero of dyamc ecoomes of the coutres. Today s, vestg stoc s a mportat part of socety ad ecoomy, the other had, stoc prce volatlty the all stoc exchages s commoplace. Stoc prces affected by exteral ad teral factors le poltcal, ecoomc ad etc, so the stoc prce predcto for captalsts s very mportat to be able to retur most of ther vestmet wll ear. Meawhle, gve the uavalablty of accurate formato about the factors affectg stoc maret fluctuatos ad of uow factors affectg stoc prce chages, due o brgg people to predct prce chages by the compaes but ths smply ot possble. Geerally there are two vewpots of aalyzg: Techcal aalysts ad fudametal aalysts. Techcal aalysts ca calculate the trsc value of stoc. They beleve that the maret has udergoe a pseudo psychologcal mode ad hstory s always repeatable ad patters at ay tme cause reputato of treds of prce. Therefore by studyg the past tred, the future could be predcted [1]. But terms of fudametal aalysts, the stoc maret has o memory ad prces are chaged radomly. As oted, the ma purpose of techcal aalyss s predctg treds of stoc prce. However, predctos are ofte ot correct ad have some errors that the rate decreases wth creasg of formato. The other commet whch was rased sad: techcal aalyss based o the wea prcples. For example, the expectato that some of hstorcal patters of the share prces wll be repeated the future may ot ecessarly occurs, because maret codtos wll chage over tme. But 1970, Fama preseted a ew hypothess whch s called effcet maret hypothess (EMH, t s commoly beleved that each perod of tme, asset prces such as stoc prces reflect all formato about them [2]. Ad all Techcal or fudametal aalyss ad predcto are faled. But ths smple dea was a lot dscussed of cotroversal facal vestgators. I may of the argumets rased agast the theory of maret effcecy, there have bee detfed ad repettve patters for prces, there are examples of ths case, we ca meto le: Jauary effect or Blue Moday Wall Street whch are some of those predctable repettve patters [3]. Accordg to a research doe Ira stoc exchage maret, very poor effcecy was domated ad a specfc patter of behavor ca be observed the chagg of prces, so awareess of ths model ca help vestors to obta more beefts [4]. I the recet years may researches were doe ths area, some tred to resolve the problem by classcal methods such as expoetal smoothg, tred aalyss, ad regresso equatos (Farrell, 2007, some uses tellget methods such as eural etwors ad fuzzy or combato 119
methods. But a lot of bugs to ay of these methods are etered. as a further example lear predcto models are used the methods, whereas realty most processes are olear. Or tellget methods requre a lot more data for the learg system. the absece of data; models of chages are ot correctly detfed ad systems shall operate correctly o-traed codtos. Or eve the dfferece betwee the expected prce stoc maret prces ad lac of adherece to the theoretcal model, prevet correct predcto of prces. Ths study preseted a model, based o techcal aalyss stoc maret prces. Method used ths study s d of tme seres ettled the alma flter whch acts based o aalyzg chage of data versus tme. But accordg to the past researches o stoc maret areas, the use of lear models are ot capable of predctg prces the log tme, so a d of advaced methods whch s called exteded alma flter algorthm wll be used, The advatage of developg ths type of flter s able to use o-lear models as ma system model [5]. By the data fuso method of exteded alma flter the possblty of combg dfferet dcators used the fudametal aalyss le ecoomc varables wth techcal aalyss ad geeral tred of chage s possble. II. EXTENDED ALMAN FILTER alma Flter s created from the ame Rudolf E. alma a artcle whch was publshed 1960 that presets recursve soluto to flter the lear dscrete data [6]. alma flter actually s a set of mathematcal equatos that s type of optmally estmator, predctor ad corrector whch sesbly mmzes the estmato error covarace [7]. alma flter s tryg to uderstad the geeral ssues whch are to estmate the state of X R dscrete-tme cotrol process that has lear dfferetal fucto. Now what happes f a process that should be estmated ad (or relatoshp wth the measuremet process s olear? May successful ad terestg applcatos the alma Flter are these codtos. The alma flter that lear mea ad covarace of states s ow exteded alma flter (EF [8]. Assume that the process has X R state vector. ad process gve wth a olear radom dfferetal equato. equato 2 s related to the state x to the measuremet z [9]. T 1 P C ( C P C + R (3 x ˆ xˆ + ( z h( xˆ,0 (4 P + T T A ( I C H P A Q (5 III. DATA FUSION MODEL BY EF Accordg to the prevous Secto about the tred of chage stoc prce ad the reasos offered by the stoc maret techcal aalysts, t seems that there s a strog relatoshp betwee prce chages ad the tme. But accordg to fudametal aalysts commets the teral ad exteral ecoomc factors orgally fluece o stoc prces. Therefore, after dfferet ways that were examed, ths was resulted, perhaps the alma flter _accordg to ts computatoal features that were troduced the prevous secto_ s capable for data fuso of both stoc maret aalyss ad forecastg a more realstc prce based o ecoomc ad tme varables. So ths secto a structure wth mult put-output was developed whch had a exteded alma flter ts heart, Structure desged to combe formato of fudametal ad techcal aalyss preseted as below. Accordg to the structure data are etered from two sdes. The frst part s some ecoomc ad facal parameters used by that fudametal aalyss. These varables after movg to the structure put the system model ad the chages to prce. x By measuremet 1 1 f ( x, u, w 1 m z R whch: (1 z h( x, v (2 Where the radom varable w ad v represets the process ad measuremet ose. I ths equato, olear fucto of f the dfferetal equato 1 related to the state the prevous tme step to curret tme.these are also clude fucto parameters u ad zero mea ose process ( w. Nolear fucto h measuremet Fgure 1. Data fuso structure based o Exteded alma flter 120
Secod part s the geeral tred of maret prces _whch s techcal aalyss data. alma Flter ca estmate ad predct data wth ormal dstrbuto. Therefore, t should be chec f the stoc prce follows the ormal dstrbuto? Accordg to the coducted research the aswer s yes. Hstogram o stoc prce of each compay of Ira was draw ad the the ormal curve was adjusted o the hstogram ad compared, the prce chagg of the shares follow from the ormal dstrbuto [10]. Next secto s about mplemetato of the model o the stoc of a dustral compay as case study. IV. MODEL IMPLEMENTATION To mplemet the model, 183 records of formato for oe year of Bahma dustral group were explored from RAHAVARD NOVIN software. The followg dagram shows tred of stoc prce. Here, u are the facal ad ecoomc parameters of the stoc maret evromet. O the other had the techcal aalyss of data related to stoc prce chages, as put prces obtaed from prevous occurred observatos_ are calculated the fucto h ad the etered to the EF. z ˆ h( x, v (8 As metoed the prevous secto the alma flter performace eed the use of parameters leq, R, W ad V. These parameters are always set practcally. Now let s calculate the statstcal parameters by usg avalable data. Q s covarace of process ose [11] To calculate Q accordg to the parameters defto, a terval stoc prce chages should be calculated. For ths purpose, a specfed perod (oe year chage stoc prce Bahma Group s calculated by the formula. e ( P ( - P ( -1 (9 Fgure 2. The stoc prce tred of a dustral compay Ira oe year To mplemet the model, other parameters such as EPS, effcecy rato, maret effcecy ad the coeffcet β, were requred for calculatg the expected actual retur ad mag ecoomc model of stoc prce of Bahma group. After explorg data from the RAHAVARD NOVIN software, ow, accordg to avalable formato, the Gordo model ca be assumed as a system model for the stoc le Bahma group. E b P (1 0 0 (6 br Where, P 0 s the prce of the stoc the frst year, b, the percet of held terest,, s Expected rate of retur o shareholders, r, vestmet effcecy rate, br, s dvded grow rate. Accordg to the parameters avalable Fudametal Aalyss, Gordo model was assumed as put state model of the system ths project. E0 (1 b x f ( x 1, u 1, w 1 (7 br Fgure 3. chage of the stocs prces of the compay durg oe year The error varace e s 0.777 whch s Q, ad accordg to p ( w ~ N(0, Q, W s calculated 0.001. R Is calculatg, by_ cosderg the defto of the parameter_ the dfferece betwee real prce ad the state model prce. Accordg to below equato: e j ( f j( - h j( (10 121
Fgure 4. Chages of the error betwee actual prce ad model prce Fgure 5. Predcto dagram of the ext day stoc prce by EF data fuso The error varace e s 0.1138 whch s R, ad accordg to P ( v ~ N(0, R, V s calculated 0.01. Now all the parameters are specfed, alma flter ca be developed to create the structure ad values ca be replaced [12]. A f ( xˆ, u E b br (11 1- b E E(1 b E(1 b (12 A 2 2 ( ( y h( x + v C (13 2 x ˆ ( 0.0082 + 0.0467 + 1101.1 (14 h ( xˆ 0.0164 + 0.0467 h (15 The exteded alma flters formulas are accordg to equato (3, (4 ad (5 metoed the prevous secto wth the respect of prce chagg. T T 1 P C ( C P C + R (16 x ˆ Δ ( ˆ, + ( Δ Δ ( ˆ f x u z h x,0 (17 xˆ + Δxˆ (18 T A ( I C H P A + Q (19 Δ xˆ P V. RESULTS After the mplemetato of the smulated structure code wth MATLAB 7 followg results were obtaed. For example, after aalyzg of oe year data by the structure the ext day s predcted. Fgure 6. Chages of the error after passg through EF structure I the above graph, reducto of the error the predcted prce compare wth the actual prce after leavg the alma flter s observable. I cotue, for more examato of the method, forecastg was doe the dfferet horzo of tme. Table I shows the result of the expermets. TABLE I. STOC PRICE PREDICTION IN DIFFERENT TIME HORIZON WITH EF MODEL Predct for Next day Next wee Next moth Occurred prce Predcted prce 1496 1681 1584 MSE 25.9 62.7 25.7 MAE 156.76 53.9 39.6 VI. CONCLUSIONS Ths artcle was tryg to predct stoc prces of the stoc maret the short term, relyg o a ew fuso method called exteded alma flter that eables to use fudametal aalyss of stoc prce wth techcal aalyss. 122
I the preseted structure, smultaeous aalyss of techcal data (wth the dcators wth fudametal aalyss data (wth facal varables that clude geeral stoc prce model were etered to predcto-correcto flter amed exteded alma flter. The, after statstcal ad possbltes calculato, a ew stoc prce wll be preseted as the algorthm predcted prce to the user. As the graphs Fgure 5 ad 6 shows, t s clear that the error of predcto reduced much after passg through the flter, whch shows the proper effcecy of the preseted model ths research. Data the table II, compare the calculated error values predcted the three offered methods for the same tme horzo of the same compay [13]. For better comparso, scetfc dcators such as mea square error (MSE ad mea absolute error (MAE was measured for each method to show the success of the algorthm ths paper. [12] S.Maybec,P. Stochastc models, estmato ad cotrol, Harcourt Brace Jovaovch Publsher, Academv Press. 1979.. [13] Todd F., M.. Correa, A.., Gaussa Process Regresso Models for Predctg Stoc Treds, MIT techcal report, 2007. TABLE II. ERROR COMPARISON IN DIFFERENT METHOD OF PREDICTION Methods MSE MAE Regresso method Artfcal eural etwors Exteded alma flter data fuso 92.44 40.09 25.90 79.44 154.46 156.76 REFERENCES [1] Prg, Mart J. Itroducto to Techcal Aalyss;, Mc Grow Hll.1998. [2] Fugece,F. Fama., Effcet Captal Maret: A Revew of Theory ad Eprcal Wor, The Joural of Face, No.2, May1970, PP.383-417. [3] Doald B., em., Sze-Related Aomales ad Stoc Retur Seasoalty: Further Emprcal Evdece, Joural of Facal Ecoomcs 12, 1983. [4] Namaz, Mohammad, Shvshtrya, Zyeh., "Stoc Maret Performace Aalyss of Ira. Stoc Exchage Maret", Joural of Facal Research ad Scetfc Research, Secod Year, No. 7 ad 8, pages 82-104. 1994. [5] Q, M. & G.S. Maddala, Ecoomc Factors ad The Stoc Maret: A New Perspectve;, Joural of Forecastg18, pp: 151-166. 1999. [6] alma,r.e, A New Approach to Lear Flterg ad Predcto Problems, Trasacto of the ASME-Joural of Basc Egeerg (seres D:pp: 35-45. 1960. [7] McMlla, D. G. No-Lear Predctablty of Stoc Maret Returs: Evdece from No-Parametrc ad Threshold Models, Iteratoal Revew of Ecoomcs ad Face, Vol.10, pp. 353-368. 2001. [8] Welch, G., Bshop,G. A Itroducto to the alma fletr. by ACM, Ic. 2001. [9] Hay, Smo, alma Flterg Ad Neural Networs, AWley&Scece Publcato,2001, ISBN 0-471-36998-5. [10] Fracs, J.C., Ivestmet: Aalyss ad maagemet,new Yor, 1972, McGraw-Hll. [11] Huag, Sha-Chag, Ole opto prce forecastg by usg usceted alma flters ad support vector maches, Joural of Expert Systems wth Applcatos 34, 2008, 2819 2825. 123