# Jacobian of the static model is singular and contains elements that are not real or are infinite

**URL:** <https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645>\
**Category:** Macroeconomic Model Data Base\
**Created:** [14 January 2022 16:47 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645 "2022-01-14T16:47:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![marimtched](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@marimtched](https://forum.dynare.org/u/marimtched)\
**Post date:** [14 January 2022 16:47 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/1 "2022-01-14T16:47:51Z")

</div>

[tviniwaigo.mod](https://forum.dynare.org/uploads/short-url/q9qj7jVEnJEDiwpSEHY6V6ryJvC.mod) (1.0 KB)

It seems like that we have written everything correctly, but code still does not work.  
It tells us that the Jacobian of the static model is singular and the Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite.  
Could you please anyone look at our code and tell us what is wrong with this code?

---

<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:** [14 January 2022 18:55 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/2 "2022-01-14T18:55:39Z")

</div>

Execute

```auto
alpha = 0.4;
beta = 0.95;
sigma = 1;
delta = 0.1;
chi = 2;
rho = 0.95;
Ass=1;
Css=((((1+beta*delta-beta)/(alpha*beta)^(alpha/(alpha-1)))*(1-alpha))/chi)^(1/delta);
Kss=Css/(((1+beta*delta-beta)/(alpha*beta))-delta);
Lss=Css/((1+beta*delta-beta)/(alpha*beta))^(alpha/(alpha-1))-delta*((1+beta*delta-beta)/(alpha*beta))^(1/(alpha-1));
Yss=(Css/(((1+beta*delta-beta)/(alpha*beta))-delta))^alpha*(Css/((1+beta*delta-beta)/(alpha*beta))^(alpha/(alpha-1))-delta*((1+beta*delta-beta)/(alpha*beta))^(1/(alpha-1)))^(1-alpha);

```

in Matlab to see that these values do not make sense. They are essentially 0. Also, delete the initval-block. In a linearized model, the steady states are 0.

---

<div class="post-metadata">

**Author:** ![marimtched](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@marimtched](https://forum.dynare.org/u/marimtched)\
**Post date:** [14 January 2022 19:28 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/3 "2022-01-14T19:28:03Z")

</div>

Even if we delete initval-block it gives us same problem. We also tried to change the values of parameters, but it still writes that Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite.

---

<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:** [14 January 2022 20:29 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/4 "2022-01-14T20:29:27Z")

</div>

I am pretty sure that there is a mistake somewhere in

```auto
Css=((((1+beta*delta-beta)/(alpha*beta)^(alpha/(alpha-1)))*(1-alpha))/chi)^(1/delta);
Kss=Css/(((1+beta*delta-beta)/(alpha*beta))-delta);
Lss=Css/((1+beta*delta-beta)/(alpha*beta))^(alpha/(alpha-1))-delta*((1+beta*delta-beta)/(alpha*beta))^(1/(alpha-1));
Yss=(Css/(((1+beta*delta-beta)/(alpha*beta))-delta))^alpha*(Css/((1+beta*delta-beta)/(alpha*beta))^(alpha/(alpha-1))-delta*((1+beta*delta-beta)/(alpha*beta))^(1/(alpha-1)))^(1-alpha);

```

These values do not make sense.

---

<div class="post-metadata">

**Author:** ![marimtched](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@marimtched](https://forum.dynare.org/u/marimtched)\
**Post date:** [14 January 2022 20:59 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/5 "2022-01-14T20:59:19Z")

</div>

We were asked to express these values by the Kss/Lss and in order to make it simpler we just plugged the value of Kss/Lss .

---

<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:** [14 January 2022 22:28 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/6 "2022-01-14T22:28:44Z")

</div>

But why is Css equal to 0?

---

<div class="post-metadata">

**Author:** ![marimtched](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@marimtched](https://forum.dynare.org/u/marimtched)\
**Post date:** [15 January 2022 00:44 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/7 "2022-01-15T00:44:45Z")

</div>

Yeap, i found mistake in the second equation (Css), instead of 1/sigma I wrote 1/delta. However, not it has a problem with a whole model. It says that it is impossible to find the steady state (the sum of square residuals of the static equations is 0.0003). Either the model doesn’t have a steady state or there are an infinity of steady states Check whether your model is truly linear or whether there is a mistake in linearization. I am trying to find mistake in linearizing but I could not find any of it. Moreover, we found linearized versions of our equations in YouTube and it is the same.

---

<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:** [15 January 2022 07:46 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/8 "2022-01-15T07:46:59Z")

</div>

Please provide the updated file.

---

<div class="post-metadata">

**Author:** ![marimtched](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@marimtched](https://forum.dynare.org/u/marimtched)\
**Post date:** [15 January 2022 10:12 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/9 "2022-01-15T10:12:04Z")

</div>

[updated.mod](https://forum.dynare.org/uploads/short-url/g55dzmMOvsw6yxztYDJwAEEJkRC.mod) (1.1 KB)  
This is updated file.

---

<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:** [15 January 2022 10:28 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/10 "2022-01-15T10:28:58Z")

</div>

I am not sure what you are doing. `Yss` is complex, so there must be a mistake in that equation.

```auto
sigma*Css = A+alpha*(K(-1)-L);

```

is not a proper linearization. It may be

```auto
sigma*Css*C = A+alpha*(K(-1)-L);

```

Check out  
[updated.mod](https://forum.dynare.org/uploads/short-url/3AxQIOv4pt78ZSixptDchSExXNR.mod) (953 Bytes)

---

<div class="post-metadata">

**Author:** ![marimtched](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/ba8739/32.png) [@marimtched](https://forum.dynare.org/u/marimtched)\
**Post date:** [15 January 2022 11:06 UTC](https://forum.dynare.org/t/jacobian-of-the-static-model-is-singular-and-contains-elements-that-are-not-real-or-are-infinite/19645/11 "2022-01-15T11:06:25Z")

</div>

Thanks a lot, yeap there is a typo in sigma_Css_C = A+alpha\*(K(-1)-L); and I simply wrote Yss=Css-delta\*Kss. Now it works perfectly.  
Thanks a lot, again.
