View source: R/Gaussian_hessian.R
Gaussian_hessianC | R Documentation |
Calculate Hessian for a GP with Gaussian correlation
Gaussian_hessianC(XX, X, Z, Kinv, mu_hat, theta)
XX |
The vector at which to calculate the Hessian |
X |
The input points |
Z |
The output values |
Kinv |
The inverse of the correlation matrix |
mu_hat |
Estimate of mu |
theta |
Theta parameters for the correlation |
Matrix, the Hessian at XX
set.seed(0)
n <- 40
x <- matrix(runif(n*2), ncol=2)
f1 <- function(a) {sin(2*pi*a[1]) + sin(6*pi*a[2])}
y <- apply(x,1,f1) + rnorm(n,0,.01)
gp <- GauPro(x,y, verbose=2, parallel=FALSE);gp$theta
gp$hessian(c(.2,.75), useC=TRUE) # Should be -38.3, -5.96, -5.96, -389.4 as 2x2 matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.