An HMM has two states, initial probabilities π=(0.5,0.5), transition matrix A=(0.70.30.40.6), and emissions P(a∣1)=0.9, P(b∣1)=0.1, P(a∣2)=0.2, P(b∣2)=0.8. For the observations (a,b), what are the backward variables, P(O) and the posterior P(z1=1∣O)?

Probabilistic models, Hidden Markov models
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can run the backward recursion and combine it with the forward variable to get a state posterior.

Key idea

Backward: βT(i)=1 and βt(i)=∑jaij bj(ot+1) βt+1(j). Then γt(i)=αt(i)βt(i)/P(O).

Steps

  1. Set β2=(1,1). The second observation is b.
  2. β1(1)=0.7⋅0.1⋅1+0.3⋅0.8⋅1=0.07+0.24=0.31.
  3. β1(2)=0.4⋅0.1+0.6⋅0.8=0.04+0.48=0.52.
  4. Forward start: α1=(0.5⋅0.9,  0.5⋅0.2)=(0.45,0.10).
  5. P(O)=∑iα1(i)β1(i)=0.45⋅0.31+0.10⋅0.52=0.1395+0.052=0.1915.
  6. Posterior: P(z1=1∣O)=0.1395/0.1915=0.728, and P(z1=2∣O)=0.272.
  7. Check with the forward pass: α2=(0.0355,0.156), which sums to 0.1915. The two ways of getting P(O) agree.

Common mistakes

How long your answer should be

Half a page. Cross-check P(O) both ways.

Read this

Previous in Probabilistic models: What is the generative story of latent Dirichlet allocation (LDA), and what do θd and ϕk represent?
Next in Probabilistic models: The unnormalised density p~(θ)=θ4(1−θ)2 on (0,1) is a Beta(5,3) density. What is its Laplace approximation, and how does its variance compare with the exact one?