Backward algorithm 2026-10-20
The backward algorithm computes suffix likelihoods in a Hidden Markov model. With , its recurrence is . Together with the forward algorithm, it gives posterior state probabilities proportional to . The terminal condition must include any explicit End-state transition.
Hidden Markov model Created 2026-09-28 Updated 2026-11-05
A Hidden Markov model combines an unobserved Markov chain with observations . Given the whole hidden-state path, the observations have conditional independence, and the conditional distribution of depends only on . The state-transition assumption and this emission assumption are separate parts of the model.[ref]
For a time-homogeneous model with a finite hidden state space and discrete observations, write , and for the emission probabilities. The joint probability mass function factors as
For continuous observations, appropriate probability density functions replace the emission probability mass functions.
For example, a hidden state can describe whether a machine is working normally or has a fault, while a noisy sensor emits a positive or negative signal. Both states may emit a positive signal, with different probabilities; one observation therefore need not identify the state. Summing the factorization over hidden paths gives the observation likelihood. The forward algorithm reuses partial sums to compute it, and the backward algorithm helps infer hidden-state posterior probabilities. The observations alone need not satisfy the Markov property.
Let be the hidden state. With the usual convention and , the Markov property and the conditional independence of emissions factor the joint probability as
The requested state-path probability after observing the complete data is the corresponding conditional probability:
Here the forward algorithm and backward algorithm give the same normalizer at any interior time,
There is no extra factor : it is already included in . If an unconditioned joint probability with the observations is intended, it is the numerator alone. Summing the boxed expression over all gives one.