fast_Gp_sim_Linv {GpGp} | R Documentation |
Approximate GP simulation with specified Linverse
Description
In situations where we want to do many gaussian process
simulations from the same model, we can compute Linverse
once and reuse it, rather than recomputing for each identical simulation.
This function also allows the user to input the vector of standard normals z
.
Usage
fast_Gp_sim_Linv(Linv, NNarray, z = NULL)
Arguments
Linv |
Matrix containing the entries of Linverse, usually the output from
|
NNarray |
Matrix of nearest neighbor indices, usually the output from |
z |
Optional vector of standard normals. If not specified, these are computed within the function. |
Value
vector of simulated values
Examples
locs <- as.matrix( expand.grid( (1:50)/50, (1:50)/50 ) )
ord <- order_maxmin(locs)
locsord <- locs[ord,]
m <- 10
NNarray <- find_ordered_nn(locsord,m)
covparms <- c(2, 0.2, 1, 0)
Linv <- vecchia_Linv( covparms, "matern_isotropic", locsord, NNarray )
y <- fast_Gp_sim_Linv(Linv,NNarray)
y[ord] <- y
fields::image.plot( matrix(y,50,50) )
[Package GpGp version 0.5.0 Index]