vecchia_pred: make spatial predictions using Vecchia based on estimated...

View source: R/vecchia_wrappers.R

vecchia_predR Documentation

make spatial predictions using Vecchia based on estimated parameters

Description

make spatial predictions using Vecchia based on estimated parameters

Usage

vecchia_pred(vecchia.est, locs.pred, X.pred, m = 30, ...)

Arguments

vecchia.est

object returned by vecchia_estimate

locs.pred

n.p x d matrix of prediction locations

X.pred

n.p x p matrix of trend covariates at prediction locations. does not need to be specified if constant or no trend was used in vecchia_estimate

m

number of neighbors for vecchia approximation. default is 30.

...

additional input parameters for vecchia_specify

Value

object containing prediction means mean.pred and variances var.pred

Examples


n=10^2; locs=cbind(runif(n),runif(n))
covparms=c(1,.1,.5); nuggets=rep(.1,n)
Sigma=exp(-fields::rdist(locs)/covparms[2])+diag(nuggets)
z=as.numeric(t(chol(Sigma))%*%rnorm(n));
data=z+1
vecchia.est=vecchia_estimate(data,locs,theta.ini=c(covparms,nuggets[1]))
n.p=30^2; grid.oneside=seq(0,1,length=round(sqrt(n.p)))
locs.pred=as.matrix(expand.grid(grid.oneside,grid.oneside))
vecchia.pred=vecchia_pred(vecchia.est,locs.pred)


GPvecchia documentation built on June 22, 2024, 11:13 a.m.