View source: R/vecchia_wrappers.R
vecchia_pred | R Documentation |
make spatial predictions using Vecchia based on estimated parameters
vecchia_pred(vecchia.est, locs.pred, X.pred, m = 30, ...)
vecchia.est |
object returned by |
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
|
m |
number of neighbors for vecchia approximation. default is 30. |
... |
additional input parameters for |
object containing prediction means mean.pred and variances var.pred
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.