# There is 3 colinear relationships between the variables and the equations

**URL:** https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814
**Category:** Stochastic simulations
**Created:** [21 December 2023 19:32 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814 "2023-12-21T19:32:40Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [21 December 2023 19:32 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/1 "2023-12-21T19:32:40Z")

</div>

Hi,  
Referring to the code provided by Iacoviello (2005), I made a complete copy myself. The only difference is that I use the logarithmic form. When I simulate, the pulse image of order=1 is exactly the same as that of the author, but when order=2, my model no longer outputs an image, and displays “there is 3 colinear relationships between the variables and the equations” when using the model\_diagnostics command. I really can’t tell the difference between my code and the original author’s code, can anyone help me? The code I copied myself is below. As it is not clear whether the website allows me to upload Iacoviello code, I will not provide this file for the time being. If the site allows it or you do not know the author’s code, I can share it with you.  
Thanks a lot！

---

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [21 December 2023 19:33 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/2 "2023-12-21T19:33:28Z")

</div>

[model.zip](https://forum.dynare.org/uploads/short-url/gTvAVEMT3hvMNOkXXlbeWwIKtCK.zip) (3.3 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 December 2023 08:47 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/3 "2023-12-22T08:47:04Z")

</div>

Why are you even doing a full exp()-substitution. It’s usually better to append auxiliary equations. See

> [@Question about understanding irfs in dynare](https://forum.dynare.org/t/question-about-understanding-irfs-in-dynare/10622/4):
>
> To be more precise: it depends on how the variables in your model are measured. As @stepan-a says, Dynare conducts a linearization. If you for example have a nonlinear model and your model variable is simply the level of output, the IRF will measure the difference between the variable and its steady state (or its mean at higher order). This is the case with [https://github.com/DynareTeam/dynare/blob/master/examples/example1.mod](https://github.com/DynareTeam/dynare/blob/master/examples/example1.mod) In contrast, if your model variable already measures percentage…

---

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [22 December 2023 10:09 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/4 "2023-12-22T10:09:40Z")

</div>

Thanks so much for your reply, Dr. Jpfeifer! I’m going to try your recommended method. In addition, I would like to ask, will doing a full exp ()-substitution have any problems with the simulation compared with the original model?

---

<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 December 2023 10:11 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/5 "2023-12-22T10:11:18Z")

</div>

If done correctly, it will not affect the simulation at all. But it’s a very error-prone process.

---

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [22 December 2023 14:52 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/6 "2023-12-22T14:52:11Z")

</div>

Dr. Jpfeifer , I no longer use full exp ()-substitution, and then build a new model as shown below, but the collinearity problem still exists, and it seems that there are other problems.

---

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [22 December 2023 14:52 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/7 "2023-12-22T14:52:34Z")

</div>

[model2.zip](https://forum.dynare.org/uploads/short-url/6shKoxHMeSb6C1WtSOobpnkXui7.zip) (3.2 KB)

---

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [22 December 2023 22:11 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/8 "2023-12-22T22:11:22Z")

</div>

Dr. Jpfeifer , after my constant adjustment, the model is no longer linear. The new model is shown below. I found that the problem mainly appeared in three equations. The first is the monetary policy equation. The original equation is

```auto
(R) / (steady_state (R)) = ((R (- 1)) / (steady_state (R)) ^ rhoR* ((ppai)) ^ ((1-rhoR) * rhopai) * (Y) / (steady_state (Y)) ^ ((1-rhoR) * rhoy) * (exp (epsipai)) * (steady_state (ppai)) ^ (- (1-rhoR) * rhopai

```

The new equation is

```auto
(R) / (steady_state (R)) = ((R (- 1)) / (steady_state (R) ^ rhoR* ((ppai)) ^ ((1-rhoR) * rhopai) * ((Y) / (steady_state (Y) ^ ((1-rhoR) * rhoy) * (exp (epsipai)) * (steady_state (ppai)) ^ (- 1+rhoR)

```

By changing the monetary policy equation, the model reduces a linear relationship. The difference between the two equations is that the corresponding parameters of the steady state of inflation are different. Then I lost two equations: etap=steady\_state (etap) and etapp=steady\_state (etapp). At this point, the new model can be verified by the model\_diagnostics command.  
Although I have solved the problem, I am still not quite sure what the underlying cause is. Why can I optimize the model with such a change? And even if it does not change, the model can still run normally when order=1, and the simulation results are consistent with the new model.

---

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [22 December 2023 22:12 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/9 "2023-12-22T22:12:53Z")

</div>

[model3.zip](https://forum.dynare.org/uploads/short-url/mdsRbB2Fx1CgxFMIhS4l1i9QfYa.zip) (3.2 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: [27 December 2023 09:46 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/10 "2023-12-27T09:46:22Z")

</div>

Have a look at

> [@Levels versus Growth Rates](https://forum.dynare.org/t/levels-versus-growth-rates/5652/8):
>
> You are confusing something. If collinearity arises after using the steady\_state operator, what you have done is exactly to remove the capability of the model to determine the steady state of that variable as a function of the parameters. Take again the example of the Fisher equation and steady state inflation. If you exogenously provide the steady state inflation pibar (which cannot be endogenously determined), you can endogenously compute the steady state nominal interest as the product of re…

---

<div class="post-metadata">

### Author: ![wenzhuo](https://forum.dynare.org/letter_avatar_proxy/v4/letter/w/f9ae1b/32.png) [@wenzhuo](https://forum.dynare.org/u/wenzhuo)
#### Post date: [27 December 2023 20:58 UTC](https://forum.dynare.org/t/there-is-3-colinear-relationships-between-the-variables-and-the-equations/24814/11 "2023-12-27T20:58:56Z")

</div>

Thanks a lot！
