Page 1 of 2
Problem with steady state
Posted:
Fri Oct 10, 2014 8:48 am
by eta
Hi, running the attached mod.file results in the following errors:
Error using dynare_solve (line 60)
An element of the Jacobian is not finite or NaN
Error in evaluate_steady_state (line 66)
[ys,check] = dynare_solve([M.fname
'_static'],...
Error in steady_ (line 54)
[steady_state,params,info] =
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in steady (line 81)
[steady_state,M_.params,info] =
steady_(M_,options_,oo_);
Error in shock1 (line 154)
steady;
Error in dynare (line 180)
evalin('base',fname) ;
There is clearly a problem in computing the steady state. I only wrote the initial conditions for exogenous variables (deterministic setup). Do you have any suggestion to fix these problems ?
Thanks in advance.
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 9:00 am
by jpfeifer
STEADY: The Jacobian contains Inf or NaN. The problem arises from:
Derivative of Equation 1 with respect to Variable gdp (initial value of gdp: 0)
STEADY: The problem most often occurs, because a variable with
STEADY: exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY: and evaluating it at the steady state then results in a division by 0.
Put gdp=1 into initval.
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 9:05 am
by eta
New problems:
Error using print_info (line 74)
Impossible to find the steady state. Either the
model doesn't have a steady state, there are an
infinity of steady states, or the guess values
are too far from the solution
Error in steady (line 92)
print_info(info,options_.noprint, options_);
Error in shock1 (line 155)
steady;
Error in dynare (line 180)
evalin('base',fname) ;
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 9:11 am
by eta
I forgot to say that gdp_ss=1 is not the true value of gdp at the steady state. I have not yet computed the steady states, but putting gdp_ss=1 eliminates log(gdp). I wanted to check if the syntax was correct and then proceed to the computation of the steady states in a separate file.
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 9:19 am
by jpfeifer
But the new message is a problem you have to solve. Provide an analytical steady state of better starting values. Also, make sure your equations are correct.
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 12:37 pm
by eta
I'm not succeeding at finding the steady states. In the model, there are 7 equations in 7 variables but computing the deterministic steady states results in more equations than variables. How is it possible ? Is there anything else I can do to compute them?
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 12:40 pm
by eta
I meant more variables than equations.
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 1:55 pm
by jpfeifer
What do you mean? If the dynamic model has as many equations as unknowns, the same is true for the static model.
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 2:26 pm
by eta
I don't know what's wrong in the computations. The value of the exogenous variables z,d and eta is fixed. gdp_hat becomes equal to 0 at the steady state and simplifiyng I get one equation for gdp_ss as a function of h_ss and pi_ss, another equation for h_ss as a function of pi_ss and R_ss and another for R_ss as a function of pi_ss. So there is one equation missing, but I cannot find it!!
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 3:30 pm
by jpfeifer
You seem to be confusing something. gdp_ss is a parameter that is extraneous to your model and can not be endogenously determined.
Re: Problem with steady state
Posted:
Fri Oct 10, 2014 3:57 pm
by eta
Yes, I'm confusing something. I fixed gdp_ss equal to 1 before and that produced an error. You told me to put gdp=1 in initval and that resulted again in an error:
Error using print_info (line 74)
Impossible to find the steady state. Either the
model doesn't have a steady state, there are an
infinity of steady states, or the guess values
are too far from the solution
Should I compute the exact steady states, fixing gdp_ss to, say, 1 and then writing the values of pi, h and R in initval ?
Re: Problem with steady state
Posted:
Sat Oct 11, 2014 10:30 am
by eta
So, I computed the steady states with fsolve, putting an arbitrary value for gdp_ss. Then I wrote the obtained values in initval, but the problem of steady states persists.
Error using print_info (line 74)
Impossible to find the steady state. Either the
model doesn't have a steady state, there are an
infinity of steady states, or the guess values
are too far from the solution
Error in steady (line 92)
print_info(info,options_.noprint, options_);
Error in shock1 (line 158)
steady;
Error in dynare (line 180)
evalin('base',fname) ;
What should I do ?
Re: Problem with steady state
Posted:
Sat Oct 11, 2014 3:04 pm
by jpfeifer
You are the model builder. You need to sit down and think about what are the endogenous variables and what are parameters fixed outside of the model. Currently, you seem to be mixing the two. There is only one correct way. If you fix a value for gdp_ss and "compute the steady state with fsolve" and these values are not a steady state for Dynare, either your previous computations are wrong or the equations you entered into Dynare.
Re: Problem with steady state
Posted:
Sat Oct 11, 2014 3:54 pm
by eta
What do you mean exactly by "mixing the two"? If gdp_ss, as you said, cannot be endogenously determined I have to fix a value. Then I compute the steady states for the exogenous variables h, pi and R and write the obtained values in initval. Is this the correct procedure ?
Re: Problem with steady state
Posted:
Sat Oct 11, 2014 5:37 pm
by jpfeifer
I don't know your model, so I am mostly guessing here. But it seems you have a case where you moved from a non-linear model, where gdp is a variable endogenously determined to a linearized version where gdp_ss becomes a parameter (which typically depends on the other deep parameters of the model). In the process, the variable gdp is redefined.
If you are able to compute the steady state for all variables conditional on the parameters, including gdp_ss, you should write this analytical solution into a steady_state_model block. If you can only do this numerically, use the initval block. My comment about consistency of these values with the model equations stays the same.