Steady state contains 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.

Steady state contains NaN or Inf

Postby DanielK » Mon Jul 25, 2016 9:42 am

Dear professor Pfeifer,

I built a two country monetary union, two sector, two household (saver/borrower) model similar to Quint and Rabanal 2013 found at https://www.imf.org/external/pubs/ft/wp ... p13209.pdf. The main difference with my code is that the bonds market for savers is not international. Savers can only place deposits with domestic financial intermediaries.

When I simulate the model I get the following message:
Warning: Matrix is singular to working precision.
> In evaluate_steady_state at 85
In resol at 104
In stoch_simul at 88
In Test at 777
In dynare at 180
Error using print_info (line 80)
The steady state contains NaN or Inf

Error in stoch_simul (line 98)
print_info(info, options_.noprint, options_);

Error in Test (line 777)
info = stoch_simul(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;


Do you have any tips on what might be causing this problem? I've gone over the code countless times and compared it with similar codes but am still unable to find what's wrong. Thank you in advance

Best,

Daniel
Attachments
Test.mod
(9.36 KiB) Downloaded 104 times
DanielK
 
Posts: 2
Joined: Mon Jul 25, 2016 9:16 am

Re: Steady state contains NaN or Inf

Postby jpfeifer » Tue Jul 26, 2016 8:40 am

The problem is that your equation 50 is not linear. You can see this when using
Code: Select all
resid;

which shows a non-zero residual, which is usually incompatible with
Code: Select all
model(linear);
------------
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: Steady state contains NaN or Inf

Postby DanielK » Tue Jul 26, 2016 10:19 am

Thank you very much for the reply! I fixed the issue with equation 50 and added 2 equations relating to the current account in order to obtain a stationary and well-defined steady state (an interest rate differential between domestic and EMU wide and the evolution of foreign net assets). If I simulate the model I'm able to obtain IRFs but I still get the error:

Code: Select all
model_diagnostic: the Jacobian of the static model is singular
there is 6 colinear relationships between the variables and the equations.
...
The presence of a singularity problem typically indicates that there is one
redundant equation entered in the model block, while another non-redundant equation
is missing. The problem often derives from Walras Law.


Do you know how best to identify this redundant equation and which non-redundant equation is missing?
Thank you in advance for your help.

Kind regards,

Daniel
Attachments
Test3.mod
(9.57 KiB) Downloaded 75 times
DanielK
 
Posts: 2
Joined: Mon Jul 25, 2016 9:16 am

Re: Steady state contains NaN or Inf

Postby jpfeifer » Tue Jul 26, 2016 10:28 am

Your model is still not properly linearized.

Code: Select all
//Total Consumption
(lambda*cS+(1-lambda)*cB)*c=lambda*CS*cS+(1-lambda)*CB*cB;

for example has a product of cS and c. The same in
Code: Select all
//Total Consumption
(lambdastar*cSstar+(1-lambdastar)*cBstar)*cstar=lambdastar*CSstar*cSstar+(1-lambdastar)*CBstar*cBstar;

Regarding the "error" it is actually a warning that in your case comes from the still existing unit roots.
------------
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 8 guests