vecchia_lincomb: linear combination of predictions compute the distribution of...

View source: R/vecchia_prediction.R

vecchia_lincombR Documentation

linear combination of predictions compute the distribution of a linear combination Hy

Description

linear combination of predictions compute the distribution of a linear combination Hy

Usage

vecchia_lincomb(H, U.obj, V.ord, cov.mat = FALSE)

Arguments

H

sparse matrix with n.all columns specifying the linear combination

U.obj

U matrix is the full joint approximated cholesky matrix

V.ord

ordered V matrix from vecchia_prediction() or U2V()

cov.mat

logical TRUE or FALSE – should the entire covariance matrix be returned (only do if H has a small number of rows)

Value

Variance of linear combination of predictions.

Examples

n=5; z=rnorm(n); locs=matrix(1:n,ncol=1); n.p=5
vecchia.approx = vecchia_specify(locs,m=3,locs.pred=locs+.5)
preds=vecchia_prediction(z,vecchia.approx,covparms=c(1,2,.5),nuggets=.2)
H=Matrix::sparseMatrix(i=rep(1,n.p),j=n+(1:n.p),x=1/n.p)
vecchia_lincomb(H,vecchia.approx,preds$V.ord,cov.mat=TRUE)

GPvecchia documentation built on Oct. 25, 2022, 1:06 a.m.