A covariance function, or kernel, tells a Gaussian process how function values at two inputs vary together. It turns similarity into correlation: similar days can inform a weather prediction, and similar houses in the same neighborhood can inform a house-price prediction. It also shapes predictive uncertainty, which makes GP models useful for decisions under uncertainty. section 2.0 section 13.0
Formally, a covariance function takes two inputs, x1 and x2, and returns the covariance of f(x1) and f(x2). At the same input, this is the variance of f(x); at different inputs, it describes their correlation. Together with the mean function, it defines a GP as a distribution over functions rather than a fixed-size vector. section 2.3 section 3.2
Kernel choice is prior knowledge about an objective function. The covariance function specifies relationships among points and how quickly and smoothly the objective changes across its domain. A poor similarity measure can make a GP compare irrelevant features and produce unhelpful predictions; an appropriate one emphasizes features that matter to the target. section 3.2 section 13.0
Important controls and kernel choices include:
- Length scale: controls output variability as inputs change. A larger length scale produces smoother predictions and lower predictive uncertainty. section 3.6
- Output scale: controls the range of function outputs. A larger output scale yields a larger output range and greater predictive uncertainty. section 3.6
- Automatic relevance determination (ARD): assigns each input dimension its own length scale when dimensions vary at different rates. section 3.6
- RBF and Matérn kernels: the Matérn class generalizes the RBF kernel and uses its nu parameter to represent different levels of smoothness. section 3.0 section 3.6
Three-point Forrester surrogate
Fit a GP to three randomly sampled points from the Forrester function between −3 and 3, then vary covariance-function components and compare the resulting predictions. The changes make kernel selection concrete: the kernel alters the modeled structure and smoothness, not merely a numerical setting. section 3.4
Figure 13.1 The covariance between houses computed by an inappropriate kernel. Because it looks only at the color of the front door, this kernel doesn’t produce appropriate covariances.
Compare an inappropriate house-similarity kernel based only on front-door color with one that accounts for relevant features such as location and living area. section 13.0
