Is it correct that you take into account dummies twice during estimation of markov-switching bayesian VAR: in fn_rnrprior_covres_dobs.m and in fn_rlrpostr.m (inside function ms_sbvar_setup() from ms_estimation)? It seems to me that dummies should appear only in likelihood function but not in prior. Otherwise, it’s double counting.
Thank you

According to Sims/Waggoner/Zha (2008): Methods for inference in large multiple-equation Markov-switching models the dummy observations are part of the prior, not of the likelihood. As such, they should appear in the prior and in the posterior as the posterior is likelihood times prior, where the latter includes the dummy observations.

As far as I understand, we specify dummies in such a way that it doedn’t matter where we add dummies (as part of prior or part of likelihood) cause posterior unchanged. But you add them twice - in prior (here: fn_rnrprior_covres_dobs.m) and in likielihood (cause you take variable ‘xtx’ from output of function fn_dataxy() which calculated using dummies).

And one more question - could you please give me code of function (or whatever it is) ‘ms_sbvar_command_line()’? Cause Dynare folder has only mex-files with this name.

We looked into this issue and Dynare’s treatment is correct. You are right that using the dummy variables twice would be wrong. But the way Dynare calls fn_dataxy it will always pass indxDummy=0
thus making sure the likelihood is not affected by dummy observations, which only enter the prior.

As a simple way to check this, look at the file init_<>.dat, you can see that data (and so the likelihood) are not affected by the dummies!

There is no Matlab version for the file ‘ms_sbvar_command_line’. To see how it has been built in Mex, you need to look at the C/C++ code, which is available in the source code.