if (FALSE) {
# build a kernel function on two dimensions
k1 <- rbf(lengthscales = c(0.1, 0.2), variance = 0.6)
k2 <- bias(variance = lognormal(0, 1))
K <- k1 + k2
# use this kernel in a full-rank Gaussian process
f <- gp(1:10, K)
# or in sparse Gaussian process
f_sparse <- gp(1:10, K, inducing = c(2, 5, 8))
# project the values of the GP to new coordinates
f_new <- project(f, 11:15)
# or project with a different kernel (e.g. a sub-kernel)
f_new_bias <- project(f, 11:15, k2)
}
Run the code above in your browser using DataLab