Sergey Ivashchenko. DSGE model estimation on base of second order approximation. Working paper Ec07/11 Department of Economics


 Elfrieda Gibson
 4 months ago
 Views:
Transcription
1 Sergey Ivashchenko DSGE model esimaion on base of second order approximaion Working paper Ec7/ Deparmen of Economics S. Peersburg 2
2 УДК ББК 65. I98 Европейский университет в Санкт Петербурге Сергей Иващенко Оценка модели DSGE на основе приближения второго порядка на английском языке Серия препринтов; Ec 7/; Факультет экономики Санкт Петербург 2 Ivashchenko S. I98 DSGE model esimaion on base of second order approximaion / Sergey Ivashchenko : Working paper Ec 7/; Deparmen of Economics. S. Peersburg : European Universiy a S. Peersburg 2. 6 p. This aricle compares properies of differen non linear Kalman filers: well known Unscened Kalman filer (UKF) Cenral Difference Kalman Filer (CDKF) and unknown Quadraic Kalman filer (QKF). Small financial DSGE model is repeaedly esimaed by maximum quasi likelihood mehods wih differen filers for daa generaed by he model. Errors of parameers esimaion are measure of filers qualiy. The resul is ha QKF has reasonable advanage in qualiy over CDKF and UKF wih some loose in speed. Keywords: DSGE; QKF; CDKF; UKF; quadraic approximaion; Kalman filering JEL classificaion: C3 C32 E32 Sergey Ivashchenko Sain Peersburg Sae Polyechnical Universiy Russia 9525 S. Peersburg Polyechnicheskaya 29; S. Ivashchenko 2
3 DSGE model esimaion on base of second order approximaion Sergey Ivashchenko Sain Peersburg Sae Polyechnical Universiy Russia 9525 S. Peersburg Polyechnicheskaya 29; Inroducion Esimaion of DSGE models is very imporan issue. Usage of DSGE models requires knowledge abou is behavior which depends on parameers values. There are differen economeric echniques for models esimaion bu empirical lieraure has concenraed is aenion on he esimaion of firs order linearized DSGE models (Tovar (28)). Compuaion wih linear approximaion is much faser han higher order approximaion bu is behavior could differ from he models behavior (see Collard and Juillard (2)). Second order approximaion makes difference beween models and approximaion behavior much smaller. Asse pricing is he issue where firs order approximaion isn applicable because i eliminaes all risk premiums (see Tovar (28)). Tha is why imporan o esimae DSGE models on base of second order (or higher) approximaion. Advanages of second order esimaion are known. The paricle filer is ool for likelihood funcion consrucion on base of nonlinear DSGE models approximaions (An and Schorfheide (26)). There are alernaive filers ha could be used for likelihood calculaion. For example Andreasen (28) has shown advanage of Cenral Difference Kalman Filer over few versions of paricle filer. 3
4 There are oher nonlinear modificaions of Kalman filer which could be used for DSGE models second order esimaion. A his aricle 3 versions are used: Cenral Difference Kalman Filer (CDKF see Norgaard Poulsen and Ravn (2)) Unscened Kalman filer (UKF see Julier and Uhlmann (997)) and Quadraic Kalman filer (QKF). QKF descripion wasn found a lieraure ha is why i would be described wihou references. The purpose of his aricle is o compare differen versions of second order DSGE models esimaion echnique. 2. Nonlinear Kalman filers 2. Generaliy Equaion () describes daa generaing process for sae variables (X ). Exogenous shocks (ε ) have normal disribuion wih covariance marix Ω ε and mean equal zero. Measuremen equaion (2) describes dependence of observed variables (Y ) on sae variables and measuremen errors (u ) which have normal disribuion wih zero mean and covariance marix Ω u. () X X HX ; CBX B X X X Axx Ax A X (2) Y DX u Iniializaion: (3) EX 4
5 (4) E X X All varians of nonlinear Kalman filers have he same iniializaion procedure. Mean and covariance marix of sae variables uncondiional disribuion are calculaed according o linear approximaion of (). Updaing: (5) DD D u Y D (6) u u I D D D D I D D D D Updaing sep is he same for all varians of nonlinear Kalman filers because measuremen equaion (2) is linear. I is similar wih Kalman filer (usual linear Kalman filer). Symbol θ (i would be used a following ex) denoes join vecor of sae variables and exogenous shocks wihou is mean (7): X X (7) E (8) E 2.2 Unscened Kalman filer (UKF) Predicion sep is differen across filers: VV (9) i nvi i n: i nvi i : n 5
6 Marix V is square roo of θ covariance (lengh of θ is n). Vecor V i is i h column of marix V. So θ i are ses of vecors around θ mean wih dispersion dependen on θ covariance. For normal disribuion parameers of UKF are α= 3 β=2 λ=α 2 (n+) n. () () Xi CBi Ai i X n i X i n2n n i (2) n Xi Xi in 2n i n 2 X X Thus UKF ses expeced sae variables value equal o he weighed sum of deerminisic generaed rajecories ( ). Covariance is se equal o weighed sum of deerminisic generaed rajecories divergence from expeced value (2). Full descripion of UKF could be found a Julier and Uhlmann (997). 2.3 Cenral Difference Kalman Filer (CDKF) Similarly o UKF θ i are ses of vecors around θ mean wih dispersion dependen on θ covariance. For normal disribuion parameer of CDKF is h 2 =3. 6
7 (3) i hvi i n: i hvi i : n (4) Xi CBi Ai i CDKF is based on approximaion (5) which is each dimension second order finie difference approximaion of funcion (): (5) X X X X... Xn X n 2h 2 X 2 X 2 X... Xn X n 2X 2h ˆ ˆ 2 X B A 2 2h 2h I should be noed ha second order approximaion includes componen (6): 8h n n (6) 2 Xi X i j i X j X j where i i j ji is i h elemen of vecor θ and 2 2 is vecor of i bu is expeced value is zero and is influence on covariance of X depends on hird and fourh momens of θ disribuion. (7) n X 2 Xi X i 2X 2h i n 2 X i h n 2 2 X in2h h i 7
8 (8) 2 ˆˆ h ˆˆ BB AA 2 2 4h 4h Mean and covariance are se according o (7) (8). Full descripion of CDKF could be found a Norgaard Poulsen and Ravn (2). 2.4 Quadraic Kalman filer (QKF) The firs sep of QKF is ransformaion of () ino (9) which is dependence of sae variables X on vecor θ. X CB A CB A (9) B A In In A C B A Afer ha expeced value of X could be find easily. Formula (2) shows resul which is based on zero expeced value of θ. (2) C Avec The las sep is calculaion of X covariance marix. The formula (2) expresses rue value of X covariance marix if vecor θ has normal disribuion. I is based on following properies of normal disribuion: hird order cenral momens is zero fourh order cenral momens is funcion of covariance marix (22). 8
9 (2) (22) E A E A E B Bvec A Avec vecvec vec E X X E B B vec vec( ) E vec vec vec I should be noed ha rue disribuion of θ is differ from normal (even if ε is normal disribued) because funcion (9) isn linear. Even if θ is normal hen disribuion of X and θ + wouldn be normal. I means ha QKF is approximaion for calculaion of condiional momens (as UKF and CDKF). The qualiy of QKF CDKF and UKF would be compared by maximum quasi likelihood esimaion of small DSGE model. 3. DSGE model Finance is one of areas where DSGE models linear approximaion is unsuiable. Tha is why finance model is used for comparison of differen Kalman filers. Householders maximize expeced uiliy funcion (23) wih budge consrain (24). Budge consrain alks ha householders spen money for consumpion (C ) wih exogenous price (Z P ) bonds (B ) and socks (X ) which price is S. Sources of money are exogenous income bonds and socks bough in previous period. (23) E C max CBX ; ; (24) Z C B X S R B X S D S Z P I 9
10 The model suggess ha dividend growh is exogenous (25) bond amoun is se by governmen exogenous (26) amoun of socks is equal o (27). D (25) Z D D (26) B ZB S (27) X The model (23) (27) is ransformed o (28) (32) where sable variables are used. Table shows dependence beween iniial and sable variables. (28) E ( si zp i) i e e c max cbx ; ; (29) c r s d e b x e b x e z I (3) d d s zd (3) b zb (32) x TABLE DSGE model variables Variable Descripion Saionary variable value of bonds bough by householders a B b B / S period c ln Z C / S C consumpion a ime P D dividends a ime d ln D / S R ineres rae a ime r ln R S price of socks a ime ln / s S S
11 Variable Descripion Saionary variable X amoun of socks bough by householders a x X period Λ Lagrange muliplier corresponding o budge resricion of householders a period exogenous process corresponding o nearraionaliy of householders wih is bond zab Z AB ZAB posiion exogenous process corresponding o nearraionaliy of householders wih is zac Z AC ZAC consumpion exogenous process corresponding o nearraionaliy of householders wih is socks zac Z AS ZAC posiion Z B exogenous process corresponding o bond amoun sell by governmen zb ZB Z D exogenous process corresponding o dividends growh zd ZD Z I exogenous process corresponding o householders income zt ZT Z P exogenous process corresponding o price zp ln ZP ZP level The opimal condiions of (28) (29) problems wih addiional exogenous process (z AS z AB z AC ) are following: (33) (34) s z d za S ln( ) P e Ee e z ln( ) e Ee A B r s s zp (35) c c za C Addiional exogenous process could be inerpreed as near raional householders (his processes have zero mean). Anoher inerpreaion is compensaion of approximaion errors (his processes allows o use linear approximaion for parameer esimaion). All exogenous processes are AR() wih following parameerizaion: (36) z* * ( * ) * z* *
12 The model parameers are esimaed by maximum quasi likelihood wih QKF mehod. The monhly daa (Average rae on monh cerificaes of deposi MSCI USA price reurn MSCI USA gross reurn) from December 969 ill December 2 are used. The esimaed values are used for observaions generaing by he model. 4. Resuls The following procedure is used for comparison of differen Kalman filers:. Generaion of 4 observaions from second order approximaion of model. 2. Parameers esimaion by quasi maximum likelihood mehod based on second order approximaion wih differen Kalman filers (QKF CDKF UKF). The rue values of parameers are used as iniial one. 3. Parameers esimaion by quasi maximum likelihood mehod based on firs order approximaion. The rue values of parameers are used as iniial one. 4. Repeaing imes of seps 3 Resuls presened a able 2. Firs order approximaion produces he wors qualiy of parameers esimaors. Only esimaion of ε AC sandard deviaion is beer han for second order approximaion. Trace of esimaor errors is 32% 38% higher han for UKF and CDKF. Bu line approximaion is much faser han quadraic (ime for likelihood calculaion is 49.5 imes smaller han for UKF and CDKF). These resuls are expecable. They are showed as benchmark for quadraic approximaions. I should be noed 2
13 ha dynare is used for line approximaion. Self made code on base of dynare is used for second order approximaion. I means ha line code is efficien and code for second order could be opimized. TABLE 2 Resuls of filers comparison. RMSE QKF UKF CDKF Line s. dev. ε AB 2.9* * * * 5 s. dev. ε AC 6.76* * * * 3 s. dev. ε AS 3.9* * * 4.34* 3 s. dev. ε B.3* 2.9* 2.9* * s. dev. ε D.9* 3 2.5* * * 3 s. dev. ε I 4.52* 3 8.4* 2 7.2* 2 4.2* + s. dev. ε P 2.73* * 4 2.* 4 8.3* 4 ln(β) 3.4* * * * 4 γ.46* * 3 2.4* 3.36* 2 η B 4.9* + 7.6* * * + η D.74* 4.23* 4.6* * 4 η I 4.37* + 4.8* * * + η P 6.8* * 5 7.7* * 4 η AB.3* 2.* 2.7* 2.2* 2 η AC 8.45* * 3.3*.* 3 η AS.58* 2.25* 2.* 2 4.* 2 η B 6.53* 8.6* 8.92* 7.4* η D 2.32* 2.39* 2.3* 3.58* η I 7.98* 9.3* 9.3*.5* + η P 8.88* 9.99*.8* * Trace of parameers esimaors covariance marix 2.6* * * + 6.6* + Trace of square parameers esimaors marix (sum of MSE) 3.77* * + 8.2* +.5* +2 Time for likelihood calculaion(sec)* Number of parameers were QKF is beer *PC used: Inel core 2 Duo E84 3 GHz Gb RAM Windows XP. 3
14 The main resul is ha QKF is slower bu beer hen CDKF and UKF. The loose in speed is 28%. The gain in qualiy (race) is 7% 78%. Why does i happen? QKF uses analyical formulas for mean and variance calculaion while CDKF and UKF use approximaion. Approximaion is less accurae han analyical formulas. CDKF and UKF require many calculaion of funcion () while QKF require smaller number of more complicaed funcions calculaions. Wha are disadvanages of QKF? QKF is based on normaliy of variable disribuion. If disribuion of shocks or variables would be far from normal QKF performance would be worse. CDKF and UKF could be modified for non normaliy easily. Bu usual DSGE model uses normal disribuion for shocks and is variables are close o normal disribuion. Anoher disadvanage of QKF is ha QKF is based on second order approximaion. CDKF and UKF could be used for quasi likelihood calculaions wih higher order approximaion. 5. Conclusion This aricle describes hree nonlinear Kalman filers. Those performances are compared on small financial DSGE model. Well known CDKF and UKF qualiy is similar (32% 38% smaller errors bu 49.5 imes slower hen linear approximaion). QKF performance is even beer (36% smaller errors and 69 imes slower hen linear approximaion). The gain of QKF over CDKF and UKF (7% 78% in qualiy wih 28% loose in speed and) is resul of specializaion for common DSGE models (normal shocks and second order approximaion). 4
15 References An S. and F. Schorfheide (26): Bayesian analysis of DSGE models Working Papers from Federal Reserve Bank of Philadelphia No 6 5 Andreasen M. M. (28): Non Linear DSGE Models he Cenral Difference Kalman Filer and he Mean Shifed Paricle Filer CREATES Research Paper Available a SSRN: hp://ssrn.com/absrac=4879 Collard F.and M. Juillard (2): Accuracy of sochasic perurbaion mehods: The case of asse pricing models Journal of Economic Dynamics and Conrol 25 (6 7) Julier S. J. and J. K. Uhlmann (997): A new exension of he Kalman filer o nonlinear sysems in Proc. AeroSense: h In. Symp. Aerospace/Defense Sensing Simulaion and Conrols pp Norgaard M. N. K. Poulsen and O. Ravn (2): New developmens in sae esimaion for nonlinear sysems Auomaica 36 () Tovar C. E. (28): DSGE models and cenral banks BIS Working Papers from Bank for Inernaional Selemens. No
16 Иващенко C.М. Оценка модели DSGE на основе приближения второго порядка. СПб. : Европейский университет в Санкт Петербурге 2. 6 с. (Серия препринтов; факультет экономики; Ec 7/). На английском языке. Отпечатано с оригинал макета предоставленного авторами Подписано в печать Формат 6x88 /6. Тираж 5 экз. Факультет экономики Европейский университет в Санкт Петербурге 987 Санкт Петербург ул. Гагаринская д. 3 hp://