Back

GP Kernel Zoo

What you are seeing: a Gaussian Process is a probability distribution over functions: pick any kernel k(x,x)k(x, x') and the GP says "any function I might draw has covariance given by kk". Top panel: five random functions drawn from the prior (no observations) at the current kernel. Bottom panel: five draws from the posterior after conditioning on three observed points (yellow dots) with noise σn\sigma_n.

Five kernels: RBF (squared exponential, very smooth), Matern 3/2 (continuous, 1-time-differentiable), Matern 5/2 (twice differentiable), periodic (exact repetition with period pp), linear (Bayesian linear regression in kernel disguise). The blue band is mean ±\pm 2 sigma. Click on the plot to add an observation.

Figure 1. Gaussian Process kernel zoo with prior and posterior samples. Method: Cholesky factorization of the covariance matrix, exact conditioning.
kernel
l (length)0.70
sigma_f1.00
sigma_n0.05

WHAT TO TRY

  • Switch the kernel: RBF gives smooth curves, Matern rougher ones, periodic repeating ones. The prior fog of sample functions takes on exactly the character the kernel encodes.
  • Shorten the length scale: the prior wiggles faster and the posterior band snaps back to the data sooner, so the fit trusts only nearby points.
  • Add observations: the posterior band pinches to zero at each one and balloons between them, the calibrated uncertainty that makes a Gaussian process more than a curve fit.