Dynare running despite large SS residuals

Hi There,

I was a little bit surprised by the fact that dynare was running (and not giving any warnings) even though the steady_state_model; generated non-zero residuals (of the order of magnitude of 5…). The resid command caused the code to stop; but I didn’t have it there initially, so was oblivious to the underlying issues…

This may be standard functionality, or it may not - in which case I thought I’d bring it to your attention.

So here’s the scenario (not sure if any of this is relevant, so listing everything I think may be):

  1. All parameter values and some steady state values (which are included as parameters) are in an external .mat file called SS_VALS; (generated outside of dynare).
  2. They are loaded using the load SS_VALS; command and then parameters are assigned values using a sequence of set_param_value(‘alph’ ,alph) commands.
  3. The model; block and the steady_state_model; blocks are pretty standard except that some steady state values of variables are set equal to the parameters (loaded in 2.)
  4. I was running the model using the stoch_simul(periods = 223800, order = 1, irf=0, nograph, noprint) GDP LOG_PI DEF SPR; and was getting simulation results without the code squeaking out a warning…
  5. When I added the resid; command before stoch_simul I got a steadystate file did not compute the steady state error, which I would have thought I should have been getting all along… Same thing happens when I tweak the *stoch_simul * command to stoch_simul(order = 1, irf=0, nograph) GDP LOG_PI DEF SPR; - i.e. this DOES throw the SS error… So I guess it looks like it’s something to do with the periods option being invoked, perhaps?

Thoughts welcome - happy to send over the code, but would rather not post it on the forum as it’s partially someone else’s intellectual property, and I was asked not to distribute it more widely (shouldn’t be too difficult to replicate, though?).

Thanks in advance for looking into this (and now I need to fix the SS file, I think…).

Did you use the unstable version? Please provide me with the files.

Hi Johannes,

Thanks for your email. I’m on version 4.4.3. I’ve tried sending you the working example as a .zip file via PM - let me know if it doesn’t work…

As mentioned in my message, having looked into this a bit closer, this may be less problematic than I initially thought, as even though stoch_simul doesn’t crash, oo_.endo_simul ends up empty and the variables containing simulation paths are not created. So it would have been really easy to spot that something’s wrong and there was no danger of ending with some bogus simulated paths…

Anyway, hope this helps, and please let me know if you have trouble recreating the behavior I described.

Thanks for your help,

This is actually desired behavior. You use the

option, which suppresses all error messages. It is intended for use in loops. Dynare does still not accept the incorrect steady state, but does not complain about it. Instead, it simply returns without any computations.

Thanks a lot for this - very helpful!

This is something I didn’t know and explains why my code had been so surprisingly ‘robust’… I.e. I was running things in loops and while the SS part of the code was failing to converge at times, I never saw red from dynare. Now I know why, and also which parts of the code I need to double-check!