1 HG Feb 2014 ECON 5101 Exercises III - 24 Feb 2014 Exercise 1 In lecure noes 3 (LN3 page 11) we esimaed an ARMA(1,2) for daa) for he period, 1978q2-2013q2 Le Y ln BNP ln BNP (Norwegian Model: Y Y, where (1) 0 1 1 1 1 2 2 2 ~ WN(0, ) Table 1 Esimaes (mle): 0 1 1 2 Esimae 00062 0729-1105 0490 00095 Serror 00012 0124 0116 0084 000062 A The mle esimaes deermine a causal saionary soluion for Y Why? B The causal saionary soluion is Y (2) 1 1 2 2,,,,, (i) Deermine formulas for 1 2 (ii) (iii) Deermine he formula for he dynamic muliplier Deermine he formula for he long run effec of a uni change in leaving he oher errors erms unchanged Esimae he long run effec from he daa Y C Make a plo of he dynamic mulipliers along he lines of Seminar I (appendix) using he esimaes in able 1 If you use Saa, use Saa 13
2 D (Poenial rap in Hamilon) An alernaive mehod of finding he dynamic mulipliers, is using Hamilon sec 12 (see page 13), who finds explici formulas for he dynamic mulipliers Y w In our case 0 1 1 2 2 w, so muliplier we really wan (ie, (i) (ii) Explain why Y w and Y Y ) Y w is hardly he dynamic are no he same hing in our case Y How would you use Hamilons s soluion o derive he relevan dm s? Exercise 2 The Norwegian GDP daa, discussed in he lecures, have been pu on he course webpage in a zip-file The file conains a Saa da-file (wih sse daa) The daa are also given as an excel-file for hose ha use anoher sofware The daa are quarerly observaions of ln(gdp) in he period 1978q1 2013q2 In his exercise we wan o calculae ou-of-sample forecass for he period 2013q3 2015q4, based on he Arima(1,1,2) model esimaed in he lecure noes 3 (LN3) In addiion we wan o evaluae he uncerainy of he forecas using Saa s simulaion procedure A (i) Describe formulas for he 4 firs forecass ( Y ˆ, for 1,2,3,4 and 2013 2 q ) (see, eg, LN4 page 9) (ii) How would you predic he necessary ' s involved? s B Ou-of-sample forecas of ln GDP Download he GDP daa in Daa for seminar III Noe ha he daa in he Saa da-file already are declared a ime series (by he sse command) The variable ln BNP is called y in he daa se, while Y in model (1) is acually symbols ) y (sorry abou slighly clumsy use of As a check you may make plos sline y for ln BNP and sline Dy for ln BNP
3 Esimae he arima(1,1,2) for y by arima y,arima(1,1,2) Considering he small esimaed error sandard deviaion, i may be a good idea (wih regard o he simulaions below) o blow up he observaions, eg, by a facor 100, yy 100* y, gen yy=100*y arima yy,arima(1,1,2) Which esimaes in he oupu are affeced by he blow up and which are no? We need o define our forecas horizon (10 quarers ahead) sappend, add(10) Look a he effec in he daa base Following he descripions in he firs forecas secion in he pdf-manual (read he example of he Klein model here), we need o sore he esimaes of he arima (his will be used by he forecas commands) esimaes sore us (us is he name of he esimaes se) esimaes dir (for checking) forecas creae mod1, replace (iniiaion of he model called mod1) forecas esimaes us, names(us) (he forecass are now ready o calculaed) forecas solve, log(off) Look a he resul in he daa base Plo he ime series 100 ln BNP including he forecass from 2005q1 woway (sline f_us if >=q(2005q1)), line(2013q2) Now, ransfer hese forecass o he original series he resul from 2005q1 ln BNP (in he original scale) and plo [Hin: Noe ha if we have daa, x0, x1, x2,, x, he we ge x x x x x (called inegraion of he 0 1 2 series) ] x
4 C Uncerainy by simulaion (In Saa13 read pdf-manual ime series > forecas solve -> example 2 and 3 In paricular read he inroducion before example 2 on predicion uncerainy simulaion) We will concenrae on he yy series (100 ln BNP ) Given a model here are wo componens in he predicion uncerainy, (1) uncerainy due o uncerain esimaes in he model, and (2) uncerainy due o variaions of he error erm (Noe Of course, here are oher sources of uncerainy as well, for example, model specificaion uncerainy, he risk of srucural breaks in he fuure of he series, ec These ouer sources of uncerainy are ignored in he presen calculaions ) For he following simulaions, i is a good idea o se he seed for he random number generaor before each simulaion experimen: (1) Tha makes i possible o reproduce exacly he experimen, and (2) i is always good o compare he resuls from several repeiions of he experimen for sabiliy Firs simulae he esimaion uncerainy se seed 54321 (or choose a seed (number) of your own) forecas solve, prefix(d1_) begin(q(2013q3)) simulae(beas, saisic(sddev, prefix(sd1_)) reps(100)) Noe Trying ou several seeds (remember o drop he forecas-variables in he daa base before each aemp), you will probably discover a source of un-sabiliy of he simulaions (no discussed in he Saa manual as far as I know) Someimes you will even ge quie wild (!) resuls Quesion: Can you hink of any reason (speculaion here no knowing exacly how Saa operaes is simulaions in a dynamic seing) why his phenomenon migh occur in his paricular siuaion? Afer having made up your mind of your seed, calculae confidence limis (check he daa base for he resuls) gen d1_us_up = d1_us + invnormal(0975)*sd1_us gen d1_us_dn = d1_us + invnormal(0025)*sd1_us woway (sline d1_us if >=q(2008q1)) (sline d1_us_dn if >=q(2008q1)) (sline d1_us_up if >=q(2008q1)), line(2013q2) Second Simulae he oal (esimaion plus error) predicion uncerainy se seed 567 (or a seed of your own) forecas solve, prefix(d2_) begin(q(2013q3)) simulae(beas errors, saisic(sddev,prefix(sd2_)) reps(100)) log(off)
5 gen d2_us_up = d2_us + invnormal(0975)*sd2_us gen d2_us_dn = d2_us + invnormal(0025)*sd2_us woway (sline d2_us if >=q(2008q1)) (sline d2_us_dn if >=q(2008q1)) (sline d2_us_up if >=q(2008q1)), line(2013q2) Exercise 3 (Some elemenary facs abou eigenvalues) I is imporan o know abou eigenvalues in ime series analysis They are also imporan in mos branches of mulivariae analysis Read firs he review of eigenvalues in LN4 page 14 (i) Explain why a k k marix A has a mos k eigenvalues [Hin Consider he meaning of he deerminan, A I ] (ii) Show ha he eigenvalues of a diagonal marix are is diagonal elemens Noe ha a diagonal marix A a11a 22 akk a11 0 0 0 a22 0 A 0 0 akk has deerminan (iii) Le he eigenvalues of he k k marix A be 1, 2,, k Show ha he deerminan is A 1 2 k (Noe (1) ha his is rue also if some of he 's are equal, which you do no have o prove here Noe (2) ha his implies ha A is nonsingular if and only if all eigenvalues are 0 Noe (3) I may also be menioned (ha you do no have o prove) ha he rank of a square marix( relevan in coinegraion analysis) is equal o he number of non-zero eigenvalues) [Hin Use propery (19) in LN4 page 15, ogeher wih he general marix propery C D C D for square marices of same dimension ]
6 (iv) Show ha all eigenvalues of a symmeric square marix (ie, A A ) mus be real numbers (Hence, eigenvalues of covariance marices are always real) [Hin Show firs ha he sandard represenaion of a complex number, z a ib, is unique, (where a is called he real par of z and he real number b he imaginary par of z) (Hin: Suppose z a ib aibare wo represenaions of z To show ha a aand b b, look a he absolue value (modulus) of he difference beween he wo represenaions ) Now, fill in he deails in he following skech of an argumen You will need he following general marix rule for aking he ranspose of an arbirary produc of marices, CD DC where C ~ pq and D ~ q p Proof Le b, be any eigenvecor and corresponding eigenvalue for A (ie, such ha Ab b ) Wrie b and in sandard form, b x iy and c id, where xy, are real vecors and cd, real scalars We mus prove ha d 0 : We ge Ab Ax iay b ( c id)( x iy) ec Equaing he real and imaginary pars of he resul, we mus have Ax cx dy, Ay dx cy Then muliply hese wo equaions by Explain why y and x respecively ( giving yax and x Ay ) yax and x Ay mus be equal Then subracing, 0 yax xay ec shows ha d mus be 0 (End of proof) ] A lile bi abou riangular marices ha are very common (and useful) in mulivariae analysis (v) Explain why he deerminan of an upper (or a lower) riangular marix mus be he produc of is main diagonal elemens Hin Evaluae, eg, he deerminan along he firs column ec (An upper riangular marix is A a a a 11 12 1k 0 a 0 0 a 22 2 k a kk (ie, all elemens below main diagonal are 0)
7 In a lower riangular marix all elemens are above he main diagonal are 0 (vi) Explain why he eigenvalues of an upper (or lower) riangular marix are he elemens on he main diagonal Exercize 4 (residuals) Le Y be any saionary series ha admis a linear (causal) represenaion Y 1 1 2 2 where ~ WN(0, ), and where all parameers are known (as esimaes or or in oher ways) Show ha (*) ˆ Y Y 1 where Yˆ 1 is he one-sep-ahead predicor of Y based on Y 1, Y 2, Y 3, Noe Using (*) we have a naural way o predic he error erms (hus deermining residuals) in causal saionary processes (including ARMA(p,q)), based on he he one-sep-ahead forecass of he series