Learn R Programming

GPvecchia (version 0.1.7)

vecchia_lincomb: 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)

Value

Variance of linear combination of predictions.

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)

Examples

Run this code
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)

Run the code above in your browser using DataLab