The forward-backward algorithm is an inferencealgorithm for hidden Markov models which computes the posteriormarginals of all hidden state variables given a sequence of observations/emissions , i.e. it computes, for all hidden state variables , the distribution . This inference task is usually called smoothing. The algorithm makes use of the principle of dynamic programming to efficiently compute the values that are required to obtain the posterior marginal distributions in two passes. The first pass goes forward in time while the second goes backward in time; hence the name forward-backward algorithm.
Evaluation problem:Given the HMMM=(A, B, p)andthe observation sequenceO=o1 o2 ... oK, calculate the probability that model M has generated sequenceO.
Trying to find probability of observations O=o1 o2 ... oK by means of considering all hidden state sequences (as was done in example) is impractical:
NKhidden state sequences - exponential complexity.
Use Forward-Backward HMM algorithms for efficient calculations.
Define the forward variable ak(i) as the joint probability of the partial observation sequence o1 o2 ... okand that the hidden state at time k is si: ak(i)= P(o1 o2 ... ok , qk=si)