# Thread: Probability of next observation in Hidden Markov Model

1. ## Probability of next observation in Hidden Markov Model

I am learning Hidden Markov Models and trying to solve this problem. A Hidden Markov Model has 2 states $\displaystyle \{1,2\}$ and 3 observations $\displaystyle \{a,b,c\}$. The state transition matrix (A), observation matrix (B)and initial matrix ($\displaystyle \pi$) of the model is given below.

$\displaystyle A = \begin{bmatrix}0.9 & 0.1\\ 0.3 & 0.7 \end{bmatrix}$

$\displaystyle B = \begin{bmatrix} 0.3 & 0.4 & 0.3 \\ 0.2 & 0.6 & 0.2\end{bmatrix}$

$\displaystyle \pi =\begin{bmatrix} 0.7 & 0.3 \end{bmatrix}$

(a) if the observation sequence is $\displaystyle \{a,a,b\}$ and the hidden sequence is $\displaystyle \{1,1,2\}$ , calculate the probablity that the next observation is $\displaystyle b"$
(b) For question (a), if the next observation is b, what is the probability that the hidden sequence is $\displaystyle \{1,1,2,2\}$
Now I have some questions here. For part (a), using the conditional probability laws, I would have

$\displaystyle P(b | \{a,a,b\}) = \frac{P(\{a,a,b,b\}}{P(\{a,a,b\}}$

Is this correct ?

2. ## Re: Probability of next observation in Hidden Markov Model

Hey issacnewton.

Do you understand how to use the transition matrix to get a conditional probability?

3. ## Re: Probability of next observation in Hidden Markov Model

Chiro, I think what is being asked in part (a) is the probability of getting next observation $\displaystyle b$ given that the earlier observation sequence is $\displaystyle \{a,a,b\}$. So we have been asked the conditional probability here. And I am just using the definition of conditional probability. But on second thoughts I think this might be not correct for Markov processes. In Markov processes, we only consider the previous state. So with this in mind, we should have

$\displaystyle P(b) = P(b|b)P(b) + P(b|a)P(a)$

Would this be correct ?

4. ## Re: Probability of next observation in Hidden Markov Model

There is a reason for the transition matrix in a markov model.

If you are studying this you should read about how to get the probability for a given state [i.e. in terms of the offset of the state] in terms of the transition matrix.

As an example - in a normal model you have A^n to get the matrix for the nth observation and you multiply that with some initial probability to get the probabilities for the states at the nth time.