Page 1 of 1

IRFs are NaN

PostPosted: Sun May 05, 2013 8:55 am
by David
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.

Re: IRFs are NaN

PostPosted: Sun May 05, 2013 9:02 am
by jpfeifer
Try putting order=1 or pruning into stoch_simul

Re: IRFs are NaN

PostPosted: Sun May 05, 2013 9:22 am
by David
jpfeifer wrote:Try putting order=1 or pruning into stoch_simul

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.

Re: IRFs are NaN

PostPosted: Sun May 05, 2013 9:34 am
by David
I spot some errors in the mod file. The consumption variable should be forward-looking in the Euler equation.

Re: IRFs are NaN

PostPosted: Sun May 05, 2013 9:48 am
by jpfeifer
Without pruning the simulations used for generating the IRFs might be explosive. See the spawning literature on pruning starting with Kim, Kim, Schaumburg, Sims

Re: IRFs are NaN

PostPosted: Wed Mar 19, 2014 8:27 am
by jonathanb
Hi Johannes,
- 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

Re: IRFs are NaN

PostPosted: Wed Mar 19, 2014 9:00 am
by jpfeifer
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

Re: IRFs are NaN

PostPosted: Wed Mar 19, 2014 9:23 am
by jonathanb
Thank you Johannes.