# Two shocks shock\_matrix

**URL:** <https://forum.dynare.org/t/two-shocks-shock-matrix/16632>\
**Category:** General DSGE Modeling\
**Created:** [18 September 2020 07:20 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632 "2020-09-18T07:20:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwlf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mwlf](https://forum.dynare.org/u/mwlf)\
**Post date:** [18 September 2020 07:20 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/1 "2020-09-18T07:20:13Z")

</div>

Hello all,

Below I’m sending an adaptation of this example [code](https://github.com/JohannesPfeifer/DSGE_mod/blob/master/RBC_news_shock_model/RBC_news_shock_model.mod) by Prof Pfeifer. I have two shocks (both unanticipated) and I’m trying to understand two very simple things.

i. When I only have a single shock (e\_t), why is the output in the log\_y\_et vector not matching the y\_IRFmodel025csolo output (row 15 for log\_y\_et)? (ps. I can confirm that both systems received the same shock by comparing row 11 to ttau\_et. However, the same is not true for the outcome variables.)

ii. How can I generate a negative shock? I have tried different alternatives, yet I still have the problem of getting different values which confuses me a lot. Should I be changing signs in the .m file or in the shock\_matrix line? (as both again are giving different numbers)

For instance, if I use  
“shock\_matrix(1,strmatch(‘et’,M\_.exo\_names,‘exact’)) = **- 0.5** ”  
I do not think this is really generating me a negative tax shock since output (again row 15 in y\_IRFmodel025csolo) seems to respond negatively to a tax cut. In contrast, when I do the sign flip of the shock in the .m file without the use of shock\_matrix, I get a negative tax shock increasing output, which sounds more right economically.

I appreciate any helps on this, thank you so much for your time and consideration.

Best,  
Ezgi

[ModelC\_order2\_steadystate.m](https://forum.dynare.org/uploads/short-url/ivOPWY2U4jxySoMhDo1rKjuOhkd.m) (2.3 KB) [ModelC\_order2.mod](https://forum.dynare.org/uploads/short-url/aHCQNh94oFUuo1pht1R527xjerQ.mod) (3.3 KB)

---

<div class="post-metadata">

**Author:** ![mwlf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mwlf](https://forum.dynare.org/u/mwlf)\
**Post date:** [19 September 2020 22:25 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/2 "2020-09-19T22:25:23Z")

</div>

Also, I have forgot to phrase that tax shock hits at time t and monetary policy shock hits at time t+10.

Many thanks!

---

<div class="post-metadata">

**Author:** ![mwlf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mwlf](https://forum.dynare.org/u/mwlf)\
**Post date:** [20 September 2020 07:16 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/3 "2020-09-20T07:16:49Z")

</div>

I’ve just noticed the third documents was not uploaded. Please find attached.

[Dynare\_9.17.m](https://forum.dynare.org/uploads/short-url/sAyxl6kYj9jamM3zltLmMHUjRD3.m) (1.9 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 September 2020 08:13 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/4 "2020-09-21T08:13:50Z")

</div>

1. You are using a second order approximation. Dynare will by default use generalized IRFs, i.e. integrate over future shocks. In contrast, `simult_` will only give you one simulation path (where you shut off all future shocks).  
2.Using

```auto
shock_matrix(1,strmatch('et',M_.exo_names,'exact')) = -0.5; % only tax shock.

```

will give you a negative shock of size 0.5.

---

<div class="post-metadata">

**Author:** ![mwlf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mwlf](https://forum.dynare.org/u/mwlf)\
**Post date:** [22 September 2020 14:52 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/5 "2020-09-22T14:52:32Z")

</div>

Thank you Prof. Pfeifer.

On point 1. That clarifies that they are not really comparable. Although, I would have thought they would be comparable in a single, one-off shock setting.

I have one more related question. When I simulate the same shock but opposite sign like

a. shock\_matrix(1,strmatch(‘et’,M\_.exo\_names,‘exact’)) = -0.5;  
b. shock\_matrix(1,strmatch(‘et’,M\_.exo\_names,‘exact’)) = 0.5;

One is a tax cut, and the other is a tax increase. simult\_ returns me the outcome of output _falling_ in both scenarios. On the other hand, stoch\_simult suggest that tax cut would clearly increase output.

Why is simult\_ not generating an output increase as in stoch\_simult? Is there any way to make it do that?

Thank you very much!  
Danke Schon!

---

<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 September 2020 15:40 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/6 "2020-09-22T15:40:54Z")

</div>

1. The GIRF is not a single one-off shock setting.
2. You are plotting IRFs as a deviation from the deterministic steady state, but the system should converge to the stochastic steady state. Thus, your responses look weird. Moreover, your variance are crazy big, if I see it correctly. Note that at `order>1`, you must not scale by 100.

---

<div class="post-metadata">

**Author:** ![mwlf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mwlf](https://forum.dynare.org/u/mwlf)\
**Post date:** [11 October 2020 23:26 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/7 "2020-10-11T23:26:58Z")

</div>

Dear Prof Pfeifer,

Thank you for the clarification. Indeed, lowering the variance scale has helped a lot with the impulse responses.

Is it possible to plot IRF as a deviation from stochastic steady state? I would like to compare them to the deterministic versions.

Best regards,

---

<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:** [12 October 2020 11:46 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/8 "2020-10-12T11:46:06Z")

</div>

See [https://github.com/JohannesPfeifer/DSGE\_mod/blob/master/Basu\_Bundick\_2017/Basu\_Bundick\_2017.mod](https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Basu_Bundick_2017/Basu_Bundick_2017.mod)

---

<div class="post-metadata">

**Author:** ![mwlf](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e480ec/32.png) [@mwlf](https://forum.dynare.org/u/mwlf)\
**Post date:** [12 January 2021 18:14 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/9 "2021-01-12T18:14:06Z")

</div>

Dear Prof Pfeifer,

The code was very helpful, thank you so much. I have a generic follow-up question on this exercise. When I do a tax cut and a tax increase using second order approximation, I get a much larger effectiveness of a tax increase than a tax cut. Is there a simple explanation why this might be the case?

Best,

---

<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:** [12 January 2021 20:28 UTC](https://forum.dynare.org/t/two-shocks-shock-matrix/16632/10 "2021-01-12T20:28:08Z")

</div>

I am not aware of a simple explanation beyond the generic “nonlinearities may matter”.
