# How to forecast a Markov Switching Model

I have the following Markov Switching Model.

Transition Matrix:

$$\left[\begin{matrix} 0.85387 & 0.91973\\0.14613 & 0.080265 \end{matrix}\right]$$

With

Regime 1:

Intercept: 0.00839 AR1: 0.26694 MA1: -0.26571 Var: 0.00244

Regime 2:

Intercept: -0.05615 AR1: 0.70866 MA1: -0.67383 Var: 0.00244

How can I forecast using this information? I am unsure of how the transition matrix needs to be incorporated into the forecast calculation.

Thanks!

## 1 Answer

One possibility is to obtain forecasts as the weighted average of the forecasts based on the parameter estimates of each regime. The weights are the smoothed probabilities of each regime, as obtained for example via the Kim's smoothing algorithm.

In the case of the ARMA model that you give (and given $ns=2$ states):

$$y_{T+1} = \sum_{i=1}^{ns} Pr(S_{T+1}=j \,|\, \Psi_T) \left(\mu_s + \phi_{s,1} y_{T} + \theta_{s,1} \epsilon_T\right) \,,$$

where the index $s$ denotes the regime, for example: $\mu_1=0.00839$, $\mu_2=-0.05615$, $\phi_{1,1}=0.26694$, $\phi_{2,1}=0.70866$; $Pr(S_{T+1}=j \,|\,\Psi_T)$ is the smoothed probability that observation at time $T+1$ is in state $j$, given the entire set of information $\Psi_T=y_1,...,y_T$.

After obtaining each one-step-ahead forecast, the smoothed probabilities $Pr(S_t=j \,|\, \Psi_T) = \sum_{i=1}^{ns} Pr(S_t=j, S_{t-1}=i \,|\, y_1,y_2,...,y_T)\,$ should be updated adding the forecasts to the set of information $\Psi_T$, $\Psi_{T+1}$,...

I don't know if it would be straightforward to apply Kim's algorithm in this case with an MA term; with an AR model the algorithm can be used as described in the reference paper.

As an alternative to the smoothed probabilities, Boot and Pick propose the usage of other weights (a link to the document is given below).

References:

Kim, CJ (1994). "Dynamic linear models with Markov-switching". Journal of Econometrics, 60(1), pp. 1-22.

Boot, T. and Pick, A. (2014). "Optimal forecasts from Markov switching models". DNB Working Paper. No. 452. URL: http://www.dnb.nl/binaries/Working%20Paper%20452_tcm46-316416.pdf

• do you know of any implementation of this technique? – A1010 Dec 15 '20 at 22:52
• @AndreaM I think you could still find a Gauss program of Kim's smoothing algorithm here in Professor Kim's website. – javlacalle Dec 18 '20 at 13:06