The residuals of the static equations are NaN

Hello, I’m a beginner to dynare and I am trying to run my mod file. My mod file is attached memoire.mod (6.0 KB) However the following error messages apprear. Do you know how I can solve my problem ? Are my equations false or are my initval values incorrect or do I need more initval values ?
Thank you

Residuals of the static equations:

Equation number 1 : Inf : 1
Equation number 2 : Inf : 2
Equation number 3 : 0.58999 : Y
Equation number 4 : 0 : lambda_l
Equation number 5 : 0 : lambda_b
Equation number 6 : 0 : 6
Equation number 7 : -1 : 7
Equation number 8 : 0 : 8
Equation number 9 : -Inf : 9
Equation number 10 : -Inf : 10
Equation number 11 : 0 : b_b
Equation number 12 : -8.6004 : K_previous
Equation number 13 : 0 : K_1
Equation number 14 : -8.3854 : I
Equation number 15 : 1.0177 : 15
Equation number 16 : 0 : 16
Equation number 17 : 1 : 17
Equation number 18 : -Inf : W_borrower
Equation number 19 : -Inf : W_lender
Equation number 20 : -1.0001 : r_k
Equation number 21 : 0 : 21
Equation number 22 : 0 : 22
Equation number 23 : NaN : U_lender
Equation number 24 : 0.41988 : Wage_mkp_l
Equation number 25 : NaN : U_borrower
Equation number 26 : 0.41988 : Wage_mkp_b
Equation number 27 : -0.19771 : b_g
Equation number 28 : 0 : tx
Equation number 29 : 0 : tau_labor
Equation number 30 : 0 : tau_VAT
Equation number 31 : -0.075413 : G
Equation number 32 : 0 : tr
Equation number 33 : 0.74016 : 33
Equation number 34 : 0 : 34
Equation number 35 : -1 : Pi_star
Equation number 36 : 1.5668 : Z_1
Equation number 37 : 1.9586 : Z_2
Equation number 38 : 0 : 38
Equation number 39 : NaN : W_lender_star
Equation number 40 : 0 : H_1_lender
Equation number 41 : NaN : H_2_lender
Equation number 42 : 0 : 42
Equation number 43 : NaN : 43
Equation number 44 : 0 : H_1_borrower
Equation number 45 : NaN : H_2_borrower
Equation number 46 : 0 : 46
Equation number 47 : 0 : trh_l
Equation number 48 : 0 : trh_b
Equation number 49 : 0 : 49

Randomize initial guess…

Residuals of the static equations:

Equation number 1 : NaN : 1
Equation number 2 : NaN : 2
Equation number 3 : NaN : Y
Equation number 4 : NaN : lambda_l
Equation number 5 : NaN : lambda_b
Equation number 6 : NaN : 6
Equation number 7 : NaN : 7
Equation number 8 : NaN : 8
Equation number 9 : NaN : 9
Equation number 10 : NaN : 10
Equation number 11 : NaN : b_b
Equation number 12 : NaN : K_previous
Equation number 13 : NaN : K_1
Equation number 14 : NaN : I
Equation number 15 : NaN : 15
Equation number 16 : NaN : 16
Equation number 17 : NaN : 17
Equation number 18 : NaN : W_borrower
Equation number 19 : NaN : W_lender
Equation number 20 : NaN : r_k
Equation number 21 : NaN : 21
Equation number 22 : NaN : 22
Equation number 23 : NaN : U_lender
Equation number 24 : NaN : Wage_mkp_l
Equation number 25 : NaN : U_borrower
Equation number 26 : NaN : Wage_mkp_b
Equation number 27 : NaN : b_g
Equation number 28 : NaN : tx
Equation number 29 : NaN : tau_labor
Equation number 30 : NaN : tau_VAT
Equation number 31 : NaN : G
Equation number 32 : NaN : tr
Equation number 33 : NaN : 33
Equation number 34 : NaN : 34
Equation number 35 : NaN : Pi_star
Equation number 36 : NaN : Z_1
Equation number 37 : NaN : Z_2
Equation number 38 : NaN : 38
Equation number 39 : NaN : W_lender_star
Equation number 40 : NaN : H_1_lender
Equation number 41 : NaN : H_2_lender
Equation number 42 : NaN : 42
Equation number 43 : NaN : 43
Equation number 44 : NaN : H_1_borrower
Equation number 45 : NaN : H_2_borrower
Equation number 46 : NaN : 46
Equation number 47 : NaN : trh_l
Equation number 48 : NaN : trh_b
Equation number 49 : NaN : 49

Error using print_info (line 32)
The steady state has NaNs or Inf.

Error in steady (line 102)
print_info(info,options_.noprint, options_);

Error in memoire.driver (line 641)
steady;

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

Hi bal,

for you the same applies as in this post: Steady State not calculated - #2 by DoubleBass

Hope it helps

Thank you for your message Doublebass. So do I absolutely need to find a steady state value for all of my 50 variables in the initval bloc code ? Is there another way I can try to find IRF without having to compute all the 50 steady state values ? What if I try to log linearize my model ?

Yes, you absolutely need to find the steady state, either yourself or through Dynare. Otherwise you cannot know whether your model even has a steady state or not. IRF’s also cannot be calculated without a steady state as it basically shocks the model - which is in steady state - and observes how it moves back to said steady state (in very simple terms).
You could try to log-linearize the model but for that you too need the steady state as the model variables are log-linearized “around” the steady state. This is basically what Dynare does, it linearized the equations around the steady state that is either given by you or calculated by Dynare.
Maybe your model builds on another one and you could use those steady states as initial values. But larger models like yours are very sensitive to initial values, that makes using initial values a not so preferable technique. Especially if you have not plugged in values for all endog. variables and get stuff like 1/0.
So I would suggest to either calculate the steady state yourself or at least find (better) initial values for every variable.

Thank you for your answer, I will try to find steady state for each of my variables on paper. But you tell me that Dynare can compute the steady state ? How could I do that ?
Also I see that some models assume Y=1 in steady state to simplify computations. Is it a good idea to assume Y=1 at steady state for my model ?

  1. You cannot assume Y=1 unless your model features constant returns so that the economy is scale-invariant and you introduce a productivity parameter to scale the economy to 1.
  2. Dynare will numerically try to compute the steady state. But that will require i) good initial values for all variables and ii) the absence of mistakes in your equations. For a model of your size, that is a tall order.

Thank you very much jpfeifer. I indeed have a productivity parameter and consant return to scale since my production function has the following form:
prod
I will therefore assume Y=1 in my dynare file so it will simplify my compuations of the steady state on paper and pencil.