The most straightforward way of solving this is:
i.e. For a given Q,
Also
.
So,
How many possible state sequences Qs are there for, say, N=5 and T=100?
The Forward Algorithm:
Discuss this:
If we are given the probabilies (of ending in each of the N states)
for the sequence
,
then we can easily calculate the
probabilities of the sequence
(ending in each
of the N states).
If we introduce a forward variable
such that
There is a lattice/trellis analogy of looking at the above computation (common in literature).
Experiment with some simple HMMs and print out the trellises for a few short observation sequences using the HMM Mini-Toolkit.
In practice,
need only be a one-dimensional array most of the
time. (Why?)
Here is an inductive statement of the forward algorithm:
Likewise we can also define a backward variable
such that
Like
we can also define
inductively:
The backward variable
is not used in the rest of this series
of lectures, but you must understand it and work out other interesting
quantities you can obtain using these two, eg.
etc.
We will use
to illustrate the EM algorithm during the second
set of lectures on Bayesian Learning.