Build the standard kernels from Murphy's book, combine them, and draw functions from GP priors. Inputs are (N, D) arrays (a 1-D array means ); is the Euclidean distance.
kernel(name, X1, X2, **params) returns the (N1, N2) Gram matrix for:
"se_ard" (params ell, a scalar or one length scale per dimension, and sf): ."matern12", "matern32", "matern52" (params ell, sf): times , and ."periodic" (params ell, p, sf): ."cosine" (params p, sf): ."linear" (params sv, c): .compose(spec, X1, X2) evaluates a kernel expression: spec is either (name, params_dict), ("sum", spec_a, spec_b) or ("prod", spec_a, spec_b), nested arbitrarily.
sample_gp_prior(spec, X, n, seed, jitter=1e-8) draws n functions from at the inputs X: factorise , draw Z = np.random.default_rng(seed).standard_normal((N, n)) and return L @ Z, shape (N, n).