# Ms-sbvar

Hi all,
I would like to know for which regime the function ms_irf returns the impulse response function. In principle the IRF should be different across regimes, right?
thanks
romain

I think they are reporting the unconditional IRFs. I’d love to know how to get the conditional ones!
Cheers

You can recover the matrix A(st) and F(st) from est_final_file.out to compute the IRFs.

thanks. some of these matrices have the same values across the regimes. i attach here the est_final_file.out i just got from running the following code

var R Pie Y;

varobs Y Pie R;

svar_identification;
lower_cholesky;
end;

markov_switching(chain=1,number_of_regimes=2,duration=2.5);

svar(variances, chain=1);

set_dynare_seed(5);

ms_estimation(datafile=data
,freq=4
,initial_year=1959
,final_year=2005
,nlags=4
,max_repeated_optimization_runs=1
,max_number_of_stages=0
);
ms_simulation(mh_replic=1000);
ms_compute_mdd;
ms_compute_probabilities;
ms_irf;
ms_forecast;
ms_variance_decomposition(no_error_bands);
est_final_test_ms_variances.txt (100 KB)

In your example, you just allow the variance shocks to change over time, so the model’s dynamics will not change (i.e coefficients). In consequence, the transmission mechanisms would be similar across regimes, but the size of shocks (Zeta) will be different.

Stéphane

thanks.
how to set up a model where both the variance and coefficients will be different across the regimes and also the irfs?
thanks a lot

markov_switching(chain=1, number_of_regimes=2,duration=10);
markov_switching(chain=2, number_of_regimes=2,duration=10);
svar(coefficients, chain=1);
svar(variances, chain=2);

The first chain governs regime switches on coefficients, and the second chain (which is independent to the first one) governs regime switches on variance shocks. For more details, look at the Dynare manual.

For synchronized changes, you can do

markov_switching(chain=1, number_of_regimes=2,duration=10);
svar(coefficients, chain=1);
svar(variances, chain=1);

thanks. i have been able to estimate the model with the chain that combines the switch in both the variance et the coefficients. however, i still can not derive the irf of the seperate regime.
is there a way to put the options regime= and regimes of irf in order to recover these regime specific irf?
when i tried to add these options to irf it returns an error message.