The repository contains code used in the following paper:
by Kjartan Kloster Osmundsen, Tore Selland Kleppe & Atle Oglend.
The code fits a Markov-switching vector autoregressive model to data input. The user can specify the data, number of regimes and number of autoregressive terms. The regimes can be applied to the mean structure and/or the covariance structure.
The code assumes that the R-packages rstan and coda are installed (and rstudioapi if you are using Rstudio).