cov.RQ.d: Rational quadratic covariance function derivatives wrt...

Description Usage Examples

View source: R/covariance-functions.R

Description

Rational quadratic covariance function derivatives wrt hyperparameters

Usage

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
point1 = matrix(rnorm(1), ncol=1)
point2 = matrix(rnorm(1), ncol=1)
beta   = rnorm(3) # Logarithms of variance, length scale & alpha

library(numDeriv)
Ks.2points = vapply(cov.RQ.d(point1, point2, beta=beta), function(K) {
  K[1,1]
}, numeric(1))
Ks.2points.num = grad(function(beta_) {
  as.numeric(cov.RQ(point1, point2, beta=beta_))
}, x=beta)
stopifnot(all.equal(Ks.2points, Ks.2points.num))

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