Gaussian Process Regression
Summary
Regression — inferring a function from finitely many (noisy) evaluations — is the low-level operation inside every numerical method and the canonical PN latent object. This note develops it two ways: parametric (Gaussian prior on weights of feature functions) and nonparametric (a Gaussian process , the infinite-dimensional limit). Both give closed-form Gaussian posterior mean and covariance over function values. The GP posterior mean coincides with kernel ridge regression / least-squares, and its posterior variance equals the RKHS worst-case error — the bridge PN uses to reinterpret classical methods.
Overview
In numerical applications the objects of interest are usually real-valued functions: the integrand for quadrature, the objective for optimisation, the vector field for an ODE. Applying the Gaussian inference machinery to functions is the central tool of PN. Regression is “an internal operation of all numerical methods and arguably a low-level numerical algorithm in itself.” From the ML/statistics viewpoint regression is not computation but learning — highlighting once more the fundamental similarity of computation and learning (Computation as Probabilistic Inference).
Two equivalent constructions: start finite (weights over features) then take to obtain a Gaussian process, a Gaussian measure over an infinite-dimensional function space in which only finite marginals — governed by a mean function and a covariance kernel — are ever manipulated.
Main Content
Parametric (weight-space) Gaussian regression
Linear feature model
Assume is a weighted sum of feature functions :
For a data set , write (columns are feature vectors), and . The model is linear in the weights (though generally nonlinear in ) — a linear regression model. (Eq. 4.1.)
Place a Gaussian prior and observe corrupted by Gaussian noise, with (the case gives exact, machine-precision observations ). By the conditioning formula (Eq. 3.13), the posterior over weights is
Inference in weight space costs . Via the matrix inversion lemma this can be rewritten with an inverse. The induced posterior over function values at test points is (Eq. 4.3):
Crucially, function-space expressions contain the features only through inner products
the covariance function and mean function . The features are “encapsulated” — motivating the kernel trick and the nonparametric limit. (The maximum-likelihood/OLS estimate is the flat-prior special case, Exercise 4.1.)
Positive-definite kernels
Kernel (positive semi-definite)
A function is a positive (semi-)definite kernel if for every finite set the Gram matrix is positive (semi-)definite. Such are also called Mercer kernels / covariance functions. (Def. 4.2.)
Kernels form a semi-ring: if are kernels and , then , , the Hadamard product (Schur’s theorem), and for any map are all kernels. Standard examples over :
The square-exponential kernel arises as the limit of a Gaussian-feature model with feature prior variance scaled as (Eq. 4.4): infinitely many degrees of freedom, finite total prior mass.
Nonparametric limit: the Gaussian process
Gaussian process
Given a mean function and a positive-definite kernel , the Gaussian process is the measure such that, for any finite subset , the function values are jointly Gaussian, . (Def. 4.4.) It extends regression from finite weight vectors to real-valued functions.
GP regression posterior
Given a GP prior and Gaussian likelihood , the posterior is a GP, , with
Here is the row vector of covariances between test point and data . The dominant cost is the Cholesky factorisation of the Gram matrix ; the mean prediction at a new point is then and the marginal variance .
Connection to least-squares / kernel ridge regression / RKHS
Each kernel is associated (Moore–Aronszajn) with a reproducing kernel Hilbert space (RKHS) : functions with and the reproducing property . The GP posterior mean is exactly the kernel ridge regression estimate — the minimiser of a regularised empirical risk over :
Posterior variance = worst-case error (noise-free)
Let be the RKHS of a positive-definite kernel , and consider with . For noise-free data () at , the pointwise error between and the posterior mean is tightly bounded above by the GP posterior marginal variance:
Thus the Bayesian expected squared error equals the worst-case squared error over the unit RKHS ball — the linchpin identity that lets PN endow classical point estimates with calibrated error bars.
Inference on and from derivatives and integrals
Because linear maps preserve Gaussianity (Eq. 3.4), if with sufficiently differentiable/integrable , then any partial derivatives and integrals are jointly Gaussian with . Their mean/covariance functions are obtained by applying the same linear operator to and to each argument of , e.g.
This is the engine of Bayesian Quadrature (observe , infer ) and ODE filters (relate and ).
Examples
Two viewpoints on the same estimate
(1) Assign with noise-free likelihood; the posterior is a GP with mean and variance . (2) Assume the true and take the regularised least-squares estimate (Eq. 4.8) — it equals , and its distance to the truth is bounded by times the (unknown) RKHS norm of . The probabilistic and the approximation-theoretic stories give the same point estimate and error, but the prior is a generative object one can sample and criticise, whereas an empirical risk is not.
Integrated Wiener process posterior = cubic spline
Under the once-integrated Wiener process kernel (a Gauss–Markov prior, see Gauss-Markov Processes and SDEs) and noise-free observations, the GP posterior mean is the piecewise-cubic interpolant of the data — the classical cubic spline. This is a first concrete instance of “a classical numerical method is a Gaussian posterior mean.”
Connections
- Specialises Gaussian Distributions and Algebra to infinite dimension (marginalisation reads off finite sub-blocks).
- Univariate GPs with the Markov property are Gauss-Markov Processes and SDEs, enabling inference via Bayesian Filtering and Smoothing.
- Kernel/covariance choice and its hyperparameters are calibrated in Hierarchical Inference in Gaussian Models.
- The worst-case/expected-error identity underlies Convergence and Priors in Bayesian Quadrature and Uncertainty Calibration for Linear Solvers.
See Also
- Gaussian Distributions and Algebra — the finite-dimensional parent.
- Gauss-Markov Processes and SDEs — GPs with finite memory (linear-time inference).
- Bayesian Quadrature — GP regression used to infer integrals.
- Kernel Quadrature and Kernel Means — RKHS/kernel-mean view of integration.
- Classical Quadrature as Inference — trapezoid/Gauss rules as the posterior mean of this regression applied to the integrand.
- ODE Filters and Smoothers — GP regression in state-space form, conditioned on the ODE vector field.
- First- and Second-Order Optimisation Methods — BFGS as Gaussian regression on the Hessian.