MSTest: An R-Package for Testing Markov Switching Models

Available as: PDF

We present the R package MSTest, which implements hypothesis testing procedures to determine the number of regimes in Markov switching models. These models have wide ranging applications in economics, finance, and many other fields. MSTest provides several testing frameworks, including Monte Carlo likelihood ratio tests (Rodriguez-Rondon and Dufour (2025)), moment-based tests (Dufour and Luger (2017)), parameter stability tests (Carrasco et al. (2014)), and classical likelihood ratio procedures (Hansen (1992)). In addition, the package offers tools for simulating and estimating univariate and multivariate Markov switching and hidden Markov models using either the expectation–maximization algorithm or maximum likelihood estimation. The functionality of the package is demonstrated through simulation-based examples.

DOI: https://doi.org/10.34989/swp-2026-7