Hi, anyone has idea why while the mod file could compute simulated moments but cannot produce impulse response functions? All numbers recorded in IRF, e.g, variable_shock, are NaN.

Here is the mod file, a simple OLG neoclassical growth model. gammaNotOne.mod (1.47 KB)

Thank you.
It does work if order=1. What is the reason?
If I simply change the risk aversion parameter gamma to 1 and accordingly modify the Euler equation slightly, the mod produces IRF even order=2. Why if gamma=2 the IRF are NaN?
Thanks. gammaIsOne.mod (1.54 KB)

Without pruning the simulations used for generating the IRFs might be explosive. See the spawning literature on pruning starting with Kim, Kim, Schaumburg, Sims

if I have explosive IRFs and NaN in the moments without enabling pruning, does it mean that my model is wrong or there is a problem ?

If all seems ok at order 1 but I obtain explosive IRFs and NaN in the moments at order 2 and 3 (without enabling pruning option), does it mean that my model is wrong or there is a problem ?
Thank you for your answer
Best,
Jonathan

Explosive simulations without pruning don’t tell you anything about your model. It is just a problem with the solution technique used to solve your model. Just read the first two pages of Den Haan/De Wind (2012): “Nonlinear and stable perturbation-based approximations”.
If first order looks ok and only at second order problems appear, this simply suggests problem with pruning