Gaussian Process Regression
A Gaussian process treats a regression curve as one draw from an infinite family of possible curves, and instead of predicting a single number it predicts a whole distribution — a best guess plus exactly how unsure it should be, widest where data is sparse.
Prerequisites: The Kernel Trick and Kernel Methods
Most regression models spit out one number per input and stay silent about how much to trust it. A model interpolating between two well-observed points and a model extrapolating far past the edge of its data can produce identical-looking point predictions while deserving wildly different confidence. Gaussian process regression is built to answer both questions at once: what's the best guess, and how sure should you be.
The analogy: a rope pinned at known points
Picture an infinitely flexible, slightly stiff rope draped so it must pass exactly through a handful of known data points — the observed prices, the known measurements. Between two pins close together, the rope has very little freedom; it's almost pinned down, so you can predict its height there with confidence. Far from any pin, out past the edge of the data, the rope could sag or rise almost anywhere, and your confidence collapses. A Gaussian process is the mathematical version of "every possible rope consistent with the pins," averaged and measured for spread at every point.
The maths: a distribution over functions
A Gaussian process is defined by a mean function (usually taken as zero, for simplicity) and a covariance function that says how correlated the curve's height is at two input points and :
In words: instead of picking one curve, we describe an entire cloud of plausible curves, and controls how "wiggly" they're allowed to be — points close together in have highly correlated heights (the curve can't jump), points far apart are nearly independent. Given observed data, prediction at a new point produces a mean and a variance:
Here is the vector of observed outputs, is the matrix of covariances between all pairs of observed points, and is the vector of covariances between the new point and each observed point. In words: the predicted mean is a weighted blend of the observed values, weighted by how correlated they are with the new point; the predicted variance starts at the curve's natural variance and shrinks by however much the observed data pins it down. Far from any data, is near zero, nothing shrinks the variance, and the model correctly reports "I don't know."
Worked example 1: two points, predict the middle
Suppose we've observed at and at , using an RBF-style covariance where nearby points correlate strongly. Predicting at , exactly halfway, symmetry makes both training points equally relevant, so the predicted mean is close to their average: . The predicted variance at is small, because sits between two observations that strongly constrain it — the rope can barely move there.
Worked example 2: extrapolation blows up the uncertainty
Same two points, but now predict at , far outside the observed range . With an RBF covariance, correlation decays fast with distance, so for both training points is now nearly zero — neither observation says much about . The predicted mean drifts back toward the prior mean (often zero, or flat), and critically the predicted variance grows back up toward , its unconstrained value. Concretely, if the interpolated variance at was, say, , the extrapolated variance at might be larger — the model is explicitly telling you "trust this prediction far less."
Watch how an estimate narrows as more data accumulates in the explorer above — a Gaussian process does the same thing locally: its uncertainty band narrows wherever observations cluster and stays wide everywhere else.
The RBF covariance's exponential decay with distance (shown in shape here) is exactly what controls how fast a Gaussian process's confidence collapses as you move away from a data point.
A Gaussian process predicts a mean and a variance at every point, and the variance is small near observed data and large far from it — uncertainty is not an afterthought, it's built into the output.
What this means in practice
Gaussian processes are prized wherever knowing "how confident should I be" matters as much as the point estimate itself: pricing illiquid instruments by interpolating from nearby liquid ones, Bayesian optimisation of trading-strategy hyperparameters, or building a smooth, uncertainty-aware yield curve from sparse market quotes. The catch is cost — the in the formulas above is a matrix inversion that scales roughly with the cube of the number of data points, which makes vanilla Gaussian processes impractical much past a few thousand observations without approximations.
The classic trap is trusting a Gaussian process's confidence intervals blindly without checking the covariance function matches the data's real smoothness. An RBF kernel assumes an infinitely smooth underlying function; feed it data with sharp jumps (an earnings announcement, a regime change) and it will confidently underestimate uncertainty right where you need it most, because the model structurally cannot imagine a discontinuity.
Related concepts
Practice in interviews
Further reading
- Rasmussen & Williams, Gaussian Processes for Machine Learning, ch. 2
- Murphy, Machine Learning: A Probabilistic Perspective, ch. 15