simulate a Gaussian Markov Random Field from the Matern family. This is developed from the Rue & Held 2005 Algorithim 2.10.

rGMRF(x, y = x, sig2 = 1, rho = 0.5, nu = 1/2, nugget = NULL)

Arguments

x

vector of evenly spaced values in the x-direction

y

vector of evenly spaced values in the y-direction (default is the same as x)

sig2

gives the marginal variance of the process

rho

is effective range/lengthscale

nu

is smoothness for the Matern, can be either 1/2, 3/2, 5/2 if none of these then an error will be thrown.

nugget

is nugget variance. Default is NULL.

Examples

# exponential with no nugget
x <- y <- seq(-2, 2, len=250)
covsim1 <- rGMRF(x,y, sig2 = 10,rho = .5, nu = 1/2)
image(x,y,covsim1)

# 3/2 Matern with nugget
x <- y <- seq(-2, 2, len=250)
covsim2 <- rGMRF(x,y,sig2 = .1,rho = .5, nu = 3/2, nugget = 1.5^2)
image(x,y,covsim2)