# Problem with the steady state

**URL:** https://forum.dynare.org/t/problem-with-the-steady-state/23186
**Category:** Steady state
**Created:** [28 September 2023 08:47 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186 "2023-09-28T08:47:52Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [28 September 2023 08:47 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/1 "2023-09-28T08:47:53Z")

</div>

Hello,

I have the issue with the steady state - I have been working for quite some time now on my model and I haven’t been able to resolve this. The post is related to [this one](https://forum.dynare.org/t/problem-finding-the-steady-state/22930) but I have been working on solving the complete model with two sectors, rather than simplified one I posted earlier. I solved for the steady state separately but when I input those values into initval block, Dynare reports that the steady state has NaNs or Inf. This is possibly due to some negative values I obtained in the steady state file, I tried changing the values of some parameters but was not able to fix it. Would really appreciate any suggestion.

Thank you in advance!

[MinWageModel2.m](https://forum.dynare.org/uploads/short-url/eSz7DRm9wvnjVvnbbW4GhnwXwj0.m) (5.5 KB)  
[MinWageModel2.mod](https://forum.dynare.org/uploads/short-url/rsIiJ0QFuSDfISumfckyMdTnGkR.mod) (8.8 KB)  
[MinWageModelSS\_Targets\_Final.m](https://forum.dynare.org/uploads/short-url/rhML2IoTasWWWfFvYSWRrnCVboj.m) (5.0 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: [28 September 2023 10:06 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/2 "2023-09-28T10:06:04Z")

</div>

You forget to set `i_bar`:

> Warning: Some of the parameters have no value (i\_bar) when using steady. If these parameters are not initialized in a  
> steadystate file or a steady\_state\_model-block, Dynare may not be able to solve the model. Note that simul,  
> perfect\_foresight\_setup, and perfect\_foresight\_solver do not automatically call the steady state file.

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [28 September 2023 15:09 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/3 "2023-09-28T15:09:05Z")

</div>

Thank you, I missed that. Attached are the updated files, the issue is now that the matrix is close to singular or badly scaled.

[MinWageModel2.m](https://forum.dynare.org/uploads/short-url/g2Bv1QeZfVq778adqgPBJNgzcUP.m) (5.6 KB)  
[MinWageModel2.mod](https://forum.dynare.org/uploads/short-url/bce9Anp1WtgeUL1x5RnziwRil55.mod) (9.0 KB)  
[MinWageModelSS\_Targets\_Final.m](https://forum.dynare.org/uploads/short-url/3FYjtuU2YrBYe10H1FI8rFeZwgj.m) (5.0 KB)

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [1 October 2023 15:35 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/4 "2023-10-01T15:35:20Z")

</div>

Hello,

I tried to solve the model from the original paper I built the extension to, in order to figure out the issue with my model. However, even for that paper, where the authors solved the model in Matlab, if I use their steady state values as initval block in Dynare I face the same problem with steady state. Would you perhaps have any suggestion why this happens?

I would appreciate any help as I really can’t figure this out. Attached are the relevant codes from their replication package and the .mod file I wrote.

[simplemodelSS\_Targets\_FINAL.m](https://forum.dynare.org/uploads/short-url/1eKCBoTrwfwAeiQkT3UgVSwYS5F.m) (2.8 KB)  
[SM\_FINAL.m](https://forum.dynare.org/uploads/short-url/nLsfqpavg10KTgHTL9FKNghI2hj.m) (36.3 KB)  
[SM\_FINAL.mod](https://forum.dynare.org/uploads/short-url/jA3FAW0NGDjhvKX0uPGtKLJLIjP.mod) (5.4 KB)  
.[Model.pdf](https://forum.dynare.org/uploads/short-url/sbrFCjg23cTHP4c0m9nIHKaezeT.pdf) (2.2 MB)

---

<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 October 2023 10:41 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/5 "2023-10-02T10:41:48Z")

</div>

You did not set an initial value for `s`.

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [2 October 2023 13:17 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/6 "2023-10-02T13:17:29Z")

</div>

Thank you, I added it now but the issue is still the same  
[SM\_FINAL.mod](https://forum.dynare.org/uploads/short-url/mnPAXbyVrdmlXN7gO6OGP5WQIXG.mod) (5.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: [4 October 2023 13:08 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/7 "2023-10-04T13:08:04Z")

</div>

Now you have three equations with residuals. Focus on

```auto
uS=uS(-1)*((1-rhos)*(1-rhoOmega)+n(-1)*(1-rho));
uL=uL(-1)*(1-rhos*sigmaBar)+uS(-1)*(1-rhos)*rhoOmega;

```

Are these correct? The first implies in steady state:

```auto
1=(1-rhos)*(1-rhoOmega)+n*(1-rho);

```

which is violated with your initial values. AT the same time, the bracketing is very different from (A.79) in your linked PDF. At this stage, I would recommend setting up the model with \LaTeX definitions and checking all equations. Mistakes like the one above may cause the steady state not to exist.

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [4 October 2023 13:24 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/8 "2023-10-04T13:24:11Z")

</div>

Thank you very much once again! I am actually not sure, I noticed there are few equations in their simplemodelSS\_Targets\_Final.m file which are not consistent with the linked PDF file. I tried to solve that model in Dynare thinking that would help me figure out the issue with my own model, but it’s not the case.

---

<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: [4 October 2023 13:27 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/9 "2023-10-04T13:27:01Z")

</div>

That’s the tricky part with replications: you don’t know whether the printed equations and the computer code are consistent, and if not, which one is actually correct. But such inconsistencies will typically derail any attempt at finding a steady state.

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [4 October 2023 13:31 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/10 "2023-10-04T13:31:06Z")

</div>

True, but I am not sure how to figure out the issue with my model because there I can check for inconsistencies and it still does not work unfortunately.

---

<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: [4 October 2023 18:17 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/11 "2023-10-04T18:17:28Z")

</div>

Is the file you provided the one you are trying to run?

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [4 October 2023 20:21 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/12 "2023-10-04T20:21:11Z")

</div>

Yes, it’s the file MinWageModel2.m from the [post](https://forum.dynare.org/t/problem-with-the-steady-state/23186/3) above. Here are the updated files (I changed low sector wage to be also determined endogenously rather than exogenously but it did not help):

[MinWageModel.m](https://forum.dynare.org/uploads/short-url/dD9IPIA61uqX3keYqaKDHKjG8pu.m) (6.5 KB)  
[MinWageModel.mod](https://forum.dynare.org/uploads/short-url/gZcDpeide7L1RQbCkvhxrhNypdT.mod) (9.5 KB)  
[MinWageModelSS\_Targets\_Final.m](https://forum.dynare.org/uploads/short-url/bnymgMyqFU1tWzJiN2HnokEK1zP.m) (5.1 KB)  
[Model\_equations.pdf](https://forum.dynare.org/uploads/short-url/4zrzJSDXXMiE0ot7fxlBDjScYMH.pdf) (172.4 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: [5 October 2023 08:07 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/13 "2023-10-05T08:07:02Z")

</div>

Are you even sure that there is a unique steady state for your model? Your model features price levels, which are usually indeterminate in NK models. Only relative prices and inflation are uniquely determined.

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [5 October 2023 08:44 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/14 "2023-10-05T08:44:27Z")

</div>

Yes, there should be. But, maybe that’s the mistake that I wrote all the equations with w/P for instance, instead of substituting it with real terms (w\_r).

---

<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: [5 October 2023 08:46 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/15 "2023-10-05T08:46:53Z")

</div>

Yes, that will definitely be a problem for numerical steady state finding. The steady state will not be unique, because e.g. only the ratio `w/P` is unique, but not the individual components.

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [5 October 2023 08:48 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/16 "2023-10-05T08:48:22Z")

</div>

> [@jpfeifer](#):
>
> es, that will definitely be a problem for numerical steady state finding.

will check it now, thanks!

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [5 October 2023 20:58 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/17 "2023-10-05T20:58:03Z")

</div>

Hi,

I rewrote all the equations but there is an issue with sector price equations due to which Dynare reports that steady state has NaNs or infinite.

[MinWageModel.m](https://forum.dynare.org/uploads/short-url/61USNmMEyzuYdVh8J6OWoQ94Bna.m) (6.4 KB)  
[MinWageModel.mod](https://forum.dynare.org/uploads/short-url/pHzqk4aL6SDrdAi8Lvfad6PSoiB.mod) (9.1 KB)  
[MinWageModelSS\_Targets\_Final.m](https://forum.dynare.org/uploads/short-url/6c7R9zFLI29jP8U04MEya4SDLMm.m) (4.7 KB)  
[Model\_equations\_adj.pdf](https://forum.dynare.org/uploads/short-url/eXa00KLEIdpzV0nqmbg1THAzVg1.pdf) (169.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: [7 October 2023 14:30 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/18 "2023-10-07T14:30:19Z")

</div>

Your file still contains objects like

```auto
P_H/P

```

and you did not initialize those variables.

---

<div class="post-metadata">

### Author: ![Kasper](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@Kasper](https://forum.dynare.org/u/Kasper)
#### Post date: [7 October 2023 15:56 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/19 "2023-10-07T15:56:23Z")

</div>

I actually defined a new variable PH\_P to equal P\_H/P and then initialized those. However, in the optimal price setting equation I have this term varpsi which I can’t set the initial value for:  
 ![image](https://forum.dynare.org/uploads/default/original/3X/9/1/910b111d375f2e511b54ef59ff4946ff6b761f9e.png)

---

<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: [7 October 2023 16:04 UTC](https://forum.dynare.org/t/problem-with-the-steady-state/23186/20 "2023-10-07T16:04:22Z")

</div>

You need to fully replace such terms. With respect to \Psi, you need to alter the recursive representation to eliminate the single price level. Usually, you can just multiply it through on both sides.

[Next page](https://forum.dynare.org/t/problem-with-the-steady-state/23186.md?page=2)
