Demos
Exact physical analogies only.
Every demo is an exact physical analog. The idealised mechanism has a potential energy that equals the negative log posterior term for term. So its equilibrium is the estimator. Most pages draw the closed-form answer dashed alongside the simulation. You can watch the physics land on it.
- Evidence fusion. A prior and any number of observations hang on a test particle. The particle relaxes to the posterior mean. The total mass is the posterior precision. Add observations one at a time and watch equilibrium re-form. Each is another spring in parallel, so the precisions add.
- Reduced mass. A hierarchical chain sits above its consolidated equivalent. The chain runs from observation through a latent joint to the particle. The equivalent is a single body carrying the reduced mass φρ/(φ+ρ). Both settle on the same line. Slacken the channel and watch the evidence's weight drain away.
- The filter through time. One body of evolving mass. It alternates predict and update, tick by tick. Predict shrinks the mass through a series spring. Update grows it by fusion. Play it, or step through by hand. Skip observations and watch staleness go unchecked.
- Conditioning a Gaussian graph. Six beads on a chain plus a non-local shortcut edge. Pin any node and the rest relax into the exact conditional mean. It propagates along every path, not only to nearest neighbours.
- The membrane. The smoother lifted into two dimensions. Stretch an elastic sheet over a frame and push it with a few posts. It relaxes to the harmonic interpolant, the posterior mean of a Gaussian field pinned at those points. Conditioning a Gaussian graph, now on a continuum. A soap film, almost, since a real film minimises area rather than the quadratic tension energy.
- Schur damping. Eliminating the chain's free joint is a scalar Schur complement. The γ dial keeps only a fraction of the joint's recoil. It slides between clamped-to-the-data overconfidence at γ=0 and the exact marginal at γ=1. The allocation version of the same dial lives at schur.microprediction.org.
- Least squares as springs. A rigid rod tied by vertical springs to draggable data points relaxes to the ordinary least squares line, after Joshua Loftus.
- The time-series smoother. A bead chain relaxes to the Kalman smoother of a local-level model. Measurement springs pull down to the data. Process-noise springs run between neighbours. The method also goes by Whittaker-Henderson graduation. Add an observation and watch the whole posterior path re-equilibrate.
- Robust smoothing: bounded influence vs Kalman. The same bead chain, with the measurement springs reshaped by an exponent dial. At $p=2$ it is the Kalman smoother. Slide toward $p=1$ and each spring becomes a constant-tension pull. The path then relaxes to a bounded-influence fit that shrugs off spikes.
- Huber loss. Five points on three rails share one parameter. L2 is a plain spring and gives the mean. L1 is a constant-tension pulley and gives the median. Huber is a spring that switches to a capped pull past a threshold $\delta$. Drag the outlier. The mean chases it, the median ignores it, and Huber lands in between.
- Bid-ask bounce. A Gaussian Roll model. Trades with negatively autocorrelated errors are anti-redundant evidence. The GLS weights are precision row sums. So bouncing prices carry more mass than their naive iid weight. Stale, positively correlated ones carry far less.
- The minimum-variance portfolio. A bead on the allocation rail, tied to the corner portfolios by springs of stiffness σ²−c. Raise the correlation and a spring turns repulsive. Short selling emerges mechanically. Min-var weights are precision row sums. They are the GLS estimator of a common mean in a finance hat.
- PCA as a rod on sliding collars. Attach the regression rod's springs through frictionless collars and they pull perpendicular. The rod relaxes to the first principal component. It balances unstably on the second. This is Pearson's 1901 “line of closest fit,” literally.
- Ridge vs Lasso. Where the Hookean analogy breaks, on purpose. Ridge is an ordinary spring to zero. Lasso swaps it for a constant-tension pulley. Once the data spring's pull weakens below the tension the bead sticks at zero. That is soft-thresholding, done mechanically.
Have an idea for a demo? Open an issue on the repo.