Page 1 of 2

Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Tue Dec 03, 2013 10:10 pm
by St_aueb
Hi all

I am trying to replicate the standard growth model as in SGU 2004b. (http://www.columbia.edu/~mu2166/2nd_order/2nd_order.pdf)
However when I am writing my dynare code, although I can replicate exactly the steady state values as they appear in the paper, (−0.8734, −1.7932, 0) I cannot get the same values for the the coefficients of the linear terms gx, hx or the coeefficients of the quadratic terms gxx, hxx etc. (i get values only for some coefficients)

Apparently I am writing something in the wrong way which I cannot figure out. I attach the mod file
I would appreciate any help.
Stelios

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Thu Dec 05, 2013 11:07 am
by StephaneAdjemian
Hi,

If I remember correctly, SGU do not use the same representation of the reduced form model. Dynare, as you can see in the reported results for the policy rules and transition equations, expresses the control as a function of the endogenous state variable (time t-1), the exogenous states at time t-1 and the innovations at time t, while SGU writes the control variables as a function of the endogenous states and the exogenous states at time t. For instance, for consumption in an RBC model, Dynare reduced form is something like:

c_t = a0 + a1*k_{t-1} + a2*a_{t-1} + a3*e_t

while SGU reduced form looks like (also note that they do not use the same timing convention for the endogenous states but this is irrelevant wrt your question):

c_t = a0 + a1*k_{t} + b2*a_{t}

This may explain the differences you observe. You should compare the IRFs or asymptotic moments instead.

Best,
Stéphane.

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Thu Dec 05, 2013 11:55 pm
by St_aueb
Dear Stephane

Thanks a lot for the quick reply. I will test your suggestion

Indeed the state space representation of SGU differs from Dynare representation.
But I think there must be a way (meaning that if you right a proper dynare code) to replicate the results exactly.

For example in the Technical Appendix (see the attached p. 136) of Andreasen, Martin M., Jesús Fernández-Villaverde and Juan F. Rubio-Ramírez (2013): "The Pruned State-Space System for Non-Linear DSGE Models: Theory and Empirical Applications", the authors say that under the correct notation, one can implement exactly SGU in dynare.
Thanks again
Best
Stelios

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Fri Dec 06, 2013 8:12 am
by jpfeifer
You have a simple timing mistake in technology in the Euler equation. For a running replication file, see https://sites.google.com/site/pfeiferecon/dynare

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Sat Dec 07, 2013 2:00 am
by St_aueb
Thanks a lot.Problem solved!!
Stelios

p.s: Looking at you replication file, is there any reason you include an additional block with the steady state equations?? I haven't seen it before in other mod files or in any documentation.

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Sat Dec 07, 2013 12:34 pm
by jpfeifer
Defining a steady_state_model-block is more efficient than an initval-block if you know the analytical steady state. I try to use this whenever I can compute the steady state. Dynare 4.4 will even contain an example of this in the examples folder.

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Sat Aug 02, 2014 3:51 am
by J.Höffler
If you are interested in replication this might be of interest to you: viewtopic.php?f=2&t=5926

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Tue May 24, 2016 1:27 am
by hscbsc
Hi,

Though an old post, I have a problem in replication.

When using persistence of technology not equal to zero in Dynare , based on the replication file for Schmitt-Grohe available at https://sites.google.com/site/pfeiferecon/dynare - 'a' is also a state and we have additional terms in hx, gx, hxx and gxx. These terms are not there when replicating the matlab code from those authors. Is there any discrepancy in my implementation ? Is there any way I can reconcile these results.
Any help is appreciated.

Thanks.

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Sat May 28, 2016 8:30 am
by jpfeifer
I am not sure I understand your question. If you have persistence of a, you will be getting a lagged value for
Code: Select all
 a
that does not drop out of the model. This will add a state variable in Dynare. In SGU's notation, the exogenous processes are handled somewhat differently. Dynare allows more generic shock processes than the linear structure of SGU (2004)'s equation following equation (1).
Because Dynare reports decision rules somewhat differently the
Code: Select all
a(-1)
shows up.

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Thu Jun 02, 2016 8:16 pm
by hscbsc
Hi Johannes,

Thank you for the response. Let me give more details on the question. Thank you for confirming my doubts - there is a difference in SGU and dynare's notation.

To replicate SGU's paper with zero persistence, I use the replication file in your repository. The results are same as suggested by you earlier in this post.

However, if I want to use nonzero persistence, I understand I have to modify the SGU's notation to get a dynare equivalent notation. I follow the advise in the Technical Appendix (pg. 138) of Andreasen, Martin M., Jesús Fernández-Villaverde and Juan F. Rubio-Ramírez (2015): "The Pruned State-Space System for Non-Linear DSGE Models: Theory and Empirical Applications". I am attaching the dynare code I am using (this is referred from the replication code and just the persistence is changed) and also the modification I did in SGU's model file based on the suggestion in the Appendix.
As you can see in compare.csv, the decision rules are different.

I just want to confirm if what I did is incorrect or I have to modify the decomposition code or this is how it is supposed to be and I should compare simulated results.

Thank you again.

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Wed Jun 08, 2016 5:30 pm
by jpfeifer
Why did you introduce a new state variable in the SGU code?

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Fri Jun 10, 2016 1:13 pm
by hscbsc
Dear Johannes,

Thank you for your response, about adding the state variable. You may ignore my question.
I have been able to match the simulated series and understand more clearly the way state variables enter in Dynare and SGU notations.

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Thu Jun 16, 2016 12:25 pm
by hmz
Hi,

I have implemented a slightly modified version of SGU04. To compare the results, I also implemented the model in dynare. All the coefficients are identical except for the ones wich are bold below.

SGU Output:
gxx(:,:,3) =
-0.0109 -0.0876 -0.0880
hxx(:,:,3) =
0.1434 0.0876 0.0880

Dynare Output: c k
epsilon ,epsilon 0.059474 0.724165.

Can someone explain me why these coefficients on A^2 (or epsilon^2 in dynare) do not match?

Thanks,

Hamza

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Mon Jun 20, 2016 6:05 pm
by hmz
Has no one an idea?

Re: Schmitt-Grohe and Uribe 2004b replicate in dynare

PostPosted: Fri Jun 24, 2016 3:04 am
by hscbsc
Hi Hmz,

From my experience it is a better idea to compare the simulated series and not the decision rule.
As we take persistence as non zero (which is not the case in SGU, they take rho=0), the decision rules will be different.

If you look closely the solution method is different for SGU (they explicitly differ in state and control variables) and Dynare doesn't. This leads to difference in decision rules (if I am correct mainly for epsilon and da).

In my problem, I extended my matlab program and compared the simulated series (non-pruned) and they matched.

Hope this helps.