Spring Theory

Visualizing common statistical procedures with exact physical analogs.

beads energy energy at exact smoother sliders are log-scale

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. Most fun: add an observation and watch the whole posterior path re-equilibrate to accommodate it. This is the smoother — the whole path relaxing at once. For the filter — one body running forward through time, tick by tick — see the filter-through-time demo.

What you are looking at: the Kalman smoother as a bead chain

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 chain of beads. Each green bead $x_t$ rides a frictionless vertical rod at its time slot, hangs from its observation (dark) by a measurement spring of stiffness $r$, and is tied to its neighbours by process-noise springs of stiffness $q$. The rods matter: they stop the chain contracting sideways, and because the springs have zero natural length the diagonal neighbour spring's energy splits exactly into a constant (the fixed horizontal span) plus $\tfrac12 q\,(x_{t+1}-x_t)^2$ — so the constant drops out of the mechanics and the total stored energy is, exactly, the negative log posterior of the entire path,

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

The chain's resting shape therefore 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$ with damping. That they agree is the point: this is an exact physical analog, not an illustration. The smoother's influence is local — a dragged observation disturbs only a few springs' worth of chain — which is why filtering and smoothing agree except near the ends.

Every Gaussian belief is a spring: its negative log-density is a quadratic potential well, so precision is mass, energy is negative log-likelihood, and estimation is mechanical equilibrium. Each link of the chain above is one series spring (the prediction step bleeding precision); each measurement spring adds its mass in parallel; run left to right doing those two moves and you have the Kalman filter. The introduction derives the correspondence, the dictionary tabulates it, and the demos page has more exact analogs: evidence fusion, reduced mass, the filter through time, conditioning a Gaussian graph, Schur damping, least squares, minimum variance, PCA, bid-ask bounce, and where the analogy breaks — Ridge vs Lasso.

Bibliography

Works on, behind, or adjacent to the mechanical view of Gaussian inference. Many of these were collected by Loftus, whose post revived the analogy.

The core

Antecedents

Energy and its relatives

Physical computation and visualisation

Know another Gaussian–Hookean correspondence, or a reference that belongs here? Open an issue on the springtheory repo.