Lably
Skip to content

Forward–backward algorithm

Inference algorithm for hidden Markov models

  • 16 min read
  • 7 chapters

Related on Lably

Through Statistical inference, Algorithm and Bayes' theorem

The term forward–backward algorithm is also used to refer to any algorithm belonging to the general class of algorithms that operate on sequence models in a forward–backward manner. In this sense, the descriptions in the remainder of this article refer only to one specific instance of this class.

Overview

In the first pass, the forward–backward algorithm computes a set of forward probabilities which provide, for all t∈{1,…,T}, the probability of ending up in any particular state given the first t observations in the sequence, i.e. P(Xt|o1:t). In the second pass, the algorithm computes a set of backward probabilities which provide the probability of observing the remaining observations given any starting point t, i.e. P(ot+1:T|Xt). These two sets of probability distributions can then be combined to obtain the distribution over states at any specific point in time given the entire observation sequence:

P(Xt|o1:T)=P(Xt|o1:t,ot+1:T)∝P(ot+1:T|Xt)P(Xt|o1:t)

The last step follows from an application of the Bayes' rule and the conditional independence of ot+1:T and o1:t given Xt.

As outlined above, the algorithm involves three steps:

  1. computing forward probabilities
  2. computing backward probabilities
  3. computing smoothed values.

The forward and backward steps may also be called "forward message pass" and "backward message pass" - these terms are due to the message-passing used in general belief propagation approaches. At each single observation in the sequence, probabilities to be used for calculations at the next observation are computed. The smoothing step can be calculated simultaneously during the backward pass. This step allows the algorithm to take into account any past observations of output for computing more accurate results.

The forward–backward algorithm can be used to find the most likely state for any point in time. It cannot, however, be used to find the most likely sequence of states (see Viterbi algorithm).

Sign in to keep reading

6 more chapters are free with a Lably account.

More in Robotics