An uncertainty calculation may need thousands of simulator evaluations. A parameter search may ask for thousands more. If a single run takes hours, a faster approximation becomes part of the scientific method: spend a limited simulation budget learning the response, then use that approximation for repeated calculations.
A surrogate or emulator is such a model, . It must be assessed on the inputs and tasks for which it will be used. Small training error alone says little about uncertainty propagation, optimisation or posterior inference. An inaccurate emulator can move an optimum or distort a posterior even when its average error looks modest.
In this chapter: function priors, conditioning, training, using surrogates.
Similarity becomes covariance
The Bayesian feature model assigned correlated uncertainty to function values. A Gaussian process specifies this directly:
for every finite input set, where and . A valid kernel is symmetric and positive semidefinite on every finite set: . This ensures that every proposed variance is nonnegative. It need not be strictly positive definite; repeated inputs, for example, can make singular.
For inputs in , let . The squared-exponential kernel is , with signal variance and lengthscales . Large lengthscales correlate distant inputs; short ones allow rapid change. A Matérn- kernel is
Kernel choice encodes regularity assumptions. The squared-exponential process has derivatives of every mean-square order. A Matérn process has mean-square derivatives exactly when ; hence supports one and two. Saying it is “differentiable exactly times” is incorrect. Sample-path regularity is a related but separate statement. Sums and products of valid kernels remain valid, allowing additive components or interactions. These regularity and composition facts are detailed in Rasmussen and Williams, chapter 4.
Before conditioning, ask what a lengthscale means for whole functions. Keep the same Gaussian innovations and gradually increase the lengthscale. The matrix and the function draws below are two views of the same covariance assumption: longer-range dependence makes nearby values move together.
k(x, x′) = v exp(−(x − x′)² / 2ℓ²)
lengthscale ℓ = 0.18signal variance = 1.0
What does one observation change?
Start with a zero-mean unit-variance GP on a line. Observe at , with independent noise variance . For a new input , Gaussian conditioning gives
The same covariance controls both the mean update and the uncertainty reduction. Before inspecting the figure, consider what a shorter lengthscale should do: it changes how far the observation's information travels, rather than changing the observation itself.
For observations, put , , and . If is positive definite,
These are the posterior mean and latent variance; add for a new noisy observation under the same noise model. The variance reduction is nonnegative because it is a Gaussian conditional covariance. In the noiseless limit, interpolation at training points requires an invertible . With nonzero noise, even the training latent value remains uncertain. A derivation and the multivariate predictive distribution appear in Rasmussen and Williams, chapter 2.
Conditioning is a transformation of a distribution, not just a curve passing through observations. Introduce the observations one at a time and follow the mean and latent variance together. The influence of each observation is tied to its covariance with the rest of the domain.
μ* = k*ᵀC⁻¹y · s*² = k** − k*ᵀC⁻¹k*
0 observations contributinglatent variance at 0 = 1.000
The practical computation solves linear systems. Factor , solve for , and compute . Do not form . A small diagonal jitter can stabilise near-singular arithmetic; record it separately from physical observation noise. Large negative computed variances indicate a numerical or modelling error, not negative uncertainty.
Training includes testing the assumptions
With kernel and noise parameters , the log marginal likelihood is
The quadratic term and the log determinant balance fit and the volume of possible observations. This is the function-space counterpart of the evidence in the preceding chapter. It is generally nonconvex in . Multiple starts, physically meaningful bounds and hyperpriors can help; no fixed number of restarts guarantees the best solution. Hyperparameters may be estimated, integrated out or fixed from justified physical knowledge. They need not always be fitted by evidence maximisation.
Scale inputs by their physical ranges or training-set statistics and centre/scale targets when appropriate; retain the inverse transform and avoid test leakage. A unit lengthscale is interpretable only relative to those scales. Explore noise initialisation rather than always starting high: a deterministic converged simulator and noisy measurements are different modelling situations. Inspect whether fitted noise is absorbing a misspecified mean or kernel.
Exact dense factorisation costs time and storage. After training, a single predictive mean is and a dense predictive variance is generally , since it needs a triangular solve. Inducing-point methods with can reduce common training formulations to , at an approximation cost that must be assessed.
Validate accuracy and interval coverage on withheld simulator runs, with residual checks across the intended domain. A GP's credible intervals are conditional on its model and fitted hyperparameters; being inside the design's convex hull does not guarantee calibration. For decaying kernels, far from all training inputs, so mean and variance revert to their prior values. Periodic, linear and other nondecaying kernels need not do this. Prior reversion describes the model's ignorance, not the true function's behaviour.
Where to spend the next simulator run
Space-filling designs, including Latin hypercubes, can initialise an emulator. Sampling should also reflect the intended downstream distribution: a design suitable for a broad exploration need not resolve a sharply concentrated posterior. Use simulator checks near inferred optima, posterior mass and difficult transitions. Simulation convergence failures may indicate discontinuities or an invalid input regime; a smooth kernel cannot repair them.
The original notes report a Matérn- vacancy-energy surrogate trained on 25 Latin-hypercube points, with test MAE eV, and an extrapolation example where relaxation failed. No data or notebook accompanies those figures. They illustrate the intended use, but are not reproduced benchmarks here.
Other surrogates make different compromises. Polynomial chaos uses polynomial bases orthogonal under a specified input distribution; RBF regression uses local features. Neural networks learn features and can handle complex high-dimensional structure, but their data requirements depend on the problem. A useful surrogate need not interpolate noisy observations exactly, and uncertainty estimates require their own validation.
Bayesian optimisation adds a sequential decision rule to a surrogate; it is not a separate regression family. For minimisation, one possible acquisition is expected improvement,
It rewards promising means and uncertainty that offers a chance of improvement. Evaluate the selected input with the real simulator, update the surrogate, and repeat. This does not promise a global optimum in a universally minimal number of evaluations; the acquisition and assumptions determine the search. Exploring Bayesian Optimization develops this sequential viewpoint visually.
Part B has now supplied the course's statistical foundation: local approximation, regression, uncertainty and expensive-function learning. Part A begins by replacing fixed features with learned representations.