# Regime switching based on volatility

**URL:** https://forum.dynare.org/t/regime-switching-based-on-volatility/6338
**Category:** Stochastic simulations
**Created:** [7 July 2017 16:42 UTC](https://forum.dynare.org/t/regime-switching-based-on-volatility/6338 "2017-07-07T16:42:27Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![dynare\_question](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/858c86/32.png) [@dynare\_question](https://forum.dynare.org/u/dynare_question)
#### Post date: [16 August 2017 21:42 UTC](https://forum.dynare.org/t/regime-switching-based-on-volatility/6338/8 "2017-08-16T21:42:53Z")

</div>

Dear Johannes,

Thank you so much for all your help. Highly appreciated. Unfortunately, I still cannot produce the results I want. Couple of issues:

1. In your code ([https://sites.google.com/site/pfeiferecon/RBC\_state\_dependent\_GIRF.mod?attredirects=0](https://sites.google.com/site/pfeiferecon/RBC_state_dependent_GIRF.mod?attredirects=0)), you define shocks\_baseline and shocks\_impulse. What is the purpose of the shocks\_baseline? If I just want to calculate the GIRFs of output to a government expenditure shock, do I need to have in the IRF\_mat only (y\_shock) or the difference (y\_shock-y\_baseline)?

2. Following your suggestions and if my understanding is correct, I specified the size of the government shock in the part where I calculate the GIRFs (setting it equal to 1). Then, when I change the value of the variance of the volatility shock in the shock block (i.e. the shock distribution), the simulated series are almost the same regardless if the value of the volatility shock is high or low. The simulated series can be accessed in the matlab folder GIRF\_positive (I am following the names of your original code). Is that correct? If so, I don’t know what I am doing wrong to be getting the same simulations regardless of the shock distribution I specify. I am attaching my code.

Thank you in advance!

[king\_rebelo3.mod](https://forum.dynare.org/uploads/default/original/2X/5/588042d716b6e7765397310efeca47615e32ad94.mod) (8.1 KB)

---

_[View the full topic](https://forum.dynare.org/t/regime-switching-based-on-volatility/6338)._
