f ~ GP(0, k_l) with l itself given a prior. The evidence-weighted posterior over the length scale concentrates near the scale of the truth, which is how a Gaussian prior adapts to an unknown smoothness without being told it. The marginal likelihood of each candidate l is exact – the model is conjugate Gaussian – so the selection involves no approximation beyond the finite grid of candidates.
Usage
Ghosalgpadaptthm(
n = 60,
l_true = 0.2,
l_grid = c(0.05, 0.2, 0.8),
noise = 0.1,
seed = 42
)Details
Formula: log p(y | l) = -y' (K_l + sigma^2 I)^(-1) y / 2
log det(K_l + sigma^2 I) / 2, up to the constant.
