scieee Open visual document viewer

Application of ARMA and GARCH models on time series of Komerční banka stocks

Sedláková, Markéta

Abstract

Jedním z hlavních cílů subjektů na trhu cenných papírů je ve správný okamžik akcie levně nakoupit (nakoupit podhodnocené akcie) a rovněž ve správný okamžik akcie draze prodat (prodat nadhodnocené akcie). Pro podhodnocené akcie je typické, že se v určitém okamžiku, vzhledem ke svým fundamentálním charakteristikám, obchodují za nízký kurz. Do budoucna lze u podhodnocených akcií předpokládat růst jejich ceny, což může investorovi, který nakoupil při nízkém kurzu, přinést kapitálový zisk. Podhodnocené akcie jsou tedy doporučovány k nákupu. Důležitým předpokladem je tedy přesné načasování nákupních a prodejních signálů. Problém však je, že nikdo přesně neví, kdy nastane ten správný okamžik, protože tržní cena akcií je ovlivněna mnoha faktory, které mají dopad na kolísání tržních hodnot akcií. Z tohoto důvodu se modelování volatility dostává do popředí zájmu mnoha finančních analytiků a investorů.

Full text

41 41 ACC JOURNAL 2020, Volume 26, Issue 2 DOI: 10.15240/ ul/004/2020-2-004 APPLICATION OF ARMA AND GARCH MODELS ON TIME SERIES OF KOMERČNÍ BANKA STOCKS Ma ké a Sedláko á Uni e si y o Sou h Bohemia, Facul y o Economics, Depa men o Applied Ma hema ics and In o ma ics, S uden ská 13, 370 05 České Budějo ice, Czech Republic e-mail: [email p o ec ed] Abs ac One o he main goals o en i ies in he secu i ies ma ke is o buy s ocks cheaply a he igh ime (buy unde alued s ocks) and also o sell s ocks expensi ely a he igh ime (sell o e alued s ocks). I is ypical o unde alued s ocks o be aded a a low p ice a some poin due o hei undamen al cha ac e is ics. In he u u e, unde alued s ocks can be expec ed o ise in p ice, which can b ing a capi al gain o an in es o who bough a a low p ice. Unde alued s ocks a e he e o e ecommended o pu chase. An impo an p e equisi e is he e o e he accu a e iming o buy and sell signals. The p oblem, howe e , is ha no one knows exac ly when he igh ime will come, because he ma ke p ice o s ocks is a ec ed by many ac o s ha ha e an impac on luc ua ions in he ma ke alue o s ocks. Fo his eason, ola ili y modeling is coming o he o e on o he in e es s o many inancial analys s and in es o s. Keywo ds ARMA model; GARCH model; S ocks; Vola ili y; Kome ční banka. In oduc ion The so-called Ma hema ical modeling p o ides me hods by which phenomena and ac i i ies ha ake place in a pe son’s daily li e can be s udied. Thus, ma hema ical modeling makes i e y easy o display complex ques ions o p oblems h ough ma hema ical equa ions o unc ions. One o he a eas whe e ma hema ical models can be used e y well is he a ea o inance, in which he inancial ma ke has a key posi ion. Based on supply and demand, he e is a mo emen o money and capi al be ween di e en en i ies. The main pla o m o hese inancial ansac ions is s ock exchanges, whe e he main a ac ions include s ocks o la ge companies. Howe e , he p oblem wi h hese ansac ions is a high deg ee o unce ain y, as s ock ola ili y is la gely unp edic able. Reasons include, o example, measu es o egula ions o go e nmen s in a gi en coun y, ma ke expec a ions, inancial o o he c ises, o he poli ical si ua ion in a gi en coun y. Fo his eason, p edic ion o modeling o s ock ola ili y comes o he o e on o he in e es s o many in es o s, economis s, specula o s o inancial analys s. 1 Resea ch Subjec The aim o his a icle is o analyze he beha io o Kome ční banka s ocks wi hin a gi en ime in e al using he applica ion o me hods and analyzes. This beha io al analysis will be 42 42 pe o med based on he esidue dis ibu ion calcula ed om he GARCH model, which will be es ima ed om he da a. The wo k will analyze bo h he expec ed changes ha ollow he no mal dis ibu ion, bu mainly unexpec ed changes – he so-called hea y ails. The a icle uses as a da a sou ce he ime se ies o Kome ční banka s ocks in he pe iod om Janua y 2018 o Feb ua y 2019. Fo he analysis i sel , he s a is ical so wa e R was used as a ool. 2 Resea ch P ocess Fi s o all, he sou ce da a mus be ea ed so ha he e is no non-s a iona i y and inhomogenei y in he da a. The so-called au oco ela ion also occu s as an undesi able phenomenon in he case o ime se ies. Failu e o espec he au oco ela ion o esidues esul s in skewed es ima es o unknown pa ame e s, which also a ec s o he cha ac e is ics. I au oco ela ion occu s in he ime se ies, hen he esidues a e no independen . The ime se ies he e o e need o be cleaned so ha he esul ing p- alues a e no skewed. The e o e, ime se ies will be loga i hmized i s , which will emo e hei mul iplica i e cha ac e (mul iplica i e changes o ime se ies will be con e ed o addi i e changes). Then he me hod o he so-called 1s o de di e ence (di e en ia ion o sou ce da a) will be applied, which will emo e he non-s a iona i y o his da a. To e i y ha he gi en alues a e independen , he so-called au oco ela ion unc ion (independence e i ica ion) and pa ial au oco ela ion unc ion (independence e i ica ion when emo ing he in luence o he hi d quan i y) will be used. The au oco ela ion unc ion (ACF) is a sui able imaging ool o de ec ing isible pa e ns in da a. The ACF alue hen indica es a di e en ime in e als (Lag) whe he he e is any o m o au oma ic co ela ion in he da a. Nex , he GARCH model (wi h pa ame e s p, q) will be used, which is a model o examining ime se ies ola ili y. Using he GARCH model, he e oskedas ici y will be emo ed om he da a. A his poin , he al eady adjus ed da a show he cha ac e is ics o whi e noise, which means ha all in luences a e emo ed – so we ob ain independen , equally dis ibu ed (same a iance) o he andom a iable. In addi ion o he abo e assump ions (homogeneous, s a iona y se ies and non-co ela ion o loga i hmic e u ns), he hi d assump ion o ola ili y models, which is he no mali y o loga i hmic e u ns, mus be obse ed. His og am display can be used o e i y he no mali y o esidues. 3 Li e a y Resea ch and Fo mulas 3.1 Time Se ies Issues The ime se ies ep esen s he so-called nume ical a iable, he alues o which a e la gely dependen on he ime in which hese alues we e ob ained. I is basically a sequence o ch onologically a anged obse a ions. The ime poin s a which he da a we e ob ained a e usually equally dis an om each o he [5]. Desc ip ion h ough desc ip i e s a is ics can p o ide a su icien idea o he p ope ies o ime se ies as a single da a uni bu does no p o ide in o ma ion abou i s ime e olu ion [5]. Time se ies can be classi ied on he basis o a ious aspec s [5]: • acco ding o he na u e o he da a, he alues o which o m a ime se ies, • in e al ime se ies - he da a depends on he leng h o he in e al ha is moni o ed, • ins an aneous ime se ies - da a e e o a speci ic momen , • acco ding o he pe iodici y wi h which he da a a e moni o ed, • ime se ies o annual da a, 43 43 • sho - e m ime se ies, • by ype o da a moni o ed, • ime se ies o absolu e indica o s, • ime se ies o de i ed cha ac e is ics – e.g. cumula i e ime se ies. Time se ies a e he esul o obse a ions made a disc e e ime poin s. Some o hem a e hen disc ee in hei na u e (as an example, ime se ies o o al p oduc ion o a ce ain ag icul u al c op o indi idual yea s), o he s need o be “disc e ized” i s . Thus, ime se ies can be c ea ed by disc e iza ion o alues o a con inuously changing quan i y (e.g. a se ies o alues o ampli ude o a signal a gi en ime poin s), accumula ion o alues o moni o ed quan i y o a gi en ime pe iod (daily p ecipi a ion o als in me eo ology) o by a e aging alues o conside ed quan i y in gi en ime in e al (a e age daily empe a u es) [4]. I he e is a choice, hen i is ecommended o choose a comp omise solu ion. The high densi y o obse a ion ime poin s allows he cha ac e is ics o he ime se ies o be well cap u ed, bu calcula ion di icul ies can occu . The choice o equidis an in e als be ween adjacen obse a ions should be a ma e o cou se. As pa o he analysis o economic ime se ies, p oblems associa ed wi h he calenda may occu (di e en leng hs o calenda mon hs, di e en numbe o wo king days pe mon h, mo ing holidays). In such cases, a so-called “s anda d mon h” o 30 days o a s anda d numbe o wo king days pe mon h is usually in oduced, o he obse ed da a a e accumula ed. The leng h o a ime se ies is de ined as he o al numbe o obse a ions in he ime se ies, no as he ime span be ween he i s and las obse a ions [4]. 3.2 Time Se ies Au oco ela ion A key assump ion unde lying he linea eg ession model (LRM) commonly used in applied econome ic s udies is a su icien limi a ion o a phenomenon called au oco ela ion [6]. An impo an ea u e o ime se ies is hei (po en ial) se ial co ela ion. The e o e, a ho ough analysis and isualiza ion o hese co ela ions is needed. The au oco ela ion be ween wo andom a iables X_ and X_ ( + k) can be desc ibed as ollows [2]: 𝐶𝑜𝑟(𝑋𝑡+𝑘,𝑋𝑡)=𝐶𝑜𝑣(𝑋𝑡+𝑘,𝑋𝑡) √𝑉𝑎𝑟(𝑋𝑡+𝑘)𝑉𝑎𝑟(𝑋𝑡) (1) Since momen s a e equi ed o s a iona y da a o be cons an o e ime, au oco ela ion can be w i en o hese alues as a unc ion o delay [2]: 𝜌(𝑘)= 𝐶𝑜𝑟(𝑋𝑡+𝑘,𝑋𝑡) (2) The mos common au oco ela ion es in he eg ession model is he bo de line Du bin - Wa son es , which is used o es he independence o esidues in he no mal eg ession model. The es inds applica ion when he da a a e ob ained sequen ially, and he alues o he dependen a iable o m a ime se ies [3]. Du bin - Wa son es is calcula ed as [2]: 𝐷 =∑(𝑟𝑡−𝑟𝑡−1)2 𝑛 𝑡=2 ∑𝑟𝑡2 𝑛 𝑡=1 (3) 44 44 3.3 Model AR-1 The au o eg essi e model o a ime se ies is based on he assump ion ha any alue in a ime se ies depends on he p e ious alue o ha se ies. The au o eg essi e model AR (p) o o de p can be de ined as ollows [1]: 𝑦𝑡= 𝑏1𝑦𝑡−1 + 𝑏2𝑦𝑡−2 + ⋯+ 𝑏𝑝𝑦𝑡−𝑝 +∈𝑡 (4) Whe e 𝑏1,𝑏2,…,𝑏𝑝 a e he coe icien s wi hin he au o eg essi e p ocess, ∈𝑡 is he so-called whi e noise (cu en alue), and 𝑦𝑡 is he new se ies alue calcula ed based on he p e ious alues. 3.4 MA Mo ing Sum Model The p ocess MA (q) – (Mo ing A e age) - o o de q can be w i en as ollows [1]: 𝑦𝑡=∈𝑡+ 𝑤1∈𝑡−1+ 𝑤2∈𝑡−2+ ⋯+ 𝑤𝑞∈𝑡−𝑞 (5) Whe e 𝑤 a e he pa ame e s o he model, ∈𝑡 is whi e noise. 3.5 ARMA Model By combining he al eady men ioned p ocesses AR (p) and MA (q), a mixed p ocess in he o m o ARMA (p, q) can be ob ained [1]. The condi ion o s a iona i y o he ARMA p ocess coincides wi h he condi ion o s a iona i y o he AR p ocess (p) and he condi ion o p ocess in e ibili y is he same as he condi ion o p ocess in e ibili y MA (q). The mean alue o he ARMA p ocess is also ze o (as in he p e ious AR and MA p ocesses) and i s au oco ela ion unc ion sa is ies a simila sys em o di e ence equa ions as in he AR p ocess. Se e al al e na i e op ions can be selec ed o w i ing he ARMA p ocess in he o m o a di e ence equa ion, a linea p ocess o in an in e ible o m. Fo each AR model o o de p, an equi alen MA model wi h a su icien numbe q o he in e e ence elemen can be ound. Economic o business ime se ies can be modeled using a ela i ely small numbe o p and q elemen s wi hin he AR, MA o ARMA model. The aim is o ind o de e mine he smalles numbe o p and q elemen s needed o sa is ac o y ime se ies p edic ion [1]. 4 P ac ical Resea ch The models will be applied o he ime se ies o Kome ční banka s ocks. This is a se ies wi h he leng h o 285 obse a ions. This is he daily de elopmen o s ocks wi h he excep ion o weekends and holidays om Janua y 2018 o Feb ua y 2019. The de elopmen o s ocks in his pe iod is shown in Figu e 1. 45 45 Sou ce: Own Fig. 1: Daily de elopmen o Kome ční banka s ocks A i s glance, i is clea , ha he se ies is inhomogeneous and non-s a iona y. Fo e i ica ion, he so-called au oco ela ion unc ion is used by de aul , which can be seen in Figu e 2, and he pa ial au oco ela ion unc ion shown in Figu e 3. Bu i s , he ime se ies mus be inse ed in o he so wa e R and commands o au oco ela ion ( e i ica ion o s a iona i y) and pa ial au oco ela ion unc ion ( e i ica ion o he in luence o he hi d quan i y) mus be used. Sou ce: Own Fig. 2: Au oco ela ion unc ion (ACF) o Kome ční banka s ocks 0 5 10 15 20 0.0 0.2 0.4 0.6 0.8 1.0 Lag ACF V1 46 46 The au oco ela ion unc ion (ACF) is a sui able imaging ool o de ec ing isible pa e ns in da a. The ACF alue a di e en ime in e als (Lag) indica es whe he he e is any o m o au oma ic co ela ion in he da a. In Figu e 2 you can see clea ly isible pa e ns be ween he da a. In o he wo ds, a clea iola ion o he p esump ion o independence can be no iced. Sou ce: Own Fig. 3: Pa ial au oco ela ion unc ion (PACF) o Kome ční banka s ocks The au oco ela ion unc ion g adually dec eases and he i s PACF alue is close o 1, which indica es ha he se ies is no s a iona y. In o de o apply he models, a numbe o KB s ocks need o be ans o med. Thus, i will be necessa y o loga i hm he da a, which will emo e hei inhomogenei y, and subsequen ly i will be necessa y o make a di e ence, which will emo e hei non-s a iona i y. A e using commands o loga i hm he da a and making a di e ence, i is now possible o iden i y he model by es ima ing he au oco ela ion and pa ial au oco ela ion unc ions, which a e shown in Figu es 4 and 5. I can be deduced ha his is indeed a s a iona y se ies, because ACF alues no longe g adually dec ease bu mo e in a ce ain in e al. 510 15 20 0.0 0.2 0.4 0.6 0.8 Lag Pa ial ACF Se ies akcie 47 47 Sou ce: Own Fig. 4: ACF s a iona y se ies o Kome ční banka s ocks The dashed line in he co elog am de e mines he unca ion poin s (con idence in e al). Values be ween ze o and his limi a e conside ed insigni ican , i.e. ze o. Thus, i is clea , ha he se ies does no con ain any MA p ocess because he ACF alues a e ze o. 48 48 Sou ce: Own Fig. 5: PACF s a iona y se ies o Kome ční banka s ocks The pa ial au oco ela ion unc ion helps de e mine he o de o he AR p ocess. Howe e , he moni o ed se ies also does no include his p ocess, because all PACF alues a e insigni ican . Co ela ions could no be demons a ed in his ime se ies, so he whole se ies is conside ed whi e noise. The GARCH model will he e o e be used o modeling. 4.1 Es ima ion o Vola ili y Models on he Time Se ies o Kome ční Banka S ocks Now he ola ili y model will be applied o he same ime se ies o KB s ocks. The GARCH model (p, q) will be used. Howe e , be o e he GARCH model is applied, he basic assump ions o modeling he ola ili y o a gi en se ies mus be e i ied. A signi icance le el o 0.05 is conside ed o all es s below. The gi en ime se ies mus again be ans o med in o a s a iona y se ies by means o loga i hmiza ion and subsequen ly di e ence. Figu es 4 and 5 a e p oo o he s a iona y se ies. Fu he mo e, he non-co ela ion o loga i hmic e u ns is de e mined, o example using he ACF and PACF unc ions. As al eady shown abo e, he gi en ime se ies does no con ain a co ela ion o andom a iables. The hi d basic assump ion o ola ili y models is he no mali y o loga i hmic e u ns. The Ja que-Be es can be used o e i y no mali y. Fo JB es , he null hypo hesis is ollowed, o which he no mali y o he dis ibu ion o loga i hmic e u ns is assumed, as well as he 510 15 20 -0.10 -0.05 0.00 0.05 0.10 Lag Pa ial ACF Se ies akcie4 49 49 al e na i e hypo hesis, which s a es ha loga i hmic e u ns do no ha e a no mal dis ibu ion. The p- alue is e y low (2.2e-16 in Figu e 7), which is less han he signi icance le el o 0.05, so he no mali y o loga i hmic e u ns mus be ejec ed. A his og am was also used as con i ma ion. The ac ha he loga i hmic yields do no ha e a no mal dis ibu ion is shown in Figu e 6, which shows a his og am o he ac ual dis ibu ion o he loga i hms o he se ies yields. Loga i hmic e u ns ha e a sha pe dis ibu ion, which is ypical o inancial se ies. Sou ce: Own Fig. 6: His og am Al hough he Ja que-Be es did no show he exis ence o a no mal dis ibu ion in he da a, his ime se ies can be used in he ola ili y model. The GARCH (1, 1) model will be applied o he ime se ies, which is he mos used model o examining ime se ies ola ili y. The esul s om he R s udio a e shown below in Figu e 7. His og am o akcie4 akcie4 F equency -0.04 -0.02 0.00 0.02 0.04 020 40 60 80 100 120