vecchia_grouped_profbeta_loglik: Grouped Vecchia approximation, profiled regression...

View source: R/RcppExports.R

vecchia_grouped_profbeta_loglikR Documentation

Grouped Vecchia approximation, profiled regression coefficients

Description

This function returns a grouped version (Guinness, 2018) of Vecchia's (1988) approximation to the Gaussian loglikelihood and the profile likelihood estimate of the regression coefficients. The 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_grouped_profbeta_loglik(covparms, covfun_name, y, X, locs, NNlist)

Arguments

covparms

A vector of covariance parameters appropriate for the specified covariance function

covfun_name

See GpGp for information about covariance functions.

y

vector of response values

X

Design matrix of covariates. Row i of X contains the covariates for the observation at row i of locs.

locs

matrix of locations. Row i of locs specifies the location of element i of y, and so the length of y should equal the number of rows of locs.

NNlist

A neighbor list object, the output from group_obs.

Value

a list containing

  • loglik: the loglikelihood

  • betahat: profile likelihood estimate of regression coefficients

  • betainfo: information matrix for betahat.

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 <- fast_Gp_sim(covparms, "matern_isotropic", locs, 50 )
ord <- order_maxmin(locs)
NNarray <- find_ordered_nn(locs,20)
NNlist <- group_obs(NNarray)
#loglik <- vecchia_grouped_profbeta_loglik( 
#    covparms, "matern_isotropic", y, X, locs, NNlist )

joeguinness/GpGp documentation built on Feb. 22, 2024, 9:43 a.m.