Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

PSet 19: Hidden Markov Models

(videos: Hidden Markov Models and Forward Algorithm)

Recall the equation for computing HMM probabilities at any given time step tt to be:

P(Xte1:t)=αP(etXt)Xt1P(XtXt1)P(Xt1e1:t1)P(X_t | e_{1:t}) = \alpha P(e_t | X_t) \sum_{X_{t-1}} P(X_t | X_{t-1}) P(X_{t-1} | e_{1:t-1})

Imagine an HMM that models the weather, as we’ve seen before as a Markov chain, the day is either rainy or cloudy or sunny, and the weather one day is a function of the previous. Imagine that you’re in a windowless room, but you have a barometer that is sensing outside.

We know the following:

P(XtXt1)P(X_t|X_{t−1}) for the transition probabilities is...

Xt
rcs
Xt-1r0.70.20.1
c0.250.50.25
s0.20.40.4

Using this table, P(Xt=sXt1=r)=0.1P(X_t=s | X_{t−1}=r) = 0.1, not 0.2.

P(EtXt)P(E_t|X_t) for the emission probabilities is...

lowmedhi
r0.80.10.1
c0.30.40.3
s0.10.10.8

The initial distribution is P(X1=r)=0.1P(X1=r)=0.1, P(X1=c)=0.2P(X1=c)=0.2, P(X1s)=0.7P(X1←s)=0.7. Over the course of three days, we see three outputs from our barometer: E1=low,E2=med,E3=low.

Compute P(X3e1:3)P(X3|e_{1:3})

P(X3=re1,e2,e3)=P(X3=r | e1,e2,e3) = ________
P(X3=ce1,e2,e3)=P(X3=c | e1,e2,e3) = ________
P(X3=se1,e2,e3)=P(X3=s | e1,e2,e3) = ________