Page 1 of 1

Steady state contains NaN or Inf

PostPosted: Mon Jul 25, 2016 9:42 am
by DanielK
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

Re: Steady state contains NaN or Inf

PostPosted: Tue Jul 26, 2016 8:40 am
by jpfeifer
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);

Re: Steady state contains NaN or Inf

PostPosted: Tue Jul 26, 2016 10:19 am
by DanielK
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

Re: Steady state contains NaN or Inf

PostPosted: Tue Jul 26, 2016 10:28 am
by jpfeifer
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.