Gaussian processes §
A Gaussian process is a stochastic process in which every finite subfamily is jointly Gaussian. It is the “Gaussian” way to put a probability distribution on an entire function: instead of a random variable taking values in , you get a random function , and the only ingredients you must supply are a mean function and a covariance kernel .
Gaussian processes are relevant whenever you want a distribution over functions with honest uncertainty: interpolating sparse spatial measurements (geostatistics / kriging), fitting a regression model that reports a calibrated error bar at every input (machine learning), or searching for the optimum of an expensive black-box function (Bayesian optimization). They are the natural tool whenever the answer you want is a curve or a field, not a single number.
Authoritative sources
- Rasmussen & Williams, Gaussian Processes for Machine Learning (MIT Press, 2006).
- Matheron, G. (1963). “Principles of geostatistics.” Economic Geology 58(1) — the origin of kriging, the GP-regression computation in geostatistics.
Definition (cheatsheet) §
- Finite-dimensional property: for any , the vector is multivariate normal with mean vector and covariance matrix .
- The kernel must be symmetric () and positive semi-definite (PSD): for all real coefficients and all choices of points .
- Key examples: Brownian motion (), the Ornstein–Uhlenbeck process (), and the squared-exponential kernel () used in machine learning.
The covariance kernel and positive-definiteness §
Definition. A function is a valid covariance kernel if it is symmetric and positive semi-definite (PSD): for every , every choice of points , and every real vector ,
PSD is exactly the condition that makes a legitimate covariance matrix for every finite set of points, so that a Gaussian process with that kernel actually exists.
Details
Why PSD is the right condition. A covariance matrix of any random vector must satisfy , because a variance is never negative. So PSD is not an extra assumption — it is precisely the requirement that can be the covariance of some Gaussian vector at every finite set of points. Conversely, if is PSD, the Kolmogorov extension theorem guarantees a Gaussian process with that kernel.
Worked check — a kernel that passes. Take on (the Brownian kernel). For ordered points , the matrix is exactly the covariance matrix of the vector of a Brownian motion, so it is PSD by construction. Concretely, for two points , has determinant and positive trace, hence PSD.
Worked check — a candidate that fails. Consider the tempting candidate . At the two points it gives the matrix
whose determinant is . A symmetric matrix with negative determinant has a negative eigenvalue, so it is not PSD. Indeed, with one gets . The candidate is therefore not a valid kernel: it cannot be the covariance of any random process. (The fix is to use a product , which is rank-one and PSD, since .)
Example problem
Is a valid kernel on ?
Solution
Yes. Write , a sum of two rank-one PSD kernels: the constant kernel (PSD because ) and the product kernel (PSD as shown above). A non-negative linear combination of PSD kernels is PSD, so is a valid kernel.
Why the kernel is everything: Gaussianity collapses the specification §
Definition. A general stochastic process is specified by all of its finite-dimensional distributions (infinitely many objects). A Gaussian process is specified by only two functions — the mean and the kernel — because a multivariate normal distribution is completely determined by its mean vector and covariance matrix.
Details
The global idea. For an arbitrary process, knowing the law of tells you nothing about the law of ; you must specify each finite-dimensional distribution separately, and they must all be mutually consistent. For a Gaussian process this burden vanishes: the joint law of any finite subfamily is a multivariate normal, and a multivariate normal has no free parameters beyond and . So once you fix and , every finite-dimensional distribution is forced, and consistency is automatic.
Concrete example. Suppose . To fully specify a general process on these three points you would need: three one-dimensional laws, three two-dimensional joint laws, and one three-dimensional joint law, all consistent with each other. To specify a Gaussian process on the same three points you need only numbers (the means ) and a symmetric PSD matrix (the kernel values ). That is the entire specification.
The payoff. Because the whole law is pinned down by and , every question about the process — its conditional distributions, its sample-path smoothness, its predictions — reduces to manipulating the single function . The next two sections are the two most important consequences: conditioning (GP regression) and regularity.
Example problem
A Gaussian process on has , , and . What is the joint density of , and for which is it a valid Gaussian process?
Solution
The joint law is the bivariate normal , with density
It is a valid Gaussian process exactly when the covariance matrix is PSD, i.e. when its determinant , so . This is the two-point shadow of the PSD condition from the previous section.
Common kernels §
Definition. A small family of kernels generates most applications. Each is controlled by an amplitude and a length-scale that sets the distance over which values stay correlated:
| Kernel | Formula k(s,t) | Sample paths |
|---|---|---|
| Brownian (random walk) | σ² min(s,t) | continuous, nowhere differentiable |
| Ornstein–Uhlenbeck | σ² e−|s−t|/ℓ | continuous, nowhere differentiable |
| Matérn (ν) | (σ²/Γ(ν)) · (√2·|s−t|/ℓ)ν · Kν(√2·|s−t|/ℓ) | ν−1 times differentiable |
| Squared-exponential (RBF) | σ² e−(s−t)²/2ℓ² | infinitely differentiable |
The length-scale is the single most important knob: a small makes the kernel decay fast, so values far apart are nearly independent and the function looks wiggly; a large keeps values correlated over long distances, so the function looks smooth.
Details
Reading smoothness off the decay. The figure below plots (correlation with the origin) against distance for three kernels with the same . The squared-exponential curve leaves the origin flat (its derivative at is ), the Matérn curve leaves with a corner, and the Ornstein–Uhlenbeck curve falls off as a pure exponential. That difference in local shape is exactly what shows up in the sample paths: flat departure gives smooth paths, a corner gives continuous-but-rough paths.
The Matérn family as a dial. The Matérn kernel interpolates between the two extremes: for it reduces exactly to the Ornstein–Uhlenbeck kernel , for to , and as it approaches the squared-exponential kernel. The parameter controls the number of continuous derivatives of the sample paths (see the regularity section).
Example problem
Two models of a temperature field use the same amplitude but length-scales km and km (squared-exponential kernel). Which model predicts that two stations 5 km apart are more strongly correlated, and why?
Solution
The km model. The squared-exponential correlation at distance is . At km this is for (≈ , essentially uncorrelated) but for (≈ , strongly correlated). A larger length-scale stretches the correlation over longer distances, so nearby stations stay correlated.
GP regression (kriging) §
Definition. Given a GP prior and noiseless observations at points , the posterior at a new point is again Gaussian. Writing , , and , the posterior mean and posterior variance are
With independent observation noise of variance , replace by in both formulas. This is kriging in geostatistics and Gaussian-process regression in machine learning.
Details
The global idea. Conditioning a multivariate normal is pure linear algebra: the conditional distribution of one component given the others is Gaussian, with mean and covariance given by block-matrix formulas. Because a GP is just a (possibly infinite) multivariate normal, conditioning the function on its values at the observed points is the same computation, and the answer is again a GP — the posterior GP — whose mean and kernel are the two formulas above. The posterior mean is a weighted average of the observations (the weights are ), and the posterior variance is the prior variance minus the information the observations carry about .
Why the variance shrinks near the data. The term measures how correlated is with the observed points. If coincides with an observed point, is a row of and the variance becomes exactly (noiseless case): you already know the value there. Far from the data, is small and the variance returns to the prior . This “tighten around the data, relax away from it” behavior is the whole point of the method.
Numeric example (Brownian kernel). Let and . Observe at and at , and predict at .
Then , so
So the model predicts with standard deviation . As a sanity check, predicting at the observed point gives and , exactly as it must.
The interactive simulation below shows this in action: a hidden smooth function is sampled from a GP, a few points are observed, and the posterior mean with its confidence band is drawn. Add observations to watch the band tighten around the data and relax between them.
Example problem
A noiseless GP has zero mean and kernel . You observe . What is the posterior mean and variance of ?
Solution
With a single observation, , , , and . The posterior mean is , and the posterior variance is . Intuitively, with an independent increment of variance , so the prediction is the observed value plus an uncertainty of .
Sample-path regularity §
Definition. The smoothness of a GP’s sample paths is read off the kernel through the Kolmogorov continuity criterion: if there exist constants , , such that
then the process admits a continuous modification. For a GP with constant, take and the left side is , so continuity follows from how fast shrinks as .
Details
The global idea. The criterion says: if the expected size of an increment over a small gap is smaller than the gap itself (raised to a power ), the paths must be continuous. For a Gaussian process the increment is Gaussian, so its typical size is its standard deviation . The question “are the paths continuous?” becomes “does go to zero faster than ?”
Concrete examples, from the kernel table.
- Brownian motion (): for , . This is , right at the borderline — the criterion gives continuity but no differentiability. Brownian paths are continuous yet nowhere differentiable.
- Squared-exponential (): near , , so = with . The paths are not just continuous but infinitely differentiable.
- Matérn (): near , . Continuity needs (i.e. ); differentiability needs (i.e. ). So the Matérn (= Ornstein–Uhlenbeck) has continuous but nowhere-differentiable paths, while has once-differentiable paths.
The figure below shows one sample path of a smooth GP (squared-exponential kernel): a single continuous, differentiable random curve.
Example problem
A GP has constant variance and, near the diagonal, . Are its sample paths continuous? Differentiable?
Solution
The increment variance is . With the Kolmogorov criterion needs ; here the exponent is , so and the paths are continuous. For differentiability the increment would need to shrink faster than in a stronger sense (roughly ); since , the paths are not differentiable. This is the same borderline logic as Brownian motion, which has .
Applications §
- Geostatistics (kriging): a GP prior on a spatial field (e.g. mineral concentration) turns sparse sample measurements into a full map with an uncertainty surface, via the regression formulas above.
- Machine learning (GP regression): the posterior gives a distribution over functions with calibrated uncertainty — a prediction and an honest error bar at every input, with no tuning of a loss function.
- Bayesian optimization: the GP posterior mean and variance drive acquisition functions (expected improvement, upper confidence bound) that decide where to evaluate an expensive black-box function next.
Quizz §
Example problem
A noiseless Gaussian process has zero mean and the squared-exponential kernel (so ). You observe and .
- Write down the kernel matrix and the vector for predicting at .
- Explain, without computing, whether the posterior variance at is larger or smaller than the posterior variance at , and why.
How to solve it
Part 1. The kernel values are and . So
Part 2. The posterior variance is . The subtracted term measures how correlated is with the observed points. At the point sits exactly halfway between the two observations, so has large entries () and the variance is reduced a lot. At the point is far from both observations, so has tiny entries () and almost nothing is subtracted — the variance is close to the prior value . Therefore the posterior variance at is smaller than at : the confidence band is tight where the data are and wide where they are not.
Related pages §
- Brownian motion — the Gaussian process with covariance ; its sample paths are continuous but nowhere differentiable.
- Martingales — Brownian motion is the canonical continuous martingale.
- Parent topic: Stochastic processes.