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

Description Usage Arguments Value Author(s) Examples

View source: R/kernels.R

Description

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

Usage

1
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(x1,x2) (or K(x1,x1) if x2 is not defined).

Author(s)

A. F. Lopez-Lopera.

Examples

1
2
3
4
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")

lineqGPR documentation built on Jan. 11, 2020, 9:23 a.m.