# No second moments

**URL:** https://forum.dynare.org/t/no-second-moments/13109
**Category:** Stochastic simulations
**Created:** [17 January 2019 18:30 UTC](https://forum.dynare.org/t/no-second-moments/13109 "2019-01-17T18:30:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![azeem](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@azeem](https://forum.dynare.org/u/azeem)
#### Post date: [17 January 2019 18:30 UTC](https://forum.dynare.org/t/no-second-moments/13109/1 "2019-01-17T18:30:36Z")

</div>

Hello

I have coded an RBC model with financial friction. I can run the code and get the IRFs but I cannot get the second moments. Instead I get dynare message ‘All endogenous are constant or non stationary, not displaying correlations and auto-correlations’.

Can anyo ne please point out why this may be?

[simsopen.mod](https://forum.dynare.org/uploads/default/original/2X/1/1315230312d2f660e9357305a6b0bc161505067f.mod) (2.7 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: [18 January 2019 05:35 UTC](https://forum.dynare.org/t/no-second-moments/13109/2 "2019-01-18T05:35:55Z")

</div>

When you set `irf=2000`, you will see that your financial shock has permanent effects. Thus, there is a unit root in your model and the unconditional second moments do not exist. As Dynare says, all variable are non-stationary

---

<div class="post-metadata">

### Author: ![azeem](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@azeem](https://forum.dynare.org/u/azeem)
#### Post date: [18 January 2019 11:17 UTC](https://forum.dynare.org/t/no-second-moments/13109/3 "2019-01-18T11:17:14Z")

</div>

Dear Pfeifer,

Thanks for your response.

I do not see your point in my code. The IRFs are set to 20 periods (irf=20). Therefore what do you think might be the problem with the code causing non-stationary variables?

---

<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 January 2019 12:11 UTC](https://forum.dynare.org/t/no-second-moments/13109/4 "2019-01-18T12:11:54Z")

</div>

If you set `irf=2000` you will see that the IRFs do not go back to 0 for your financial shock. You need to find out where this comes from.

---

<div class="post-metadata">

### Author: ![azeem](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/43a26b/32.png) [@azeem](https://forum.dynare.org/u/azeem)
#### Post date: [18 January 2019 13:35 UTC](https://forum.dynare.org/t/no-second-moments/13109/5 "2019-01-18T13:35:08Z")

</div>

Thank you Professor. I do see your point now. I will have a look now. Once again thanks.
