Steady State issues on NK model

Hi everyone,

I’m currently working on simulating a New-Keynesian DSGE model using Dynare version 5.4 (in the attached file), and I’ve encountered a persistent issue with unexpectedly high residuals. The problem seems particularly pronounced with equation 42, which is the Fisher relation. Despite the steady state values of gross inflation, nominal and real interest rates appearing to be correctly aligned (as they produce a null residual when manually checked), the residuals remain high when running the simulation.

Has anyone experienced similar issues or have suggestions on what might be causing this discrepancy?

Thank you in advance for your help! pistar = 1.000000000
vp = 1.000000000
r = 0.041666667
i = 0.041666667
mc = 0.760019198
k_y = 5.472138229
L_y = 0.208268818
inv_y = 0.136803456
c_y = 0.863196544
w = 1.897595552
r_rc = 9.6154
r_wc = 3.8674
tau = 0.077348
r_r = 9.6154
omegaw = 1.0427
tau_w = 0.062459
r_w = 5.9559
delta_w = 15.0661
delta_r = 9.6154
lambda = 1.5727
cw_y = 0.62013
cr_y = 0.24307
d_r = 4460298.3444
h_r = 42887484.0811
L_w = 7769610.3908
c_w = 26402556.6203
L_r = 2195233.2309
L = 8867227.0062
c_r = 10348790.8503
h_w = 349619431.687
a_r = -47153114.0617
a_w = 201349833.6078
g1 = 195127551.4394
g2 = 256740292.658
b_w = 10223217.7653
b_r = 4423073.435
a_w = 201349833.6078
c = 36751347.4707
y = 42575874.1904
f = 10217392.4143
L_c = 82067030.46
d_r = 4460298.3444
d_w = 30105662.0386

Residuals of the static equations:

Equation number 1 : 0 : r_rc
Equation number 2 : 0 : r_wc
Equation number 3 : 0 : L_c
Equation number 4 : 0 : a_c
Equation number 5 : 0 : fr
Equation number 6 : 0 : 6
Equation number 7 : 0 : 7
Equation number 8 : 0 : 8
Equation number 9 : 0 : omegaw
Equation number 10 : 0 : r_r
Equation number 11 : 0 : r_w
Equation number 12 : 0 : tau_w
Equation number 13 : 0 : delta_r
Equation number 14 : 0 : delta_w
Equation number 15 : 0 : d_r
Equation number 16 : 0 : d_w
Equation number 17 : 0 : h_r
Equation number 18 : 0 : h_w
Equation number 19 : 0 : a_r
Equation number 20 : 0 : a_w
Equation number 21 : 2835973.4706 : x_w
Equation number 22 : 13472866.9945 : x_r
Equation number 23 : 0 : c_w
Equation number 24 : 0 : c_r
Equation number 25 : 0 : c
Equation number 26 : 6484354.661 : L_w
Equation number 27 : 4765744.6906 : L_r
Equation number 28 : 0 : f
Equation number 29 : 0 : vp
Equation number 30 : 0 : 30
Equation number 31 : 0 : lambda
Equation number 32 : 0 : pistar
Equation number 33 : 0 : g1
Equation number 34 : 0 : g2
Equation number 35 : 0 : S
Equation number 36 : 0 : S_prime
Equation number 37 : 0 : 37
Equation number 38 : 0 : k
Equation number 39 : 0 : mc
Equation number 40 : 0 : 40
Equation number 41 : 0 : 41
Equation number 42 : 27.9583 : 42
Equation number 43 : 0 : 43
Equation number 44 : 0 : 44
Equation number 45 : 0 : L
Equation number 46 : 0 : y
Equation number 47 : 0 : 47
Equation number 48 : 0 : 48
PFE3.mod (13.0 KB)
PFE3_steadystate.m (5.7 KB)

Don’t use i as the variable in your last loop

for i = 1:M_.orig_endo_nbr
    eval(['ys(' int2str(i) ') = ' M_.endo_names{i} ';']);
end

when you have a variable named i. It will be overwritten. That explains the problem in the Fisher equation.

1 Like

Thank you !