# Problem in steady state

**URL:** <https://forum.dynare.org/t/problem-in-steady-state/14826>\
**Category:** Steady state\
**Created:** [2 December 2019 08:25 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826 "2019-12-02T08:25:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)\
**Post date:** [2 December 2019 08:25 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/1 "2019-12-02T08:25:47Z")

</div>

Hi I run the following model but I had trouble finding a stable wage situation. Do you think my form of function is wrong? Do I get different values for the steady state of this variable when I change the initial value?  
[NDF.mod](https://forum.dynare.org/uploads/short-url/vtjSujtcXvGA95FqEobxCIVFoHx.mod) (2.7 KB)  
[NDF\_steadystate.m](https://forum.dynare.org/uploads/short-url/v67crE7ai8aT6QM5nwibvpjmX0d.m) (2.6 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:** [2 December 2019 10:49 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/2 "2019-12-02T10:49:55Z")

</div>

You are setting

```auto
pi =1.15;

```

in the steady state file, but

```auto
Y = C + I + G_c + (phi_p/2)*(pi-1)^2*Y_p;

```

seems to indicate that `pi=1` in steady state

---

<div class="post-metadata">

**Author:** ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)\
**Post date:** [3 December 2019 15:53 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/3 "2019-12-03T15:53:46Z")

</div>

My model is based on Rotemberg’s stickness and with the steady state change of this variable there is no change in the residual.  
[NDF.mod](https://forum.dynare.org/uploads/short-url/xbFxxKffMbayIBRbGhbx2gjZWUC.mod) (2.7 KB)  
[NDF\_steadystate.m](https://forum.dynare.org/uploads/short-url/sPP5GlJWpUjIAwAFPt491mK2EZ8.m) (2.7 KB)

My model seems to be right. Is it possible to achieve wage is wrong?

---

<div class="post-metadata">

**Author:** ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)\
**Post date:** [5 December 2019 06:52 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/4 "2019-12-05T06:52:52Z")

</div>

Can anyone help me?🙏🙏🙏🙏

---

<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:** [6 December 2019 11:02 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/5 "2019-12-06T11:02:50Z")

</div>

I pointed you already to one mistake in your computations. There are probably more. Recheck everything.

---

<div class="post-metadata">

**Author:** ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)\
**Post date:** [20 December 2019 16:47 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/6 "2019-12-20T16:47:40Z")

</div>

Hi I have been checking my model many times and have been able to reduce the number of errors but there are still one or two errors that have not gone away. In my steady state file, in the function definition section to obtain W, fsolve and fzero give different results. With the fsolve statement, the residuals of the static equation 2 becomes non-zero and the residue of equation 17 becomes NaN. But with the fzero command, most of the residue becomes NaN equations.  
Also in the MATLAB file W, I get the value of the function and I put this number (W=0.365) directly in the steady state file which gives a different result than the previous two states, that is, only the residual value of equation 26 becomes non-zero.  
What is the reason for this? Is there a problem with my model or is it problem to define my function? Because in different states different equations are non-zero.  
Does the negative steady state of some variables have an effect on this?

[NDF.mod](https://forum.dynare.org/uploads/short-url/4zY1riXEZkgHZIMNAClxqD55vbg.mod) (2.7 KB)  
[NDF\_steadystate.m](https://forum.dynare.org/uploads/short-url/rUsjlu27ilVPX6z673rENhUp9UC.m) (2.8 KB)  
[W.m](https://forum.dynare.org/uploads/short-url/ArILDJmP7Jx7Q3fmBaSWlpRNMfq.m) (1.6 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:** [21 December 2019 12:53 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/7 "2019-12-21T12:53:16Z")

</div>

Please try to phrase your question in more precise terms. What do you mean with

> [@mohsen](#):
>
> in different states

? It seems you are not talking about state variables.  
Also, did you check whether your solver actually finds a solution to your equation? If two solvers return different results that is strange.

---

<div class="post-metadata">

**Author:** ![mohsen](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mohsen](https://forum.dynare.org/u/mohsen)\
**Post date:** [24 January 2020 13:02 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/8 "2020-01-24T13:02:33Z")

</div>

Hi. My model get off on paper, but it had problems running on the dynare. I had trouble obtaining steady state and getting steady state of W. When I change the default value, TolX or TolFun,or initial point, I get different results. Do you think my model has a problem? Or the problem with coding?  
[NDF.mod](https://forum.dynare.org/uploads/short-url/3cNzf4z1t87nOwGs8VE7EbdI93Y.mod) (4.2 KB)  
[NDF\_steadystate.m](https://forum.dynare.org/uploads/short-url/hWyuEzuL8f9xR6XhjWXc81GhvvB.m) (2.9 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 January 2020 17:40 UTC](https://forum.dynare.org/t/problem-in-steady-state/14826/9 "2020-01-26T17:40:26Z")

</div>

Your steady state file is wrong. Use the attached one to see that there are two problematic equations once you solve your nonlinear equation with a proper tolerance.

[NDF\_steadystate.m](https://forum.dynare.org/uploads/short-url/nnDdRbLQK0wNKJljI0BJ1rY8kVZ.m) (2.9 KB)
