hessFBI: Hessian Matrix for Hyper-parameters in a Guassian Process...

Description Usage Arguments Value Examples

Description

this version of HESS FBI includes the derivative w.r.t the exponential prior this function takes non-transformed theta parameters and takes the derivative with respect to log-transformed theta parameters.

Usage

1
hessFBI(x, y, f, cor.par, lambda = 0.1)

Arguments

x

covariate matrix/ vector x

y

response vector

f

regression model, must be a matrix. if constant should be a vector (as.matrix) of 1s of length n, where n is the number of data points in x

cor.par

matrix of theta and alpha parameters for power-exponential model, includes two columns, the first for theta parameters and the second for alpha parameters. For Guassian correlation structure, alpha parameters can be initialized as 0.

lambda

parameter for exponential prior, defaults to 0.1

Value

returns a matrix of partial second derivatives w.r.t tau = log(theta) correlation parameters. Taking the negative inverse of this hessian matrix provides the fisher approximation of the covariance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
n <- 5
x1 <- seq(-5,10,length.out = n)
x2 <- seq(0,15,length.out = n)
x <- expand.grid(x1,x2)
d2 <- c(0.01,0.2,0,0)
cor.par <- data.frame(matrix(data = d2,nrow = dim(x)[2],ncol = 2))
names(cor.par) <- c("Theta.y","Alpha.y")

R <- cor.matrix(x,cor.par) # obtain covariance matrix
L <- chol(R)
z <- as.vector(rnorm(n^2))
y <- t(L)%*%z

f <- as.matrix(rep(1,n^2))
hess <- hessFBI(x,y,f,cor.par)

galotalp/gpMCMC documentation built on May 16, 2019, 5:36 p.m.