# Trouble understanding hamilton 1996 specification testing in MS

I'm an undergraduate student and I'm trying to code the specification testing for Markov-switching model in R, based on the article "Specification Testing in Markov-Switching time series models" Hamilton 1996.

More specifically, I don't understand equation 3.12, or maybe I have misunderstood something.

In equation 3.12 you have a term like this

$$= p_{ij}^{-1} p(s_{t}=j,s_{t-1}=i|\Omega_{t})$$

But since

$$p(s_{t}=j,s_{t-1}=i|\Omega_{t}) = p_{ij} p(s_{t-1}=i|\Omega_{t})$$

then

$$= p_{ij}^{-1}p_{ij} p(s_{t-1}=i|\Omega_{t}) = p(s_{t-1}=i|\Omega_{t})$$

Is this ok?

• Hi - your question is pretty broad and I think it would do better to narrow it down. Besides, just giving a name and a reference might be enough, but it looks sloppy and like you can't be bothered. – Thorst Dec 16 '14 at 7:38
• The Hamilton paper is a 30-page, 50-numbered-equations paper, dealing with the fine art and science of specification testing. It belongs to that stage in science where there are no "easy explanations" anymore. It is encouraging for the state of Economics education that it was assigned in the context of an undergraduate thesis, but you have to... "do the crime and do the time", form your prison-break plan, and then ask us about specific details on it. – Alecos Papadopoulos Dec 16 '14 at 11:48
• Ok fine, no easy explanation, I was wondering if you know an article that make a detail explanation of this article. – anfego Dec 16 '14 at 20:51

In my question, I rewrite the joint probability as the product of the conditionals probabilities but I wrongly implemented the markov assumption of this model. The markov assumption is: $$p(s_{t}=j|s_{t-1}=i,\Omega_{t-1})=p(s_{t}=j|s_{t-1}=i)=p_{ij}$$ But, when conditioned to information available at date t $$p(s_{t}=j|s_{t-1}=i,\Omega_{t})\neq p(s_{t}=j|s_{t-1}=i)=p_{ij}$$ Meaning that
$$p(s_{t}=j,s_{t-1}=i|\Omega_{t})\neq p(s_{t}=j|s_{t-1}=i)p(s_{t-1}=i|\Omega_{t})$$