The error about "the steady state contains NaN or Inf"

Dear professor jpfeifer:
I am so sorry to bother you. when I run the Dynare, I get the following message:
Using 64-bit preprocessor
Starting Dynare (version 4.5.3).
Starting preprocessing of the model file …
Substitution of endo leads >= 2: added 1 auxiliary variables and equations.
Found 57 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …
    done
    Preprocessing completed.

Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0
Equation number 13 : 0
Equation number 14 : 0
Equation number 15 : 0
Equation number 16 : 0
Equation number 17 : 0
Equation number 18 : 0
Equation number 19 : 0
Equation number 20 : 0
Equation number 21 : 0
Equation number 22 : 0
Equation number 23 : 0
Equation number 24 : 0
Equation number 25 : 0
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
Equation number 34 : 0
Equation number 35 : 0
Equation number 36 : 0
Equation number 37 : 0
Equation number 38 : 0
Equation number 39 : 0
Equation number 40 : 0
Equation number 41 : 0
Equation number 42 : 0
Equation number 43 : 0
Equation number 44 : 0
Equation number 45 : 0
Equation number 46 : 0
Equation number 47 : 0
Equation number 48 : 0
Equation number 49 : 0
Equation number 50 : 0
Equation number 51 : 0
Equation number 52 : 0
Equation number 53 : 0
Equation number 54 : 0
Equation number 55 : 0
Equation number 56 : 0

Residuals of the static equations:

Equation number 1 : NaN
Equation number 2 : NaN
Equation number 3 : NaN
Equation number 4 : NaN
Equation number 5 : NaN
Equation number 6 : NaN
Equation number 7 : NaN
Equation number 8 : NaN
Equation number 9 : NaN
Equation number 10 : NaN
Equation number 11 : NaN
Equation number 12 : NaN
Equation number 13 : NaN
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 : NaN
Equation number 22 : NaN
Equation number 23 : NaN
Equation number 24 : NaN
Equation number 25 : NaN
Equation number 26 : NaN
Equation number 27 : NaN
Equation number 28 : NaN
Equation number 29 : NaN
Equation number 30 : NaN
Equation number 31 : NaN
Equation number 32 : NaN
Equation number 33 : NaN
Equation number 34 : NaN
Equation number 35 : NaN
Equation number 36 : NaN
Equation number 37 : NaN
Equation number 38 : NaN
Equation number 39 : NaN
Equation number 40 : NaN
Equation number 41 : NaN
Equation number 42 : NaN
Equation number 43 : NaN
Equation number 44 : NaN
Equation number 45 : NaN
Equation number 46 : NaN
Equation number 47 : NaN
Equation number 48 : NaN
Equation number 49 : NaN
Equation number 50 : NaN
Equation number 51 : NaN
Equation number 52 : NaN
Equation number 53 : NaN
Equation number 54 : NaN
Equation number 55 : NaN
Equation number 56 : NaN

错误使用 print_info (line 90)
The steady state contains NaN or Inf
出错 steady (line 104)
print_info(info,options_.noprint, options_);
出错 resilience (line 656)
steady;
出错 dynare (line 223)
evalin(‘base’,fname) ;

I have no idea about it and check the code many times. So could you please tell me how to deal with it?
Best wishes!
Kidd
resilience.mod (9.0 KB)

Please upgrade your Dynare version. I am getting that

e(+1)-e=z_ss*(z-res+e)/res_ss+sig_e*(1+e-0.5*res)*e_e/(1+res^(0.5));

has a division by 0 in the Jacobian when taking the derivative with respect to res, which has steady state 0.

Thanks sir! I modified my code. And I got following error:
You did not declare endogenous variables after the estimation/calib_smoother command.
Error in computing likelihood for initial parameter values

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

错误使用 print_info (line 32)
Blanchard & Kahn conditions are not satisfied: indeterminacy.

出错 print_info (line 32)
error(message);

出错 initial_estimation_checks (line 196)
print_info(info, DynareOptions.noprint, DynareOptions)

出错 dynare_estimation_1 (line 164)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);

出错 dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);

出错 resilience.driver (line 1018)
oo_recursive_=dynare_estimation(var_list_);

出错 dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;
I referred to the solution in the forum and add estimated_params_init(use_calibration). But the error still exists. How to deal with it?
Thanks a lot !
Kidd
resilience.mod (8.6 KB)

Hi KIDD,

you should first make your model work in a calibrated form before engaging in estimation but when you have a model that you want to estimate please also include the data.

It seems that your model features unit roots and and singularity issues that may come from the inclusion of redundant equations. You get that information by including model_diagnostics; after the steady command. Did you extend a model or build it from scratch?

Dear DoubleBass
Thanks for your replying. I build it from scratch because of the specific study. So if I delete redundant equations, the number of endogenous variables would not equal that of the model equation. And when I use model_diagnostics;, I got following message:
MODEL_DIAGNOSTICS: The Jacobian of the static model is singular
MODEL_DIAGNOSTICS: there is 2 colinear relationships between the variables and the equations
Relation 1
Colinear variables:
l
h
profit
profit_re
profit_m
s
l_te
l_re
l_m
h_te
h_re
h_m
tp
res
gs
Relation 2
Colinear variables:
l
h
profit
profit_re
profit_m
s
l_te
l_re
l_m
h_te
h_re
h_m
tp
res
gs
Relation 1
Colinear equations
1 至 17 列

 1     4     5     6     9    10    11    12    13    15    16    19    20    21    22    24    25

18 至 33 列

26    27    28    29    31    32    33    34    35    38    39    40    41    47    48    49

Relation 2
Colinear equations
42

MODEL_DIAGNOSTICS: The singularity seems to be (partly) caused by the presence of a unit root
MODEL_DIAGNOSTICS: as the absolute value of one eigenvalue is in the range of ±1e-6 to 1.
MODEL_DIAGNOSTICS: If the model is actually supposed to feature unit root behavior, such a warning is expected,
MODEL_DIAGNOSTICS: but you should nevertheless check whether there is an additional singularity problem.
MODEL_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS: is missing. The problem often derives from Walras Law.
Is that mean I should rebuild my model? Is there any other way to deal with it?
Kidd

That is close to impossible to know to anyone except you, since you built the model and nobody can spend that amount of time to debug it.
You should probably start simplifying it, that is always the way to go. Reduce it in size to some workable version and then add your features.

Many thanks!

In any case, if your model indeed features a unit root, you need the diffuse_filter-option in estimation.

Thanks for your replying, Prof. Jpfeifer. But when I use diffuse_filter -option in estimation, the Jacobian of the static model is still singular.
resilience.mod (8.6 KB)
Kidd

Whenever there is a unit root, the Jacobian is singular.