Gaussian process playground

True f(x) = sin(3x) + 0.5x on [-3, 3] plus noise. Plain JS GP (Cholesky), recomputed live.

Data, posterior mean ±2sd, samples · red: where each sample has its minimum

K(X,X)+σ²I

train covariance, N×N

K(x*,X)

test rows listen to data columns

Posterior cov

diagonal = band; rest = hidden correlations

Prior cov

band width = lengthscale