# Example on how to calculate a probability of a sequence of observations in HMM

Given the following HMM model (from Ankur Jain's slides)

A question with the answer is presented below:

We have the initial probabilities $P(\text{Low})=0.4$ and $P(\text{High})=0.6$.

However, I'm confused why in the solution we have an extra $0.4$. I guess it should be as follows

$$P(\text{Dry} \mid \text{Low}) P(\text{Rain} \mid \text{Low}) P(\text{Low})P(\text{Low}|\text{Low}) = 0.4*0.6*0.4*0.3$$

Is the above correct?

• It looks like your calculation is correct, unless I'm also missing something. Commented Jan 8, 2013 at 12:58

## 1 Answer

You are correct. They have an extra $.4$.

Edit:

Let $Y_1,Y_2 \in \{\text{dry},\text{rain}\}$ be the two observations. Let $X_1, X_2 \in \{\text{low},\text{high}\}$ be the two unobserved state random variables.

\begin{align*} P(y_1,y_2) &= \sum_{(x_1,x_2)}P(y_1,y_2 \mid x_1,x_2)p(x_1,x_2)\\ &= \sum_{(x_1,x_2)}P(y_1 \mid x_1)P(y_2 \mid x_2)p(x_1,x_2)\\ &= \sum_{(x_1,x_2)}P(y_1 \mid x_1)P(y_2 \mid x_2)p(x_2 \mid x_1)p(x_1). \end{align*} If we let $y_1,y_2 = (\text{dry},\text{rain})$ and we sum over the four possible pairs of the $x_i$s, then we get the probability of that particular sequence.

You were asking about one of those four particular summands, and to reiterate, yes, you are correct: $$P(\text{Dry} \mid \text{Low}) P(\text{Rain} \mid \text{Low}) P(\text{Low})P(\text{Low}|\text{Low}) = 0.4*0.6*0.4*0.3.$$