Can't solve the code's problem

Hi! I’m trying to replicate Gertler, Sala and Trigari paper. The model is already linear in the paper. I can’t understand how to solve the problem to run codes correctly.
the message in dynare:
STEADY: numerical initial values or parameters incompatible with the following equations
2 7 13 17 19 21 22 23 24 26 29 38
Check whether your model in truly linear

Residuals of the static equations:

Equation number 1 : NaN
Equation number 2 : NaN
Equation number 3 : 0
Equation number 4 : NaN
Equation number 5 : 0
Equation number 6 : 0
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 : 0
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 : 0
Equation number 26 : NaN
Equation number 27 : 0
Equation number 28 : NaN
Equation number 29 : NaN
Equation number 30 : 0
Equation number 31 : NaN
Equation number 32 : 0
Equation number 33 : 0
Equation number 34 : 0
Equation number 35 : 0
Equation number 36 : 0
Equation number 37 : NaN
Equation number 38 : -Inf

??? Error using ==> print_info at 80
The steady state contains NaN or Inf

Error in ==> steady at 92
print_info(info,options_.noprint, options_);

Error in ==> trigari at 580

Error in ==> dynare at 180
evalin(‘base’,fname) ;

Thank you !
trigari.mod (4.89 KB)

The ‘initval’ block is missing in your code. I don’t know what the code will try to do then, but you should specify the initial values of at least some variables. So for example:

initval;
k_hat = …
y_hat = …

end;

I think you have to put this block between ‘model’ and ‘steady’. This block gives the initial values for the solver to find the steady state. You don’t have to provide the initial values for all variables, but I guess the more the better.

@stst We are talking about a linear model here. All initial values are typically 0. You do not need an initval block in this case. But you need to correctly initialize the parameters.
In case of the mod-file of this post, y_ss is not defined, but used to define parameters. This results in NaN.