Suppose that we have two models for a 2-state HMM and both have two output symbols: $A$ and $B$.

Model 1:

  • Transition probabilities: $a_{11}=0.6$, $a_{12}=0.4$, $a_{21}=0.0$, $π‘Ž_{22}=1.0$.
  • Output probabilities: $𝑏_1(𝐴)=0.45$, $𝑏_1(𝐡)=0.55$, $𝑏_2(𝐴)=0.5$, $𝑏_2(𝐡)=0.5$.
  • Initial probabilities: $πœ‹_1=0.4$, $πœ‹_2=0.6$.

Model 2:

  • Transition probabilities: $a_{11}=0.2$, $a_{12}=0.8$, $a_{21}=0.0$, $π‘Ž_{22}=1.0$.
  • Output probabilities: $𝑏_1(𝐴)=0.2$, $𝑏_1(𝐡)=0.8$, $𝑏_2(𝐴)=0.6$, $𝑏_2(𝐡)=0.4$.
  • Initial probabilities: $πœ‹_1=0.7$, $πœ‹_2=0.3$.

Which model is more likely to produce the observation sequence $\{A, B, A\}$?

  • $\begingroup$ This seems doable, if a bit tedious. What's your problem? $\endgroup$
    – Gijs
    Apr 23, 2019 at 14:41
  • $\begingroup$ I am new to Markov Chains and I want to know how can I produce the probability of the sequence in both the models. $\endgroup$
    – Ali J.
    Apr 23, 2019 at 14:57

1 Answer 1


You can answer this samll problem with the basic version of forward algorithm, described in the famous tutorial paper A tutorial on hidden Markov models and selected applications in speech recognition by Lawrence Rabiner. The interesting part of the paper for you is on page 6 :

enter image description here

Using an old code i had on my computer I get : $$p({A, B, A}|\mathrm{Model} 1) \approx 0.1291, $$ while $$p({A, B, A}|\mathrm{Model} 2) \approx 0.0817. $$

Thus Model 1 is more likely to generate this sequence.


Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.