Schmitt-Grohe and Uribe 2004b replicate in dynare

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Schmitt-Grohe and Uribe 2004b replicate in dynare

Postby St_aueb » Tue Dec 03, 2013 10:10 pm

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
Attachments
SGU_neoclassical2.mod
(695 Bytes) Downloaded 230 times
St_aueb
 
Posts: 12
Joined: Sat Nov 03, 2012 11:07 am

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

Postby StephaneAdjemian » Thu Dec 05, 2013 11:07 am

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.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

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

Postby St_aueb » Thu Dec 05, 2013 11:55 pm

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
Attachments
Appendix_Pruning.pdf
(601.52 KiB) Downloaded 308 times
St_aueb
 
Posts: 12
Joined: Sat Nov 03, 2012 11:07 am

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

Postby jpfeifer » Fri Dec 06, 2013 8:12 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

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

Postby St_aueb » Sat Dec 07, 2013 2:00 am

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.
St_aueb
 
Posts: 12
Joined: Sat Nov 03, 2012 11:07 am

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

Postby jpfeifer » Sat Dec 07, 2013 12:34 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

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

Postby J.Höffler » Sat Aug 02, 2014 3:51 am

If you are interested in replication this might be of interest to you: viewtopic.php?f=2&t=5926
J.Höffler
 
Posts: 15
Joined: Fri Aug 01, 2014 3:14 pm

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

Postby hscbsc » Tue May 24, 2016 1:27 am

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.
hscbsc
 
Posts: 25
Joined: Mon Jan 11, 2016 5:35 am

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

Postby jpfeifer » Sat May 28, 2016 8:30 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

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

Postby hscbsc » Thu Jun 02, 2016 8:16 pm

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.
Attachments
compare.pdf
(15.17 KiB) Downloaded 159 times
SGU2004_4.mod
(3.14 KiB) Downloaded 150 times
Grohe4.zip
(11.25 KiB) Downloaded 156 times
Andreasen2016.pdf
(1014.15 KiB) Downloaded 135 times
hscbsc
 
Posts: 25
Joined: Mon Jan 11, 2016 5:35 am

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

Postby jpfeifer » Wed Jun 08, 2016 5:30 pm

Why did you introduce a new state variable in the SGU code?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

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

Postby hscbsc » Fri Jun 10, 2016 1:13 pm

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.
hscbsc
 
Posts: 25
Joined: Mon Jan 11, 2016 5:35 am

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

Postby hmz » Thu Jun 16, 2016 12:25 pm

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
Attachments
neoclassical_model_ss.m
(1.14 KiB) Downloaded 132 times
neoclassical_model_run.m
(1.89 KiB) Downloaded 133 times
neoclassical_model.m
(1.76 KiB) Downloaded 112 times
sgu_mod.mod
mod-file
(801 Bytes) Downloaded 151 times
hmz
 
Posts: 3
Joined: Wed Jun 15, 2016 6:52 pm

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

Postby hmz » Mon Jun 20, 2016 6:05 pm

Has no one an idea?
hmz
 
Posts: 3
Joined: Wed Jun 15, 2016 6:52 pm

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

Postby hscbsc » Fri Jun 24, 2016 3:04 am

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.
hscbsc
 
Posts: 25
Joined: Mon Jan 11, 2016 5:35 am

Next

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests