Learn R Programming

lineqGPR (version 0.1.1)

k2gaussian: 2D Gaussian Kernel Matrix for "lineqGP" Models.

Description

Compute the 2D Gaussian kernel matrix for "lineqGP" models. attr: "gradient".

Usage

k2gaussian(x1, x2, par, d = 2)

Arguments

x1

a matrix with the first couple of input locations.

x2

a matrix with the second couple of input locations.

par

the values of the kernel parameters (variance, lengthscales).

d

a number corresponding to the dimension of the input space.

Value

Kernel matrix \(K(x_1,x_2)\) (or \(K(x_1,x_1)\) if \(x_2\) is not defined).

Examples

Run this code
# 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