- Use the "dtmc" function to define the regimes with a transition matrix specifying switching probabilities.
- Define submodels for each regime using "arima" to create autoregressive models like AR(2) and AR(1).
- Combine the submodels and the Markov chain into a single model using the "msVAR" function.
- Regine-Switching Models: https://mathworks.com/help/releases/R2024a/econ/regime-switching-models.html
- Markov-Switching Dynamic Regression Models: https://mathworks.com/help/releases/R2024a/econ/markov-switching-dynamic-regression-models.html