# Problem finding the steady state

**URL:** https://forum.dynare.org/t/problem-finding-the-steady-state/22930
**Category:** Steady state
**Created:** [16 August 2023 17:57 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930 "2023-08-16T17:57:54Z")
**Posts on this page:** 18
**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: [16 August 2023 17:57 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/1 "2023-08-16T17:57:54Z")

</div>

Hello,

I am working on a general equilibrium model with heterogeneous agents and search frictions, which I extended to incorporate labor participation decision. However, I have an issue with finding the steady state. I tried simplifying my model but the problem persists. I would appreciate any help.

[Model\_Simple.pdf](https://forum.dynare.org/uploads/short-url/k8enqDJTQJGUVc8dC8UnQnfKmAN.pdf) (154.8 KB)  
[Model.m](https://forum.dynare.org/uploads/short-url/g9D0QFPix83TLhg9By5VLlYHzLB.m) (3.6 KB)  
[Model.mod](https://forum.dynare.org/uploads/short-url/j48Zbz1uf0r9ZIDTo7eIbgWkpGL.mod) (5.5 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: [17 August 2023 07:34 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/2 "2023-08-17T07:34:41Z")

</div>

You need to set `tau_ss`. Then focus on the few equations with residuals.

---

<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: [17 August 2023 10:53 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/3 "2023-08-17T10:53:08Z")

</div>

Thank you, Prof. Pfeifer. tau\_ss is actually set, so I am not sure why Dynare reports that it has no value when using steady.

---

<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: [18 August 2023 07:25 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/4 "2023-08-18T07:25:33Z")

</div>

No, you commented out the respective line.

---

<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: [19 August 2023 14:47 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/6 "2023-08-19T14:47:35Z")

</div>

Apologies for not noticing that. I’ve been working on the equations, and the issue I am having now is that Blanchard and Kahn conditions are not satisfied: There are 17 eigenvalue(s) larger than 1 in modulus for 20 forward-looking variable(s). I don’t see any timing mistakes in the code - could it have to do with the calibration of some exogenous parameters?

Also, even though I calibrate b\_bar\_ss to target the relative consumption of unemployed to employed workers of 0.72, I obtain lower steady state value for the consumption of the employed relative to that of the unemployed. I am not sure why this is so - would you maybe have any suggestion how to fix it?

[Model.m](https://forum.dynare.org/uploads/short-url/8YpTimzyJuUhq2SeYXoIKbxhshv.m) (4.0 KB)  
[Model.txt](https://forum.dynare.org/uploads/short-url/uuPLi37dEC4fWLxhg0ob67VgIG0.txt) (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: [21 August 2023 07:20 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/7 "2023-08-21T07:20:40Z")

</div>

There is definitely a problem with the timing of your predetermined state variables, e.g.

```auto
% asset market equilibrium
b(+1)/P=b_bar;
a(+1)/P=b_bar;

```

looks wrong, because those conditions should not just hold in expectations.

---

<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: [21 August 2023 09:12 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/8 "2023-08-21T09:12:00Z")

</div>

You’re right, thank you so much! Another issue was with the Taylor rule, so the code works now.

However, some steady state values do not make much sense so I was trying to see what happens as I change some parameters. But, the code seems quite sensitive to the calibration. For instance, if I set the steady state job finding probability fs\_ss to 0.4 instead of 0.3, it reports again the indeterminacy problem. Do you know why this could happen?

Also, I still can’t figure out why @Findbbar function does not work in my .m file. Would appreciate any suggestion.

Thanks again.

[Model.m](https://forum.dynare.org/uploads/short-url/cJXdQgCQyaVdcKJ5XWcIANx5QSY.m) (4.0 KB)  
[Model.mod](https://forum.dynare.org/uploads/short-url/yrHba5F4vvxs31NVbeDaU4hEUUc.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: [22 August 2023 09:25 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/9 "2023-08-22T09:25:17Z")

</div>

1. This most probably still suggests a problem with your model.
2. What you mean with “does not work”? What is the issue?

---

<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: [22 August 2023 10:58 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/10 "2023-08-22T10:58:45Z")

</div>

1. Yes, seems so. With lower values for the steady state labor participation rate (l\_ss) and unemployment benefit (tau\_u), the code runs fine. However, I still experience the same steady state problem if I work on the code for the complete model with 2 sectors, so not sure if this could also be due to calibration, but can’t figure it out yet.

2. I wanted to calibrate b\_bar\_ss to to target the relative consumption of unemployed (c\_u\_ss) to employed workers (c\_e\_ss) of 0.72. However, when I run the .m file, b\_bar\_ss simply corresponds to the guessed value and the ratio c\_u\_ss/c\_e\_ss does not equal 0.72.

---

<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: [23 August 2023 06:50 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/11 "2023-08-23T06:50:07Z")

</div>

Your `Findbbar`-function takes `x` as an argument but never uses that argument.

---

<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: [23 August 2023 08:10 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/12 "2023-08-23T08:10:39Z")

</div>

Thank you, I corrected that but it is still the same.

[Model.m](https://forum.dynare.org/uploads/short-url/4r01LpYptW7nAAYLARcAvE41du.m) (4.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: [23 August 2023 08:18 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/13 "2023-08-23T08:18:27Z")

</div>

But the message says:

> Equation solved. The final point is the initial point. The sum of squared function values,  
> r = 0.000000e+00, is less than sqrt(options.FunctionTolerance) = 1.000000e-03. The relative norm  
> of the gradient of r, 0.000000e+00, is less than 1e-4\*options.FunctionTolerance = 1.000000e-10.

---

<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: [23 August 2023 08:40 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/14 "2023-08-23T08:40:33Z")

</div>

Yes, but the obtained ratio c\_u\_ss/c\_e\_ss is not equal to 0.72. Maybe I am missing something, but it seems the only way to obtain c\_u\_ss \< c\_e\_ss is by changing unemployment benefit tau\_u, whereas Findbbar-function has no role.

---

<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: [23 August 2023 09:36 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/15 "2023-08-23T09:36:16Z")

</div>

That seems to be a problem in `fsolve`. None of the global variables are correctly declared in initialized. Try  
[Model25.m](https://forum.dynare.org/uploads/short-url/7ZuX9hnnMIP98U2cdRmOlNSq8r5.m) (4.1 KB)

P.S.: from the numbering on my computer, you can see why you should not name your model `Model.m`.

---

<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: [23 August 2023 12:31 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/16 "2023-08-23T12:31:55Z")

</div>

I see, thank you very much for all the help!

---

<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: [25 August 2023 18:11 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/17 "2023-08-25T18:11:40Z")

</div>

Hi Prof. Pfeifer,

I have one more question, as I am still having troubles with the code. Dynare reports steady state issue whenever the steady state level of consumption of the employed is calibrated to be larger than that of the unemployed. As long as it is smaller, the code works, even though it does not make much sense. I can’t figure out why this happens. Do you think this could have something to do with some of other parameters, as I don’t see what could be wrong with the model?

Thank you once again!

---

<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 August 2023 21:16 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/18 "2023-08-26T21:16:15Z")

</div>

Such things are hard to debug. I can only give you the generic advice to simplify the model and check when the problem appears.

---

<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: [27 August 2023 11:49 UTC](https://forum.dynare.org/t/problem-finding-the-steady-state/22930/19 "2023-08-27T11:49:37Z")

</div>

Thank you, I already simplified it but don’t see what the issue is. Thank you for all the help!
