Learn R Programming

lineqGPR (version 0.1.1)

kernCompute: Kernel Matrix for "lineqGP" Models.

Description

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

Usage

kernCompute(x1, x2 = NULL, type, par, d = 1L)

Arguments

x1

a vector with the first input locations.

x2

a vector with the second input locations.

type

a character string corresponding to the type of the kernel. Options: "gaussian", "matern32", "matern52", "exponential".

par

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

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 {
x <- seq(0, 1, 0.01)
K <- kernCompute(x, type = "gaussian", par =  c(1, 0.1))
image(K, main = "covariance matrix")

# }

Run the code above in your browser using DataLab