Input to EIG must not contain 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.

Input to EIG must not contain NaN or Inf

Postby maxzhao » Mon Sep 30, 2013 2:02 pm

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.
Attachments
ModelHelp.mod
(4.75 KiB) Downloaded 183 times
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Input to EIG must not contain NaN or Inf

Postby jpfeifer » Mon Sep 30, 2013 3:45 pm

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?
------------
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: Input to EIG must not contain NaN or Inf

Postby maxzhao » Mon Sep 30, 2013 4:23 pm

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) ;
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Input to EIG must not contain NaN or Inf

Postby jpfeifer » Mon Sep 30, 2013 6:27 pm

Search the forum for this. Typically, the reason is a violation of Dynare's timing convention for predetermined variables (see the manual)
------------
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: Input to EIG must not contain NaN or Inf

Postby maxzhao » Mon Sep 30, 2013 10:34 pm

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?
Attachments
ModelHelp.mod
(4.28 KiB) Downloaded 186 times
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Input to EIG must not contain NaN or Inf

Postby maxzhao » Tue Oct 01, 2013 9:40 pm

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.
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Input to EIG must not contain NaN or Inf

Postby jpfeifer » Wed Oct 02, 2013 6:31 pm

Without knowing the model, this is impossible. There is nothing immediately suspicious. I am afraid you have to debug your code yourself.
------------
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: Input to EIG must not contain NaN or Inf

Postby maxzhao » Wed Oct 02, 2013 8:33 pm

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.
maxzhao
 
Posts: 17
Joined: Sun Sep 29, 2013 10:52 pm

Re: Input to EIG must not contain NaN or Inf

Postby jojokre » Fri Jul 22, 2016 9:46 am

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!
jojokre
 
Posts: 14
Joined: Thu Jan 15, 2015 1:49 pm

Re: Input to EIG must not contain NaN or Inf

Postby jpfeifer » Fri Jul 22, 2016 9:56 am

No, the feature is still there, but your mod-file seems to not trigger it. Please provide the mod-file.
------------
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: Google [Bot] and 9 guests