I’m a new Dynare user and would appreciate your advice regarding the replication of Gali et al (2007): Understanding the Effects of Government Spending on Consumption, i.e. a two-agent NK model (link: http://crei.cat/wp-content/uploads/2016/07/glv07jeea.pdf).
As per the attached mod-file, the model is up and running, but the response of consumption (!) as well as wages is clearly incorrect. The reason, I presume, is that the steady state shares of consumption and investment in output are messed up, despite following the specification provided in the paper. I wonder whether I’m missing something in terms of how this ought to be specified in the Dynare environment (e.g. relating to the steady-command or similar)? I’d appreciate any help you are able to provide.
The file should hopefully be relatively easy to read, as variables and parameters are described, and the model is summarised in the latex files generated upon running.
Thank you very much in advance!
Lukas
P.s.: Perhaps the code (once fixed) is useful to other people as well – if so, all the better.
edit: Equation (36) in the paper, the linearised market clearing condition, also appears to be missing a ‘gamma_g’ in front of ‘g’?!
edit2: I believe there is a typo in the paper and it should read
gamma_c=1-gamma_g-((deltaalp)/((rho+delta)(mu_p+1)));
where the ‘+1’ is missing in the paper. However, while the resulting SS shares are sensible, the BK condition isn’t satisfied.
I am planning to replicate Gali et al. (2007) myself and was glad to have found your mod file today. I looked at it and agree, the problem is related to gamma_g, which actually evaluates to a negative value in the current parametrization (which you correctly took from Gali et al.). But a negative value for gamma_c (which denotes the share of consumption in the overall GDP) does not make sense.
Now, as you already identified, the equation in Appendix B for gamma_c is flawed. In particular, the identity R^k = alpha Y / (mu_p K) seems to be wrong. Did you find this also as in your edit2 you have a new equation for gamma_c? How did you reach that new equation?
By the way, for lambda=0.85 and mu_p +1 I obtain satisfied BK conditions and a positive response of C to G-shock.
I have replicated both the linear and nonlinear version of the model and am currently in the process of making them publishable. I will hopefully soon be able to upload them.
there’s a typo in the formula for gamma_c (in the 2007 paper), but this may easily be rectified as per my edit2
the market clearing condition: It’s not entirely clear from the paper, but I suspect the equation is actually correct as it stands; it’s a question of how G is defined (specifically, in the market clearing equation it is probably not in logs.
For reference, I attach the latest version of my code and the associated model description.
I also think this is a typo (or at least unclarity with respect to the definition of mu_p), the +1 needs to enter the formula for gamma_c
Market clearing condition: While c_t and i_t are defined as x_t = log (X_t / X) which is approximately (X_T - X) / X, g_t is defined as (G_t - G)/Y -> so it is expressed relative to Y instead of G, which makes the gamma_C drop out in the formula. The definition for g_t is given right below equation 19 in the paper. (https://www3.nd.edu/~esims1/log_linearization_sp12.pdf provides an expample of log-linearizing the market clearing condition. )
@jpfeifer That would be very useful! I am looking forward to your upload
Again to point 1: I realized after doing the derivations, the +1 can also (in the formula of gamma_c) be left out if one interprets the markup of 20% as a value of mu_p = 1.2. However, the same applies to the derivations of Gamma, sigma, Theta_n, and Theta_t. Also here you either have to replace mu_p with mu_p + 1 or define mu_p = 1.2 in the first place. When doing this, the results look much closer to Gali 2007. See attached mod file.
The results are not identical, though. For example, consumption begins to rise at impact only for lambda > 0.70 instead of lambda > 0.6 in Gali et al. 2007