fast_Gp_sim: Approximate GP simulation

View source: R/simulation_functions.R

fast_Gp_simR Documentation

Approximate GP simulation

Description

Calculates an approximation to the inverse Cholesky factor of the covariance matrix using Vecchia's approximation, then the simulation is produced by solving a linear system with a vector of uncorrelated standard normals

Usage

fast_Gp_sim(covparms, covfun_name = "matern_isotropic", locs, m = 30)

Arguments

covparms

A vector of covariance parameters appropriate for the specified covariance function

covfun_name

See GpGp for information about covariance functions.

locs

matrix of locations. Row i of locs specifies the location of element i of y, and so the length of y should equal the number of rows of locs.

m

Number of nearest neighbors to use in approximation

Value

vector of simulated values

Examples

locs <- as.matrix( expand.grid( (1:50)/50, (1:50)/50 ) )
y <- fast_Gp_sim(c(4,0.2,0.5,0), "matern_isotropic",  locs, 30 )
fields::image.plot( matrix(y,50,50) )

joeguinness/GpGp documentation built on Feb. 22, 2024, 9:43 a.m.