can't solve the code's problem

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.

can't solve the code's problem

Postby clara » Fri Oct 17, 2014 3:20 pm

Hi! I'm trying to replicate Gertler, Sala and Trigari paper. The model is already linear in the paper. I can't understand how to solve the problem to run codes correctly.
the message in dynare:
STEADY: numerical initial values or parameters incompatible with the following equations
2 7 13 17 19 21 22 23 24 26 29 38
Check whether your model in truly linear


Residuals of the static equations:

Equation number 1 : NaN
Equation number 2 : NaN
Equation number 3 : 0
Equation number 4 : NaN
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : NaN
Equation number 8 : NaN
Equation number 9 : NaN
Equation number 10 : NaN
Equation number 11 : NaN
Equation number 12 : NaN
Equation number 13 : NaN
Equation number 14 : 0
Equation number 15 : NaN
Equation number 16 : NaN
Equation number 17 : NaN
Equation number 18 : NaN
Equation number 19 : NaN
Equation number 20 : NaN
Equation number 21 : NaN
Equation number 22 : NaN
Equation number 23 : NaN
Equation number 24 : NaN
Equation number 25 : 0
Equation number 26 : NaN
Equation number 27 : 0
Equation number 28 : NaN
Equation number 29 : NaN
Equation number 30 : 0
Equation number 31 : NaN
Equation number 32 : 0
Equation number 33 : 0
Equation number 34 : 0
Equation number 35 : 0
Equation number 36 : 0
Equation number 37 : NaN
Equation number 38 : -Inf


??? Error using ==> print_info at 80
The steady state contains NaN or Inf

Error in ==> steady at 92
print_info(info,options_.noprint, options_);

Error in ==> trigari at 580
steady;

Error in ==> dynare at 180
evalin('base',fname) ;

>>
Thank you !
Attachments
trigari.mod
(4.89 KiB) Downloaded 61 times
clara
 
Posts: 31
Joined: Thu Jul 24, 2014 4:13 pm

Re: can't solve the code's problem

Postby jpfeifer » Fri Oct 17, 2014 6:49 pm

------------
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: can't solve the code's problem

Postby stsp » Sat Oct 18, 2014 6:59 am

The 'initval' block is missing in your code. I don't know what the code will try to do then, but you should specify the initial values of at least some variables. So for example:

initval;
k_hat = ...
y_hat = ....

end;

I think you have to put this block between 'model' and 'steady'. This block gives the initial values for the solver to find the steady state. You don't have to provide the initial values for all variables, but I guess the more the better.
stsp
 
Posts: 11
Joined: Wed Sep 24, 2014 8:00 am

Re: can't solve the code's problem

Postby jpfeifer » Sat Oct 18, 2014 1:43 pm

@stst We are talking about a linear model here. All initial values are typically 0. You do not need an initval block in this case. But you need to correctly initialize the parameters.
In case of the mod-file of this post, y_ss is not defined, but used to define parameters. This results in NaN.
------------
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 7 guests

cron