Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. The
forward-backward algorithm is an inference algorithm for hidden Markov
models which computes the posterior marginals of all hidden state
variables given a sequence of observations/emissions o_{1:t}:=
o_1,dots,o_t, i.e. it computes, for all hidden state variables X_k in
{X_1, dots, X_t}, the distribution P(X_k | o_{1:t}). 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.