vecchia_profbeta_loglik_grad_info {GpGp} | R Documentation |
Vecchia's loglikelihood, gradient, and Fisher information
Description
This function returns Vecchia's (1988) approximation to the Gaussian loglikelihood, profiling out the regression coefficients, and returning the gradient and Fisher information. Vecchia's approximation modifies the ordered conditional specification of the joint density; rather than each term in the product conditioning on all previous observations, each term conditions on a small subset of previous observations.
Usage
vecchia_profbeta_loglik_grad_info(covparms, covfun_name, y, X, locs, NNarray)
Arguments
covparms |
A vector of covariance parameters appropriate for the specified covariance function |
covfun_name |
See |
y |
vector of response values |
X |
Design matrix of covariates. Row |
locs |
matrix of locations. Row |
NNarray |
A matrix of indices, usually the output from |
Value
A list containing
-
loglik
: the loglikelihood -
grad
: gradient with respect to covariance parameters -
info
: Fisher information for covariance parameters -
betahat
: profile likelihood estimate of regression coefs -
betainfo
: information matrix forbetahat
.
The covariance matrix for $betahat
is the inverse of $betainfo
.
Examples
n1 <- 20
n2 <- 20
n <- n1*n2
locs <- as.matrix( expand.grid( (1:n1)/n1, (1:n2)/n2 ) )
X <- cbind(rep(1,n),locs[,2])
covparms <- c(2, 0.2, 0.75, 0)
y <- X %*% c(1,2) + fast_Gp_sim(covparms, "matern_isotropic", locs, 50 )
ord <- order_maxmin(locs)
NNarray <- find_ordered_nn(locs,20)
#loglik <- vecchia_profbeta_loglik_grad_info( covparms, "matern_isotropic",
# y, X, locs, NNarray )