I am trying to replicate the standard growth model as in SGU 2004b. (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 SGU_neoclassical2.mod (695 Bytes)

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 + a1k_{t-1} + a2a_{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 + a1k_{t} + b2a_{t}

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

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 Appendix_Pruning.pdf (602 KB)

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.

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.

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 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.

I am not sure I understand your question. If you have persistence of a, you will be getting a lagged value for 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 a(-1) shows up.

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 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.

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.

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.