The time-series smoother

A whole posterior path finding equilibrium at once.

The local-level model — a random-walk state observed in noise, $x_{t+1} = x_t + \mathcal{N}(0, q^{-1})$, $y_t = x_t + \mathcal{N}(0, r^{-1})$ — is a bead chain. Each green bead $x_t$ rides a frictionless vertical rod at its time slot, hangs from its observation by a measurement spring of stiffness $r$, and is tied to its neighbours by process-noise springs of stiffness $q$. The rods stop the chain contracting sideways, and because the springs have zero natural length the diagonal neighbour spring's energy splits into a constant plus $\tfrac12 q (x_{t+1}-x_t)^2$, so the energy is — exactly — the negative log posterior of the whole path,

$$ E \;=\; \tfrac12 \sum_t r\,(x_t - y_t)^2 \;+\; \tfrac12 \sum_t q\,(x_{t+1} - x_t)^2, $$

so the chain's resting shape is the Kalman smoother — equally, Whittaker–Henderson graduation with a first-difference penalty, the Hodrick–Prescott filter's older sibling. The dashed curve is the exact smoother from a tridiagonal solve; the beads just obey $F = ma$.

Stiffen the chain and it pulls taut toward a constant (all evidence pooled); slacken it and each bead chases its own observation. Drag an observation and watch the disturbance propagate a few springs down the chain and die out — the smoother's influence is local, which is why filtering and smoothing agree except near the ends. Most fun: add an observation and watch the whole posterior path re-equilibrate to accommodate it.

beads energy energy at exact smoother sliders are log-scale

In the language of the introduction, each link of the chain is one series spring — the prediction step bleeding precision — and each measurement spring adds its mass in parallel. Run along the chain left to right doing those two moves and you have the Kalman filter; let the whole chain relax at once and you have the smoother. Same springs, different questions. Pin part of the chain and you are conditioning — a Schur complement, as at schur.microprediction.org.