# Steady State issues on NK model

**URL:** <https://forum.dynare.org/t/steady-state-issues-on-nk-model/25818>\
**Category:** Steady state\
**Created:** [26 May 2024 17:29 UTC](https://forum.dynare.org/t/steady-state-issues-on-nk-model/25818 "2024-05-26T17:29:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walid](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/ea5d25/32.png) [@Walid](https://forum.dynare.org/u/Walid)\
**Post date:** [26 May 2024 17:29 UTC](https://forum.dynare.org/t/steady-state-issues-on-nk-model/25818/1 "2024-05-26T17:29:20Z")

</div>

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](https://forum.dynare.org/uploads/short-url/f1G6FR11qu7PlCjg0b5nXm5uF2Q.mod) (13.0 KB)  
[PFE3\_steadystate.m](https://forum.dynare.org/uploads/short-url/tpnLpBcYcsul2uRBgwQxWLtRVo0.m) (5.7 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [26 May 2024 21:04 UTC](https://forum.dynare.org/t/steady-state-issues-on-nk-model/25818/2 "2024-05-26T21:04:24Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Walid](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/ea5d25/32.png) [@Walid](https://forum.dynare.org/u/Walid)\
**Post date:** [27 May 2024 22:48 UTC](https://forum.dynare.org/t/steady-state-issues-on-nk-model/25818/3 "2024-05-27T22:48:56Z")

</div>

Thank you !
