Skip to contents

Generates nCoords x nsim matrix of simulated values of the SPDE spatial process

Usage

simSPDE(
  coords,
  nsim = 1,
  mesh,
  effRange = (max(coords[, 1]) - min(coords[, 1]))/3,
  margVar = 1,
  inla.seed = 0L
)

Arguments

coords

2 column matrix of spatial coordinates at which to simulate the spatial process

nsim

number of draws from the SPDE model

mesh

SPDE mesh

effRange

effective spatial range

margVar

marginal variance of the spatial process

inla.seed

seed input to inla.qsample. 0L sets seed intelligently, > 0 sets a specific seed, < 0 keeps existing RNG

References

Lindgren, F., Rue, H., Lindström, J., 2011. An explicit link between Gaussian fields and Gaussian Markov random fields: the stochastic differential equation approach (with discussion). Journal of the Royal Statistical Society, Series B 73, 423–498.

Author

John Paige

Examples

if (FALSE) { # \dontrun{
set.seed(123)
require(INLA)
coords = matrix(runif(10*2), ncol=2)
mesh = inla.mesh.2d(loc.domain=cbind(c(0, 0, 1, 1), c(0, 1, 0, 1)), 
  n=3000, max.n=5000, max.edge=c(.01, .05), offset=-.1)
simVals = simSPDE(coords, nsim=1, mesh, effRange=.2, inla.seed=1L)
} # }