Gaussian process regression treats an unknown function as a random function whose values have a joint Gaussian distribution determined by a kernel. In this simulator the hidden target is sampled through user-added observations, then the posterior is recomputed from K(X,X)+σ_n²I using a Cholesky solve. The blue curve is the posterior mean μ(x), the translucent band is roughly a 95% latent uncertainty interval μ(x)±2σ(x), and the yellow dots are observed data. Choose an RBF kernel for very smooth functions or Matérn 3/2 / 5/2 kernels for rougher priors, then tune the length scale, signal variance, and observation noise to see how the posterior changes. The active-sampling button greedily adds the point with largest posterior standard deviation, illustrating exploration based on uncertainty rather than current prediction error.
Who it's for: Students in statistics, machine learning, numerical modelling, or Bayesian inference who want geometric intuition for kernels, posterior uncertainty, and active learning.
Key terms
Gaussian process
Kernel
RBF kernel
Matérn kernel
Posterior mean
Uncertainty band
Cholesky factorization
Active sampling
How it works
Interactive Gaussian process regression with RBF and Matérn kernels: click to add observations, tune length scale/noise, inspect posterior mean and uncertainty, and use max-variance active sampling.
The kernel defines how strongly function values at two input locations are correlated. A short length scale lets the posterior wiggle between nearby samples, while a long length scale enforces broad smooth trends. Matérn kernels are less smooth than the RBF kernel, so they tolerate sharper changes.
Why does uncertainty shrink near observations?
Conditioning a joint Gaussian on observed values reduces posterior variance most strongly near those input locations. Observation noise prevents the uncertainty from collapsing completely and makes the mean less eager to pass exactly through every point.
Is max-variance active sampling always optimal?
No. It is a simple exploration strategy: sample where the model is most uncertain. Practical Bayesian optimization or experimental design often combines uncertainty with expected improvement, cost, constraints, or a task-specific objective.