Having difficulty replicating Gertler, Sala Trigari (2008)'s IRFs

I am trying to replicate the IRFs of “An Estimated Monetary DSGE Model with Unemployment and Staggered Nominal Wage Bargaining” [https://onlinelibrary.wiley.com/doi/epdf/10.1111/j.1538-4616.2008.00180.x].

However when I use the posterior means of the authors’ results (page 22 of the above link) I get the error “Blanchard Kahn conditions are not satisfied: indeterminacy” and I am not sure why; when I run simulations using the prior mean values IRFs are produced so I’m confused as to what the issue is. I have attached the mod files for the code running the model with prior and posterior mean parameter values. (Also a few parameter values are seemingly unspecified in their paper and have had to be guessed).

Many thanks for any help,

mwk

GSTpriormeans.mod (9.0 KB)
GSTposteriormeans.mod (9.5 KB)

The mean over the posterior is not a single parameter set that may ever be encountered, so we do not know whether it must work. It is only a summary statistic. In contrast, the posterior mode should work.

Hi jpfeifer,

Thanks for your reply.

The authors’ paper - http://www.econ.nyu.edu/user/gertlerm/GSTaug26.pdf - only gives the posterior max and mean, does this mean the only way to retrieve the posterior mode values would be to get them from the authors themselves or run the same estimations as the authors to replicate their estimation results? From this point, what would you suggest the best way to correctly replicate their IRFs (e.g. Figure 4) would be?

Many thanks again,

mwk

What they call the max is actually the mode. Figure 4 cannot be replicated without estimating their model as it shows median IRFs, i.e. IRFs averaged over various parameter draws. You can only hope that the mode will give you something similar.

Ah okay that makes sense and going with a conversation I had with someone earlier helps clears things up.

Thanks very much!

Hmm returning to my first post with the GSTpriormeans mod file, I feel the results are slightly qualitatively wrong but I can’t pinpoint why. For example a productivity and investment-specific shock leads to i-hat and k-hat (investment and capital’s deviation from steady state) being negative and then reverting back, and so I’m wondering if there might be a timing error or something? I feel pretty certain my code correctly follows the loglinear model (found in the appendix) so I’m struggling to understand why I’m getting that response. Does anyone have any suggestions?

Many thanks

Something like this is very hard to debug. I would recommend checking all equations again, including the timing. Make use of Dynare’s LaTeX-capabilities for this. Do the same for the parameters. If the difference still persists, either the equations in the Appendix are wrong or the original authors did a mistake. Usually, I recommend working the nonlinear model, because it makes it easier to check the equations and the correctness/consistency of the steady states.

Thanks for the reply.

I am now trying to scour the code for anything out of place. One quick question, given the model is loglinear, shouldn’t all the theoretical moments of y_hat, c_hat etc. variables (i.e. percentage deviations from steady state) equal 0? Because currently this isn’t the case so is this suggestive some of the code of the model block is wrong?

Thanks again

At first order, the mean should be 0, but not the variances. At higher order, the mean also need not be 0.

Hmm I’m somehow producing non-zero theoretical moments. I thought capital timings could be an issue because the IRF of investment to shocks is odd, but playing around with capital timings didn’t really change anything.

I also found a peculiar inconsistency in the paper I’m following.

[Pages refer to https://onlinelibrary.wiley.com/doi/epdf/10.1111/j.1538-4616.2008.00180.x]

ξ is described as “the percent change in the firm’s price elasticity with respect to a 1% change in its relative price” (page 16).

ξ is calibrated as 10 (page 21).

However in the appendix of the loglinear model ξ is defined as ξ=(1−δ)/γ_z and is used basically as a weight in equation C9 (page 44).

Using their prior means (delta, appreciation, 0.0025 and gamma_z, growth, being 1.25) you get ξ=0.78.

Using that 0.78 value, the simulation doesn’t run. Setting ξ=10 the simulation does run, everything is fine, but the response of investment and capital is off.

Also playing around with the calibrated parameters, the model doesn’t run when gammaz (steady state growth rate) is less than 1.085 but does for higher values.

I’m running out of ideas as to what to try and configure, do any suggestions come to your mind?

GSTposteriorMAX.mod (9.4 KB)

Put resid before steady. You will see

Equation number 33 : -0.55
Equation number 34 : -0.55
Equation number 35 : 0
Equation number 36 : -0.55

That is because you have an unaccounted for constant term (1-rhoz)*gammaz in those equations.

Ah yeah thanks for point that out. I’ve just gone over the shock equations and straightened out my understanding and sorted them out. So in terms of running simulations everything works well, all residuals and theoretical moments are zero.

All the significant endogenous variables qualitatively match/make sense apart from investment. E.g. a shock to the real interest rate sends investment up, a positive investment-specific shock sends investment down (i.e. deviate below steady-state).

I’ve attached the mod file below if you had time to quickly look again. (The file name is slightly different because I changed slightly the structural parameters).

Again there’s still the odd ξ uncertainty and when using weights (between 0 and 1) in the “Physical Capital Dynamics (9)” equation, Dynare spits out “Blanchard Kahn conditions are not satisfied: indeterminacy”. But when I use say {5, -5} as the weights, the simulations work out fine (everything bar investment).

Are there any Dynare functions other than steady state results and residuals that could help identify where the problem is? I’ve poured over the code and find or change anything that makes the investment response sensible. Thanks again

GSTcalibUS2.mod (9.7 KB)

You need to be careful here. \xi seems to denote two different things here:

  1. The standard substitution elasticity between differentiated goods, showing up in the Phillips Curve (C.24). It should have a value like 10
  2. As an auxiliary term \xi=\frac{1-\delta}{\gamma_z} in the linearized law of motion for capital. Its value here immediately follows from the values on the RHS.

Hi, thanks for the reply.

Ok yeah I was confused about how ξ matched to two different things but that makes sense and is reassuring to know.

I have updated my mod file but:

I think there is something wrong with my equations about investment and/or timing. When I run the mod file below (I’ve updated parameter values) and model in the auxiliary term, I am told:

There are 14 eigenvalue(s) larger than 1 in modulus
for 15 forward-looking variable(s)

The rank condition ISN’T verified!

Blanchard Kahn conditions are not satisfied: indeterminacy

What’s odd though is if I set the weights on the law of motion of capital equation to 5 and -5 and run the model, wrong yes, I get the message:

There are 15 eigenvalue(s) larger than 1 in modulus
for 15 forward-looking variable(s)

The rank condition is verified.

and IRFs are produced.

I’m wondering if this information is useful to you and/or if you have any idea where the wrong timing is?

For reference the equations of the complete loglinear model I precisely follow (and I’ve checked the code equations many times) starts on page 43 here: https://onlinelibrary.wiley.com/doi/epdf/10.1111/j.1538-4616.2008.00180.x

Thanks again

GSTcalibUSprior2.mod (9.1 KB)

That should be because you are missing

predetermined_variables k_hat;

Hm even using that the resposnes are still off, thank you for the suggestions though.

Only the general advice: check all your equations and in particular all equations in the original paper. There might be a typo somewhere. But without the original code, it is often impossible to tell.