Request for help to run my DSGE model

This is a standard steady state finding problem. Often there are still mistakes in the file. Have a particular look at the last three equations.

Thank you professor.
I will continue the work.

Hello Professor;
I can’t get my model to work.
need helpmodsge2.mod (18.5 KB)

dynare modsge2
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
WARNING: A parameter was used with a lead or a lag in the model block
Found 45 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

Randomize initial guess…

An infinite element was encountered when trying to solve equation(s) 20
with respect to the variable(s): tau_bar_s.
The values of the endogenous variables when the problem was encountered were:
ctild_star 8.147
ctild_s 9.058
ctild_B 1.27
ctild_i 9.134
pi_star 6.324
pi_s 0.9754
pi_B 2.785
ytild_star 5.469
ytild_s 9.575
ytild_B 9.649
tt_tild_s 1.576
tt_tild_B 9.706
tt_tild_i 9.572
dchapo_g_s 4.854
dchapo_g_B 8.003
gtild_s 1.419
gtild_B 4.218
gtild_star 9.157
tautild_s 7.922
tautild_B 9.595
rtild_star 6.557
r_bar_star 0.3571
tt_bar_s 8.491
tt_bar_B 9.34
c_bar_s 3.545e-07
c_bar_B 2.929e-07
c_bar_star 5.747e-09
g_bar_s 3.105e-07
g_bar_B 6.915e-09
g_bar_star 5.66e-09
y_bar_s 3.145e-07
y_bar_B 1.669e-07
y_bar_star 5.722e-09
tau_bar_s 0.4617
tau_bar_B 0.9713
p_bar_star 8.235
l_s 6.948
l_B 3.171
p_bar_s 9.502
muchapo_w_B 0.3445
muchapo_w_s 4.387
p_bar_B 3.816
a_s 2.285e-07
a_B 8.897e-08
a_star 7.188e-09

Error using lnsrch1 (line 72)
Some element of Newton direction isn’t finite. Jacobian maybe singular or there is a problem
with initial values

Error in solve1 (line 111)
[x, f, fvec, check] = lnsrch1(xold, fold, g, p, stpmax, func, j1, j2, tolx, varargin{:});

Error in dynare_solve (line 255)
[x,info]=solver(func,x,j1(r(i):r(i+1)-1),j2(r(i):r(i+1)-1),jacobian_flag, …

Error in evaluate_steady_state (line 221)
[ys,check] = dynare_solve(@static_problem,…

Error in steady_ (line 55)
[steady_state,params,info] =
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);

Error in steady (line 80)
[oo_.steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in modsge2.driver (line 650)
steady;

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

need help to solve my problem

THESE.mod (18.3 KB)

dynare THESE
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
WARNING: A parameter was used with a lead or a lag in the model block
Found 45 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
ERROR: If the model is declared linear the second derivatives must be equal to zero.
The following equations have non-zero second derivatives:

   * Eq # 2 [pi_s]
   * Eq # 3 [pi_B]
   * Eq # 15 [l_s]
   * Eq # 16 [l_B]

As the message says, the mentioned equations are not properly linearized. There must be mistakes like wrong brackets etc.

Thank you professor,
I will rewrite these 6 equations.

Hello Professor,
After the correction of the 6 equations, here is what I get as results.

dynare THESE
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
WARNING: A parameter was used with a lead or a lag in the model block
Found 43 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

Warning: Matrix is singular to working precision.

In evaluate_steady_state at 261
In steady_ at 55
In steady at 80
In driver at 586
In dynare at 293

Residuals of the static equations:

Equation number 1 : NaN : ctild_star
Equation number 2 : NaN : pi_s
Equation number 3 : NaN : pi_B
Equation number 4 : NaN : ytild_s
Equation number 5 : NaN : ytild_B
Equation number 6 : NaN : ctild_s
Equation number 7 : NaN : 7
Equation number 8 : NaN : ctild_i
Equation number 9 : NaN : ctild_B
Equation number 10 : NaN : 10
Equation number 11 : NaN : 11
Equation number 12 : NaN : ytild_star
Equation number 13 : NaN : dchapo_g_s
Equation number 14 : NaN : dchapo_g_B
Equation number 15 : NaN : a_s
Equation number 16 : NaN : a_B
Equation number 17 : NaN : a_star
Equation number 18 : NaN : 18
Equation number 19 : NaN : 19
Equation number 20 : NaN : c_bar_s
Equation number 21 : NaN : c_bar_B
Equation number 22 : NaN : c_bar_star
Equation number 23 : NaN : g_bar_s
Equation number 24 : NaN : g_bar_B
Equation number 25 : NaN : g_bar_star
Equation number 26 : NaN : y_bar_s
Equation number 27 : NaN : y_bar_B
Equation number 28 : NaN : y_bar_star
Equation number 29 : NaN : 29
Equation number 30 : NaN : 30
Equation number 31 : NaN : 31
Equation number 32 : NaN : 32
Equation number 33 : NaN : 33
Equation number 34 : NaN : tt_bar_s
Equation number 35 : NaN : tt_bar_B
Equation number 36 : NaN : r_bar_star
Equation number 37 : NaN : tau_bar_s
Equation number 38 : NaN : tau_bar_B
Equation number 39 : NaN : rtild_star
Equation number 40 : NaN : gtild_s
Equation number 41 : NaN : gtild_B
Equation number 42 : NaN : tautild_s
Equation number 43 : NaN : tautild_B

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 THESE.driver (line 586)
steady;

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

THESE.mod (17.1 KB)

Hello Professor,
after the correction of the 6 equations, here is what I get as results.

dynare THESE
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
WARNING: A parameter was used with a lead or a lag in the model block
Found 43 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

Warning: Matrix is singular to working precision.

In evaluate_steady_state at 261
In steady_ at 55
In steady at 80
In driver at 586
In dynare at 293

Residuals of the static equations:

Equation number 1 : NaN : ctild_star
Equation number 2 : NaN : pi_s
Equation number 3 : NaN : pi_B
Equation number 4 : NaN : ytild_s
Equation number 5 : NaN : ytild_B
Equation number 6 : NaN : ctild_s
Equation number 7 : NaN : 7
Equation number 8 : NaN : ctild_i
Equation number 9 : NaN : ctild_B
Equation number 10 : NaN : 10
Equation number 11 : NaN : 11
Equation number 12 : NaN : ytild_star
Equation number 13 : NaN : dchapo_g_s
Equation number 14 : NaN : dchapo_g_B
Equation number 15 : NaN : a_s
Equation number 16 : NaN : a_B
Equation number 17 : NaN : a_star
Equation number 18 : NaN : 18
Equation number 19 : NaN : 19
Equation number 20 : NaN : c_bar_s
Equation number 21 : NaN : c_bar_B
Equation number 22 : NaN : c_bar_star
Equation number 23 : NaN : g_bar_s
Equation number 24 : NaN : g_bar_B
Equation number 25 : NaN : g_bar_star
Equation number 26 : NaN : y_bar_s
Equation number 27 : NaN : y_bar_B
Equation number 28 : NaN : y_bar_star
Equation number 29 : NaN : 29
Equation number 30 : NaN : 30
Equation number 31 : NaN : 31
Equation number 32 : NaN : 32
Equation number 33 : NaN : 33
Equation number 34 : NaN : tt_bar_s
Equation number 35 : NaN : tt_bar_B
Equation number 36 : NaN : r_bar_star
Equation number 37 : NaN : tau_bar_s
Equation number 38 : NaN : tau_bar_B
Equation number 39 : NaN : rtild_star
Equation number 40 : NaN : gtild_s
Equation number 41 : NaN : gtild_B
Equation number 42 : NaN : tautild_s
Equation number 43 : NaN : tautild_B

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 THESE.driver (line 586)
steady;

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

THESE.mod (17.1 KB)

Hello Professor,
after the correction of the 6 equations, here is what I get as results.

dynare THESE
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
WARNING: A parameter was used with a lead or a lag in the model block
Found 43 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

Warning: Matrix is singular to working precision.

In evaluate_steady_state at 261
In steady_ at 55
In steady at 80
In driver at 586
In dynare at 293

Residuals of the static equations:

Equation number 1 : NaN : ctild_star
Equation number 2 : NaN : pi_s
Equation number 3 : NaN : pi_B
Equation number 4 : NaN : ytild_s
Equation number 5 : NaN : ytild_B
Equation number 6 : NaN : ctild_s
Equation number 7 : NaN : 7
Equation number 8 : NaN : ctild_i
Equation number 9 : NaN : ctild_B
Equation number 10 : NaN : 10
Equation number 11 : NaN : 11
Equation number 12 : NaN : ytild_star
Equation number 13 : NaN : dchapo_g_s
Equation number 14 : NaN : dchapo_g_B
Equation number 15 : NaN : a_s
Equation number 16 : NaN : a_B
Equation number 17 : NaN : a_star
Equation number 18 : NaN : 18
Equation number 19 : NaN : 19
Equation number 20 : NaN : c_bar_s
Equation number 21 : NaN : c_bar_B
Equation number 22 : NaN : c_bar_star
Equation number 23 : NaN : g_bar_s
Equation number 24 : NaN : g_bar_B
Equation number 25 : NaN : g_bar_star
Equation number 26 : NaN : y_bar_s
Equation number 27 : NaN : y_bar_B
Equation number 28 : NaN : y_bar_star
Equation number 29 : NaN : 29
Equation number 30 : NaN : 30
Equation number 31 : NaN : 31
Equation number 32 : NaN : 32
Equation number 33 : NaN : 33
Equation number 34 : NaN : tt_bar_s
Equation number 35 : NaN : tt_bar_B
Equation number 36 : NaN : r_bar_star
Equation number 37 : NaN : tau_bar_s
Equation number 38 : NaN : tau_bar_B
Equation number 39 : NaN : rtild_star
Equation number 40 : NaN : gtild_s
Equation number 41 : NaN : gtild_B
Equation number 42 : NaN : tautild_s
Equation number 43 : NaN : tautild_B

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 THESE.driver (line 586)
steady;

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

THESE.mod (17.1 KB)

Your final eqations

gtild_s = rho_g*gtild_s+(1-rho_g)*(tethay_s*(ytild_s(-1)-ytild_star(-1))+tetha_spi*(pi_s(-1)-pi_star(-1))+tethab_s*bchapo_s(-1));

gtild_B = rho_g*gtild_B+(1-rho_g)*(tethay_B*(ytild_B(-1)-ytild_star(-1))+tetha_Bpi*(pi_B(-1)-pi_star(-1))+tethab_B*bchapo_B(-1));

tautild_s = rho_tau*tautild_s+(1-rho_tau)*(deltay_s*(ytild_s(-1)-ytild_star(-1))+delta_spi*(pi_s(-1)-pi_star(-1))+deltab_s*bchapo_s(-1));

tautild_B = rho_tau*tautild_B+(1-rho_tau)*(deltay_B*(ytild_B(-1)-ytild_star(-1))+delta_Bpi*(pi_B(-1)-pi_star(-1))+deltab_B*bchapo_B(-1));

use the parameters bchapo_s as a variable. But given that they are non-zero numbers, they imply constant terms in the linear equations, which does not work.

Hello Sir,

After correction here is what I get

dynare THESE
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
ERROR: THESE.mod: line 138, cols 1-7: syntax error, unexpected NAME

Error using dynare (line 282)
Dynare: preprocessing failed

dynare THESE
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
Found 46 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

STEADY-STATE RESULTS:

ctild_star 0
ctild_s 0
ctild_B 0
ctild_i 0
pi_star 0
pi_s 0
pi_B 0
ytild_star 0
ytild_s 0
ytild_B 0
tt_tild_s 0
tt_tild_B 0
tt_tild_i 0
dchapo_g_s 0
dchapo_g_B 0
gtild_s 0
gtild_B 0
gtild_star 0
tautild_s 0
tautild_B 0
rtild_star 0
r_bar_star 0
tt_bar_s 0
tt_bar_B 0
c_bar_s 0
c_bar_B 0
c_bar_star 0
g_bar_s 0
g_bar_B 0
g_bar_star 0
y_bar_s 0
y_bar_B 0
y_bar_star 0
tau_bar_s 0
tau_bar_B 0
p_bar_star 0
p_bar_s 0
muchapo_w_B 0
muchapo_w_s 0
p_bar_B 0
bchapo_s 0
bchapo_B 0
bchapo_star 0
a_s 0
a_B 0
a_star 0
Error using print_info (line 32)
The generalized Schur (QZ) decomposition failed. For more information, see the documentation for
Lapack function dgges: info=27, n=25. You can also run model_diagnostics to get more information
on what may cause this problem.

Error in check (line 48)
print_info(info, 0, options);

Error in THESE.driver (line 600)
oo_.dr.eigval = check(M_,options_,oo_);

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

Please provide the most recent version.

Hello Professor,
The most recent version is :

THESE.mod (17.3 KB)

There is still a fundamental singularity. Are you sure you correctly fixed the issue?

Good evening Professor,
After the correction of equations 14 and 15, here is the result I got:
the error message reads:Error using print_info (line 32)
Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.
dynare THESE
Using 64-bit preprocessor
Starting Dynare (version 4.6.4).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
Found 46 equation(s).
Evaluating expressions…done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs …
done
Preprocessing completed.

STEADY-STATE RESULTS:

ctild_star 0
ctild_s 0
ctild_B 0
ctild_i 0
pi_star 0
pi_s 0
pi_B 0
ytild_star 0
ytild_s 0
ytild_B 0
tt_tild_s 0
tt_tild_B 0
tt_tild_i 0
dchapo_g_s 0
dchapo_g_B 0
gtild_s 0
gtild_B 0
gtild_star 0
tautild_s 0
tautild_B 0
rtild_star 0
r_bar_star 0
tt_bar_s 0
tt_bar_B 0
c_bar_s 0
c_bar_B 0
c_bar_star 0
g_bar_s 0
g_bar_B 0
g_bar_star 0
y_bar_s 0
y_bar_B 0
y_bar_star 0
tau_bar_s 0
tau_bar_B 0
p_bar_star 0
p_bar_s 0
muchapo_w_B 0
muchapo_w_s 0
p_bar_B 0
bchapo_s 0
bchapo_B 0
bchapo_star 0
a_s 0
a_B 0
a_star 0

EIGENVALUES:
Modulus Real Imaginary

           0               -0                0
   2.895e-17        2.895e-17                0
   9.535e-17        9.535e-17                0
   3.576e-16        3.576e-16                0
   1.338e-15       -1.338e-15                0
   1.393e-15       -1.393e-15                0
   2.037e-15       -2.037e-15                0
    3.17e-15         3.17e-15                0
   4.484e-09        4.484e-09                0
   4.484e-09       -4.484e-09                0
      0.1068           0.1068                0
      0.1757           0.1757                0
      0.2435          -0.2435                0
      0.2929          -0.2929                0
      0.3507           0.3507                0
      0.3771           0.3771                0
      0.9334          -0.2203            0.907
      0.9334          -0.2203           -0.907
       0.972            0.972                0
      0.9869           0.9869                0
       1.562            1.562                0
       24.84            24.84                0
       32.24            -1.38            32.21
       32.24            -1.38           -32.21
   3.719e+20       -3.719e+20                0

There are 5 eigenvalue(s) larger than 1 in modulus
for 5 forward-looking variable(s)

The rank condition ISN’T verified!

Error using print_info (line 32)
Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.

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

Error in THESE.driver (line 613)
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);

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

THESE.mod (17.3 KB)

You are still having the same fundamental issues. I think you need to step back and think about using a simpler model first.