# Ms-bvar

Hi there,
I am trying to estimate and simulate a Markov-Switching Bayesian VAR model à la Sims, Waggoner and Zha (2008). I took the DH10.mod which is provided by dynare as an example file. However, the IRF and the variance decomposition look quite strange (there are even 3 lines when I have two states) and the results do not resemble at all like they have in their paper (no hump shape etc.) In addition, Dynare does not give me the error bands when I type in ms_irf(error_band_percentiles = [0.1 0.5 0.9]). Is there anything wrong with the code? My second question is how to implement state dependence of both, coefficients/intercepts and the variance? Is this straightforward with Dynare? Can I directly get the output files / graphs for the smoothed state probabilities for both the shock variances and the coefficients and intercepts?

Best,

Björn
DH10.mod (792 Bytes)

I have the same question. I appreciate anybody’s help.

Could you tell me which version of Dynare are you using ? I know that there is some problem in 4.3.0 for doing IRFs but I have no idea if this problem still exists for the unstable version.

What you can also do is to recover the draws in simulation_name_of_your_file.out and then for each draw, you can compute the IRFs. This is a little bit painful as you have to write a code that transforms these draws (through Ui, Vi and Wi matrix) into a matrix form A and F, where y_t’.A = x_t’F + epsilon. See Sims, Waggoner and Zha (2008) for more details.

To allow variances and coefficients to follow the same Markov-switching process, you can do:

markov_switching(chain=1, number_of_states=2, duration=6.5);
svar(variances, chain=1);
svar(coefficients, chain=1);

To allow variances and coefficients to follow two independent Markov-switching processes:

markov_switching(chain=1, number_of_states=2, duration=6.5);
markov_switching(chain=2, number_of_states=2, duration=6.5);
svar(variances, chain=1);
svar(coefficients, chain=2);

Stéphane