steady state contains NAN or Inf

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.

steady state contains NAN or Inf

Postby shartjen » Wed Dec 03, 2014 1:24 pm

Hi,

I am on my first project with dynare. I have modified the Smets and Wouters (2007) model (SW07) with endogenous growth. My code seemed to work fine but now I want to add a variable to measure persistent effects on output and end up getting the Error: "The steady state contains NaN or Inf." when trying to go for stoch_simul. I could narrow down the problem to two lines of code:

Code: Select all
dy=y-y(-1)+gamma(-1)+ctrend;
YL =  y-y(-1) + YL(-1); //+gamma(-1);


The dy is the measurement equation from SW07 for later estimation. The YL is the persistent effect I want to measure. Later I would add gamma(-1) to measure the cumulative effect in from gamma. But to make sure it is not the errors cause I commented it out and leave only the first part which should just equal YL = y in a complicated way. When I leave either line out the code works. If both lines are in I get the error.
I put in resid(1) to check and the dy-equation was not zero but equalled ctrend, which never was a problem before.
Why do these two lines interfere? Thanx for any help.

P.S.:
When making YL a trending variable with a deflator very close to one the problem disappears.
Code: Select all
trend_var (growth_factor = cgamma^0.001) TFP;
var (deflator=TFP) YL;

cgamma = 1.0043
Attachments
US_SW07_EndG.mod
(9.99 KiB) Downloaded 45 times
shartjen
 
Posts: 2
Joined: Wed Dec 03, 2014 10:19 am

Re: steady state contains NAN or Inf

Postby shartjen » Thu Dec 04, 2014 9:28 am

Someone else was already able to help me. Setting initival Values did the job, though I still dont really know why.

Code: Select all
initval;
dy=ctrend;
end;


As ctrend is trend-growth in this model and thus the intercept of the otherwise stationary variable dy.
shartjen
 
Posts: 2
Joined: Wed Dec 03, 2014 10:19 am

Re: steady state contains NAN or Inf

Postby jpfeifer » Sat Dec 06, 2014 4:05 pm

Unless you provide initial values in the initval block, Dynare takes them to be 0. But dy does not have a steady state of 0, but of the steady state growth rate ctrend. Hence, you should provide this value as the initial value.
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests