cov.SE: Squared exponential covariance function.

Description Usage Arguments Examples

View source: R/covariance-functions.R

Description

The squared exponential covariance function. This produces a semidefinite covariance matrix, and should only be used when constructing new covariance functions. E.g., the squared exponential plus independant.

Usage

1
cov.SE(X, X2, beta, D = NA, ...)

Arguments

X

Matrix of data

X2

(optional) second matrix of data; if omitted, X is used.

beta

Hyperparameters; beta[1] is the log signal variance, beta[2] is the log length scale.

Examples

1
2
3
4
5
6
7
# Confirm that diagonal of covariance matrix is the specified variance, and
# the off-diagonals are less than this.
grid = matrix(1:10, ncol=1)
beta = rnorm(2)
K    = cov.SE(grid, beta=beta)
stopifnot(all(Matrix::diag(K)==exp(beta[1])))
stopifnot(all(K[upper.tri(K)]<exp(beta[1])))

JimSkinner/spca documentation built on Aug. 19, 2018, 7 a.m.