IRFs are NaN

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

IRFs are NaN

Postby David » Sun May 05, 2013 8:55 am

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.
Attachments
gammaNotOne.mod
(1.47 KiB) Downloaded 108 times
David
 
Posts: 24
Joined: Fri Sep 28, 2012 3:46 pm

Re: IRFs are NaN

Postby jpfeifer » Sun May 05, 2013 9:02 am

Try putting order=1 or pruning into stoch_simul
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: IRFs are NaN

Postby David » Sun May 05, 2013 9:22 am

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.
Attachments
gammaIsOne.mod
(1.54 KiB) Downloaded 109 times
David
 
Posts: 24
Joined: Fri Sep 28, 2012 3:46 pm

Re: IRFs are NaN

Postby David » Sun May 05, 2013 9:34 am

I spot some errors in the mod file. The consumption variable should be forward-looking in the Euler equation.
David
 
Posts: 24
Joined: Fri Sep 28, 2012 3:46 pm

Re: IRFs are NaN

Postby jpfeifer » Sun May 05, 2013 9:48 am

Without pruning the simulations used for generating the IRFs might be explosive. See the spawning literature on pruning starting with Kim, Kim, Schaumburg, Sims
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: IRFs are NaN

Postby jonathanb » Wed Mar 19, 2014 8:27 am

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
jonathanb
 
Posts: 54
Joined: Wed Sep 17, 2008 8:52 pm
Location: New York

Re: IRFs are NaN

Postby jpfeifer » Wed Mar 19, 2014 9:00 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: IRFs are NaN

Postby jonathanb » Wed Mar 19, 2014 9:23 am

Thank you Johannes.
jonathanb
 
Posts: 54
Joined: Wed Sep 17, 2008 8:52 pm
Location: New York


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests