# Dynare code for DSGE-model news shock

**URL:** <https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863>\
**Category:** Stochastic simulations\
**Created:** [19 May 2018 11:01 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863 "2018-05-19T11:01:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![thax](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/b77776/32.png) [@thax](https://forum.dynare.org/u/thax)\
**Post date:** [19 May 2018 11:01 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/1 "2018-05-19T11:01:29Z")

</div>

Dear community,

I am new to dynare and therefore my question may be to straightforward:  
I want to simulate a negative technology news shock in the classical DSGE-model which happens after 4 periods. I belive, this shock will lead to a drop of the natural interest rate. That is my ultimate goal at the end of the simulation.  
What do I need to change if I use the exact Gali 2008 model: [https://github.com/JohannesPfeifer/DSGE\_mod/blob/master/Gali\_2008/Gali\_2008\_chapter\_3.mod](https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Gali_2008/Gali_2008_chapter_3.mod)  
Which equations and which definitions have to be replaced or added to the model?

Thank you so much for your help!

---

<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:** [19 May 2018 13:40 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/2 "2018-05-19T13:40:06Z")

</div>

You need to replace  
`a=rho_a*a(-1)+eps_a;`  
by  
`a=rho_a*a(-1)-eps_a(-4);`

---

<div class="post-metadata">

**Author:** ![thax](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/b77776/32.png) [@thax](https://forum.dynare.org/u/thax)\
**Post date:** [19 May 2018 13:46 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/3 "2018-05-19T13:46:48Z")

</div>

Dear Mr Pfeifer,

thank you very much! It worked as I have expected.

Very best

---

<div class="post-metadata">

**Author:** ![thax](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/b77776/32.png) [@thax](https://forum.dynare.org/u/thax)\
**Post date:** [29 May 2018 16:43 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/4 "2018-05-29T16:43:58Z")

</div>

Dear Mr Pfeifer,

I implemented the shock and it worked as it should. The thing is, I hoped the natural interest rate would sink, when implementing the technology news shock. Unfortunatly, it sinks for as long as the shock is only anticipated, but when it happens, the natural interest rate goes up again. What do I need to alter in the model and in the code to make the natural interest rate stay at a level below zero for some periods longer,even better for a long time?  
Thank you so much!

---

<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:** [29 May 2018 18:48 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/5 "2018-05-29T18:48:59Z")

</div>

You need to think about the intuition behind the IRFs. An anticipated technology shock means that it makes sense to not work today when technology is low. That means equilibrium labor should be low today and high in the future (substitution effect). At the same time, there should be an income effect: agents consume more of the consumption good and of leisure. However, we know that once TFP goes up, consumption will jump up. That means the consumption path is increasing. The Euler equations then requires a higher interest rate (above the rate of time preference). Those effects should determine the movement of the interest rate in the flex-price economy.

---

<div class="post-metadata">

**Author:** ![thax](https://forum.dynare.org/letter_avatar_proxy/v4/letter/t/b77776/32.png) [@thax](https://forum.dynare.org/u/thax)\
**Post date:** [30 May 2018 11:07 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/6 "2018-05-30T11:07:54Z")

</div>

Thank you for your answer!  
does this mean, that the natural interest rate will be only low while the individuals expect the technology to drop? Would an additional expansionary monatary policy shock (simultainously with the negative technology news shock) keep the natural interest rate down? I belive, expansionary monatary policy should enhance the effect of a low natural interest rate even after the actual negative technology shock has taken place. How do I combine this shocks in dynare for them to happen at the same time?  
Thanks 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:** [2 June 2018 18:01 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/7 "2018-06-02T18:01:50Z")

</div>

It’s not my model so I have no idea what is going on in your model. I only pointed out that you should think hard about the economics of the problem and provided you with my understanding of what would happen after a positive news shock about TFP in an RBC model .

---

<div class="post-metadata">

**Author:** ![vd111](https://forum.dynare.org/letter_avatar_proxy/v4/letter/v/49beb7/32.png) [@vd111](https://forum.dynare.org/u/vd111)\
**Post date:** [21 August 2025 13:47 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/8 "2025-08-21T13:47:52Z")

</div>

![Image1](https://forum.dynare.org/uploads/default/original/3X/9/d/9d86872573337f5cf082fd95ba5c170c1dd91db8.png)  
Hello,  
Would this be an accurate understanding of news shocks for analytical purposes?

---

<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 2025 07:01 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/9 "2025-08-22T07:01:53Z")

</div>

If X is an exogenous process, yes.

---

<div class="post-metadata">

**Author:** ![vd111](https://forum.dynare.org/letter_avatar_proxy/v4/letter/v/49beb7/32.png) [@vd111](https://forum.dynare.org/u/vd111)\
**Post date:** [23 August 2025 19:00 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/10 "2025-08-23T19:00:30Z")

</div>

Thank you very much, @jpfeifer - I did have an exogenous process in mind.

 ![News](https://forum.dynare.org/uploads/default/original/3X/1/6/169a3ebb51da3f01e115a1315ee7018fec27f1ae.png)

Again for analytical understanding, for a stationary AR(1) process, iterated forward N periods, would it be correct to understand that the second part of the RHS would capture news shocks known at t, while the first term would capture the surprise shock?

---

<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 2025 07:48 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/11 "2025-08-26T07:48:32Z")

</div>

Your timing here looks strange. What does the time index represent? The news shock literature typically employs it to indicate the information set. In that case, it would be something more like

X\_t+n=…+\varepsilon\_{t-k}

because the shock was already known k periods in the past but it only affects the variable now.

---

<div class="post-metadata">

**Author:** ![vd111](https://forum.dynare.org/letter_avatar_proxy/v4/letter/v/49beb7/32.png) [@vd111](https://forum.dynare.org/u/vd111)\
**Post date:** [27 August 2025 18:02 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/12 "2025-08-27T18:02:10Z")

</div>

Thank you for your reply @jpfeifer, and apologies, I didn’t state my question and notation very clearly earlier. I’ll give it a go again:

Consider a stationary AR(1) process,  
X\_t = \rho X\_{t-1} + \varepsilon\_{t-k} for k \geq 0  
where k=0 would be a surprise shock and k\>0 would be a news shock.

If we iterate it forward N periods, we would get:

X\_{t+N} = \rho^N X\_t + \sum\_{j=1}^{k-1} \rho^{N-j} \varepsilon\_{t + j - k} for k \geq 1, where we assume the surprise shock at k=0 is already embedded in the current state to prevent double counting.

I’m interested in Y\_t = E\_t [X\_{t+N}-X\_t] to see how surprise and news shocks in X affect Y\_t.

So, E\_t[X\_{t+N}-X\_t] = (\rho^N-1) X\_t + \sum\_{j=1}^{k-1} \rho^{N-j} \varepsilon\_{t + j - k}.

Am I correct in understanding that:

1. impact of surprise shock would be (\rho^N-1)X\_t
2. impact of a news shock known at t, but to be realised after t, would be E\_t[\rho^{N-j} \varepsilon\_{t + j - k}]=\rho^{N-j}\varepsilon\_{t + j - k} as these are known values
3. and impact of news shocks realised at or before t would be (\rho^N-1)X\_t as it is already included in current state X\_t?

I’d appreciate your help with this.

---

<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:** [29 August 2025 11:33 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/13 "2025-08-29T11:33:38Z")

</div>

Yes, that seems correct and essentially is a way to compute the MA representation to do a shock decomposition.

---

<div class="post-metadata">

**Author:** ![vd111](https://forum.dynare.org/letter_avatar_proxy/v4/letter/v/49beb7/32.png) [@vd111](https://forum.dynare.org/u/vd111)\
**Post date:** [31 August 2025 16:29 UTC](https://forum.dynare.org/t/dynare-code-for-dsge-model-news-shock/11863/14 "2025-08-31T16:29:01Z")

</div>

Right, I was less sure of my interpretation from the MA representation - thank you very much for your help.
