powered by
"lineqGP"
Compute the 2D Gaussian kernel matrix for "lineqGP" models. attr: "gradient".
k2gaussian(x1, x2, par, d = 2)
a matrix with the first couple of input locations.
a matrix with the second couple of input locations.
the values of the kernel parameters (variance, lengthscales).
a number corresponding to the dimension of the input space.
Kernel matrix \(K(x_1,x_2)\) (or \(K(x_1,x_1)\) if \(x_2\) is not defined).
# NOT RUN { xgrid <- seq(0, 1, 0.1) x <- as.matrix(expand.grid(xgrid, xgrid)) K <- k2gaussian(x, x, par = c(1, 0.1)) image(K, main = "covariance matrix using a 2D Gaussian kernel") # }
Run the code above in your browser using DataLab