Problem with SS, initval. incompatible with equations

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.

Problem with SS, initval. incompatible with equations

Postby Thesis101 » Wed Oct 23, 2013 8:27 am

Hi people,

After searching the internet and the forum for a couple of days I finally turn to your expert knowledge. Im stuck at the modelling process of my master thesis so any help will be greatly appreciated and good karma will come your way ;)

Its a trivial question, I know, but I get the error message that " numerical initial values or parameters incompatible with the following equations" but are unable to see the solution (mainly because of limited Dynare knowledge).

I've tried to solve my model by:
- Defining steady state parameters, not from initial values, but from non-linear equations
- Writing the dynamic equations governing the endogenous variables on non-linear form
- Dynare should then log-linearize the equations and find a steady state with all values equal to zero

When running the program I get the common error message that:
Numerical initial values or parameters incompatible with the following equations
And that I should try to solve the problem by - checking if if all parameters occurring in these equations are defined and/or that no division by an endogenous variable initialized to 0 occurs.

I can see from my output which equations are affected (since i get NaN), e.g.:

Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : NaN
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : -1.014
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : -1.014
Equation number 12 : 0
Equation number 13 : -0.01
Equation number 14 : NaN
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 : 0
Equation number 22 : NaN
Equation number 23 : 0
Equation number 24 : NaN
Equation number 25 : NaN
Equation number 26 : 0
Equation number 27 : 0
Equation number 28 : 0
Equation number 29 : 0
Equation number 30 : 0
Equation number 31 : 0
Equation number 32 : 0
Equation number 33 : 0


I've tried to eliminate the "NaN" by rewriting the effected equations such that there is no division by an endogenous variable (instead the variables are multiplied onto the expression). In most cases this makes the "NaN" disappear and a zero appear in its place.
However, I'm unsure how to interpret this solution:
- does it mean that instead of dividing my zero (which Dynare cant handle) I'm multiplying with zero and therefore the endogenous variable affected becomes zero?
- Or does a zero residual of the static equation mean that the deviation from steady state of the variable in question is zero, i.e. the equation is "correct"?

I have attached my code, I hope that someone can guide me as to how to proceed towards a functioning code - should I proceed with rewriting the equations or is this not a solution?

Thanks guys! :)
Attachments
Dynrev33.mod
Dynare code
(11.66 KiB) Downloaded 89 times
Thesis101
 
Posts: 2
Joined: Wed Oct 23, 2013 7:47 am

Re: Problem with SS, initval. incompatible with equations

Postby jpfeifer » Wed Oct 23, 2013 6:25 pm

Try using the recent snapshot, which provides more explicit messages. In your case
STEADY: The Jacobian contains Inf or NaN. The problem arises from:

STEADY: Derivative of Equation 17 with respect to Variable K_hat (initial value of K_hat: 0)
STEADY: Derivative of Equation 18 with respect to Variable K_hat (initial value of K_hat: 0)
STEADY: Derivative of Equation 19 with respect to Variable K_hat (initial value of K_hat: 0)
STEADY: Derivative of Equation 20 with respect to Variable K_hat (initial value of K_hat: 0)
STEADY: Derivative of Equation 18 with respect to Variable L (initial value of L: 0)
STEADY: Derivative of Equation 15 with respect to Variable q (initial value of q: 0)
STEADY: Derivative of Equation 16 with respect to Variable q (initial value of q: 0)
STEADY: Derivative of Equation 19 with respect to Variable q (initial value of q: 0)
STEADY: Derivative of Equation 20 with respect to Variable q (initial value of q: 0)
STEADY: Derivative of Equation 17 with respect to Variable p_w (initial value of p_w: 0)
STEADY: Derivative of Equation 15 with respect to Variable p_I (initial value of p_I: 0)
STEADY: Derivative of Equation 19 with respect to Variable p_I (initial value of p_I: 0)
STEADY: Derivative of Equation 20 with respect to Variable p_I (initial value of p_I: 0)
STEADY: Derivative of Equation 14 with respect to Variable b_hat (initial value of b_hat: 0)
STEADY: Derivative of Equation 19 with respect to Variable b_hat (initial value of b_hat: 0)
STEADY: Derivative of Equation 20 with respect to Variable b_hat (initial value of b_hat: 0)
STEADY: Derivative of Equation 14 with respect to Variable epsilon_star (initial value of epsilon_star: 0)
STEADY: Derivative of Equation 16 with respect to Variable epsilon_star (initial value of epsilon_star: 0)
STEADY: Derivative of Equation 17 with respect to Variable epsilon_star (initial value of epsilon_star: 0)
STEADY: Derivative of Equation 18 with respect to Variable epsilon_star (initial value of epsilon_star: 0)
STEADY: Derivative of Equation 19 with respect to Variable epsilon_star (initial value of epsilon_star: 0)
STEADY: Derivative of Equation 20 with respect to Variable epsilon_star (initial value of epsilon_star: 0)
STEADY: Derivative of Equation 3 with respect to Variable w_hat (initial value of w_hat: 0)
STEADY: Derivative of Equation 17 with respect to Variable w_hat (initial value of w_hat: 0)
STEADY: Derivative of Equation 7 with respect to Variable w_sim (initial value of w_sim: 0)
STEADY: Derivative of Equation 7 with respect to Variable w_star (initial value of w_star: 0)
STEADY: Derivative of Equation 3 with respect to Variable F_w (initial value of F_w: 0)
STEADY: Derivative of Equation 3 with respect to Variable K_w (initial value of K_w: 0)
STEADY: Derivative of Equation 24 with respect to Variable pi (initial value of pi: 0)
STEADY: Derivative of Equation 25 with respect to Variable pi (initial value of pi: 0)
STEADY: Derivative of Equation 12 with respect to Variable p_sim (initial value of p_sim: 0)
STEADY: Derivative of Equation 12 with respect to Variable p_star (initial value of p_star: 0)
STEADY: Derivative of Equation 18 with respect to Variable p_star (initial value of p_star: 0)
STEADY: Derivative of Equation 7 with respect to Variable PI_sim_w (initial value of PI_sim_w: 0)
STEADY: Derivative of Equation 12 with respect to Variable PI_sim_p (initial value of PI_sim_p: 0)
STEADY: Derivative of Equation 16 with respect to Variable z (initial value of z: 0)
STEADY: Derivative of Equation 17 with respect to Variable z (initial value of z: 0)
STEADY: Derivative of Equation 18 with respect to Variable z (initial value of z: 0)
STEADY: Derivative of Equation 19 with respect to Variable z (initial value of z: 0)
STEADY: Derivative of Equation 20 with respect to Variable z (initial value of z: 0)
STEADY: Derivative of Equation 22 with respect to Variable z (initial value of z: 0)
STEADY: Derivative of Equation 24 with respect to Variable z (initial value of z: 0)
STEADY: Derivative of Equation 15 with respect to Variable mu (initial value of mu: 0)
STEADY: Derivative of Equation 20 with respect to Variable mu (initial value of mu: 0)
STEADY: Derivative of Equation 14 with respect to Variable theta (initial value of theta: 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.


You are making a fundamental mistake here. There are two modeling choices:
1. You enter the non-linear equations and provide the steady state values in an init_val-block.
2. You linearize the model by hand and the steady states show up as parameters in the linearized equations while the steady states are all 0.

You are somehow mixing the two.
------------
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: Problem with SS, initval. incompatible with equations

Postby Thesis101 » Thu Oct 24, 2013 8:07 am

Thanks jpfeifer

So, as I read your reply I can do one of two things. I can disregard the first part of my preable where I have written my steady state parameter values as equations, and instead guess to what the initial SS values might be.
Or I can log-linearize my model block and keep the SS-parameters.
Is this correct?

Secondly, have I interpreted the residual of the static equations correctly - is it the goal that this should be "zero" for all equations?

Thanks
Thesis101
 
Posts: 2
Joined: Wed Oct 23, 2013 7:47 am

Re: Problem with SS, initval. incompatible with equations

Postby jpfeifer » Fri Oct 25, 2013 5:20 am

If you computed the steady state correctly, you do not need to disregard the first part and guess the SS values. The parameters ARE the steady state values. You just must move them to an initval or steady_state_model block (and correct the names to the variable names).

Yes, the residuals need to be as close to 0 as possible,
------------
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: Problem with SS, initval. incompatible with equations

Postby selima » Wed Mar 26, 2014 5:56 pm

Good evening Mr J Pfeifer. I n fact I nearly have the same problem , but I don't really understand how to determine the steady state value of EA_GAMMAI,EA_PH,US_GAMMAI and US_PH: 1. Can you guide me ? Thank you
This is the message that I obtain :

STEADY: The Jacobian contains Inf or NaN. The problem arises from:

STEADY: Derivative of Equation 61 with respect to Variable EA_GAMMAI (initial value of EA_GAMMAI: 0)
STEADY: Derivative of Equation 61 with respect to Variable EA_PH (initial value of EA_PH: 1.00646)
STEADY: Derivative of Equation 170 with respect to Variable US_GAMMAI (initial value of US_GAMMAI: 0)
STEADY: Derivative of Equation 170 with respect to Variable US_PH (initial value of US_PH: 1)

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.
??? Error using ==> dynare_solve at 60
An element of the Jacobian is not finite or NaN

Error in ==> evaluate_steady_state at 66
[ys,check] = dynare_solve([M.fname
'_static'],...

Error in ==> steady_ at 54
[steady_state,params,info] =
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);
Error in ==> steady at 81
[steady_state,M_.params,info] =
steady_(M_,options_,oo_);

Error in ==> essaifiscal1 at 2030
steady;

Error in ==> dynare at 174
evalin('base',fname) ;
Attachments
essaifiscal1.mod
(44.73 KiB) Downloaded 61 times
selima
 
Posts: 46
Joined: Thu Jan 10, 2013 5:13 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests