# Markov switching model joint distribution

Under a hidden markov model (HMM) we know that

\begin{align*} p(\epsilon_1,\ldots,\epsilon_N,\Delta_1,\ldots,\Delta_N)=&p(\epsilon_1,\ldots,\epsilon_N\mid\Delta_1,\ldots,\Delta_N)p(\Delta_1,\ldots,\Delta_N) \\=&p(\epsilon_1,\ldots,\epsilon_N\mid\Delta_1,\ldots,\Delta_N)\cdot \\&(p(\Delta_1)p(\Delta_2\mid\Delta_1)\ldots p(\Delta_N\mid \Delta_{N-1}) \\=&p(\epsilon_1\mid\Delta_1,\ldots,\Delta_N)\ldots p(\epsilon_N\mid\Delta_1,\ldots,\Delta_N)\cdot \\&(p(\Delta_1)p(\Delta_2\mid\Delta_1)\ldots p(\Delta_N\mid \Delta_{N-1}) \\=&(p(\epsilon_1\mid\Delta_1)\ldots p(\epsilon_N\mid\Delta_N))\cdot \\&(p(\Delta_1)p(\Delta_2\mid\Delta_1)\ldots p(\Delta_N\mid \Delta_{N-1}) \\=&p(\Delta_1)p(\epsilon_1\mid\Delta_1)\prod_{n=2}^N p(\Delta_n\mid\Delta_{n-1})p(\epsilon_n\mid\Delta_{n})\,, \end{align*} where $\left\{\Delta_n\right\}$ is an underlying Markov chain defined on the state space $S$ and $\left\{\epsilon_n\right\}$ is a sequence of independent random variables, where the conditional distribution of $\epsilon_n$ depends on $\Delta_n$.

Now the Markov switching model is a generalisation of the HMM where the dependence structure changes to allow dependence between the $\epsilon_n$. How can I derive the joint distribution in order to get a probabilistic relationship, as I am not finding any text which gives a formal definition.

First, I think you meant $$\mathbb{P}(\epsilon_1, \ldots, \epsilon_N, \Delta_1, \ldots, \Delta_N) = \mathbb{P}(\Delta_1) \mathbb{P}(\epsilon_1\,|\,\Delta_1) \prod_{n = \color{red}{2}}^N \color{red}{\bigl(}\mathbb{P}(\Delta_n\,|\,\Delta_{n-1}) \mathbb{P}(\epsilon_{\color{red}{n}}\,|\,\Delta_{\color{red}{n}})\color{red}{\bigr)}.$$

As far as I understand it, “allow for dependence between the $\epsilon_n$” means to consider the model $$\mathbb{P}(\epsilon_1, \ldots, \epsilon_N, \Delta_1, \ldots, \Delta_N) = \mathbb{P}(\Delta_1) \mathbb{P}(\epsilon_1\,|\,\Delta_1) \prod_{n = 2}^N \bigl(\mathbb{P}(\Delta_n\,|\,\Delta_{n-1}) \mathbb{P}(\epsilon_n\,|\,\Delta_n\color{blue}{, \epsilon_{n - 1}})\bigr).$$

Regards, /Nancy-N

• Thank-you for your reply and you are correct about the edits I just changed in the questions as those where typos. Regarding the second statement for the markov switching do you have some reference? As I read in papers that the dependence structure does not limit only to the previous $\epsilon_{n-1}$ but on the whole time series process. @Nancy-N – Anna Apr 11 '18 at 19:01
• @Anna No, I have no reference: I just tried to guess what the author of your text was meaning by “allow for dependence between the $\epsilon_n$”. One can obviously complexify the model by replacing $\mathbb{P}(\epsilon_n\,|\,\Delta_n, \epsilon_{n - 1})$ by $\mathbb{P}(\epsilon_n\,|\,\Delta_n, \epsilon_{n - 1}, \epsilon_{n - 2}, \ldots, \epsilon_{n - k})$ for some finite $k$ ; but to allow dependence w.r.t. the wole time series, $k$ would have to be infinite, and then the model is not Markovian any more: thus one would have to make further modelling assumptions to keep things tractable… – Rémi Peyre Apr 11 '18 at 19:21
• I am not quite sure that you are right. I re-edited the question to include the whole derivation maybe this might be clearer, as I am not sure how you statement follows. – Anna Apr 11 '18 at 19:25