Im currently working on the methodology chapter of my PhD thesis. The aim is to demonstrate how to build, solve, estimate a small new Keynesian DSGE model analytically. I have a question about casting solved DSGE model into state space form. Here is my code for a three equation model:
Code: Select all
calendar(Q) 1948:4
dec series y pi a
dec series eps_a eps_r
dec real beta theta sigmaL alpha rho_a kappa_pi kappa_y xi_y xi_a
compute beta = 0.98
compute theta = 0.65
compute sigmaL = 1
compute alpha = 0.4
compute rho_a = 0.9
compute kappa_pi = 1.2
compute kappa_y = 1.5
compute xi_y = ((1-beta*theta)*(1-theta)*alpha/(theta*(sigmaL + alpha)))
compute xi_a = ((1-beta*theta)*(1-theta)*sigmaL/(theta*(sigmaL + alpha)))
frml(identity) eqn1 = y - ( y{-1} - kappa_pi*pi - kappa_y*y - eps_r)
frml(identity) eqn2 = pi - ( beta*pi{-1} + xi_y*y + xi_a*a)
frml(identity) eqn3 = a - ( rho_a*a{1} + eps_a)
frml eqn4 = eps_a
frml eqn5 = eps_r
group Mech_chap eqn1 eqn2 eqn3 eqn4 eqn5
dsge(model=Mech_chap,a=adlm,f=fdlm,z=zdlm) y pi a eps_a eps_r
display adlm
display fdlm
display zdlm
X = A*X(1) + Z + F*w
I went through the Rats state space course, and it seems that Rats treats all variables in X as states, and map to data according to
Y = mu+ C*X +v
(chapter 12: estimation of the handbook for state space models), where C seems to be an identity matrix and apply Kalman filter to update the state variables.
All along I thought that the way to estimate a solved DSGE model is to decompose X into observable variables (that we have data, in my case is output gap and inflation) and unobservable variables(in my model is the technology). Then apply kalman filter to use information of output gap and inflation to update only the technology. I have two shocks and two series of data, so I should not have stochastic singularity problem.
The way that Rats does it seems to introduce measurement errors, but would it be the case that introduction of measurement error is to get rid of the stochastic singularity problem? Since Im not very experienced with state space models, I probably miss some obvious point...
Thank you very much for your kind help.
Cheers
Ben