Page 1 of 1
Input to EIG must not contain NaN or Inf
Posted:
Mon Sep 30, 2013 2:02 pm
by maxzhao
Hi,
I am solving a New Keyensian Model with Epstein-Zin preference. The model is pretty standard and parameters seems ok. I get the steady state values right. But Dynare report the following error afterward:
??? Error using ==> eig
Input to EIG must not contain NaN or Inf.
Error in ==> dyn_first_order_solver at 163
dr.eigval = eig(e,d);
Error in ==> stochastic_solvers at 172
[dr,info] = dyn_first_order_solver(jacobia_,M_,dr,options_,task);
Error in ==> resol at 118
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);
Error in ==> check at 73
[dr,info,M,options,oo] = resol(1,M,options,oo);
Error in ==> CAM at 371
oo_.dr.eigval = check(M_,options_,oo_);
Error in ==> dynare at 120
evalin('base',fname) ;
Please help me look at the code attached, thanks.
Re: Input to EIG must not contain NaN or Inf
Posted:
Mon Sep 30, 2013 3:45 pm
by jpfeifer
The unstable version says:
STEADY: The Jacobian contains Inf or NaN. The problem arises from:
STEADY: Derivative of Equation 18 with respect to Variable w (initial value of w: 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.
Your problem comes from equation 18
- Code: Select all
a = a_bar + rho_a*(a(-1)-a_bar) + w^0.5*(kappa_z*e_z + kappa_a*e_a);
w is 0 in steady state. Is the equation correct?
Re: Input to EIG must not contain NaN or Inf
Posted:
Mon Sep 30, 2013 4:23 pm
by maxzhao
Thanks, the problem solved when I specify a non zero steady state value for w. Another question, do you know if dynare report forward-looking variable(s)? I have another error, need help.
There are 13 eigenvalue(s) larger than 1 in modulus
for 14 forward-looking variable(s)
The rank conditions ISN'T verified!
??? Error using ==> print_info at 43
Blanchard Kahn conditions are not satisfied: indeterminacy
Error in ==> stoch_simul at 81
print_info(info, options_.noprint);
Error in ==> CAM at 388
info = stoch_simul(var_list_);
Error in ==> dynare at 120
evalin('base',fname) ;
Re: Input to EIG must not contain NaN or Inf
Posted:
Mon Sep 30, 2013 6:27 pm
by jpfeifer
Search the forum for this. Typically, the reason is a violation of Dynare's timing convention for predetermined variables (see the manual)
Re: Input to EIG must not contain NaN or Inf
Posted:
Mon Sep 30, 2013 10:34 pm
by maxzhao
Thanks for the help. In my case, I don't have capital in the model and seems the timing convention is right. Is there any other possible for this problem to occur? I attach a simplified version of the code, could you please help me identify the problem?
Re: Input to EIG must not contain NaN or Inf
Posted:
Tue Oct 01, 2013 9:40 pm
by maxzhao
Hi jpfeifer,
I changed the discount rate of beta from 0.99 to 0.7, then the rank condition satisfied (There are 14 eigenvalue(s) larger than 1 in modulus for 14 forward-looking variable(s) ). The problem is this low discount factor is unrealistic. Seems there should be some other problems with the code. Could you please help me look at the code and identify the problem? Thanks.
Re: Input to EIG must not contain NaN or Inf
Posted:
Wed Oct 02, 2013 6:31 pm
by jpfeifer
Without knowing the model, this is impossible. There is nothing immediately suspicious. I am afraid you have to debug your code yourself.
Re: Input to EIG must not contain NaN or Inf
Posted:
Wed Oct 02, 2013 8:33 pm
by maxzhao
This is the code to replicate Li and Palomino (2013), Epstein-Zin preference, sticky price, sticky wage, permanent TFP shocks( z is the growth rate of TFP in the code). Even thought beta = 0.7 works, but the results value are significantly different from their results. I guess there are some other places wrong with the code. Do you need more info to be able to look at my code and identify the problem? Thanks.
Re: Input to EIG must not contain NaN or Inf
Posted:
Fri Jul 22, 2016 9:46 am
by jojokre
I get the same error message as stated in the subject of this forum. Now, I tried to run it with the unstable version of Dynare to get a more detailed error message as in the post by jpfeifer, however, I just get the same message as with the stable version. I guess the unstable version does not have this nice feature any more (the post by jpfeifer is already 3 years old)? or do I have to include some command in the .mod file before I run it with the unstable version to get such a message?
thanks a lot!
Re: Input to EIG must not contain NaN or Inf
Posted:
Fri Jul 22, 2016 9:56 am
by jpfeifer
No, the feature is still there, but your mod-file seems to not trigger it. Please provide the mod-file.