rmvn.spa: Simulate spatial data
Description
Function to generate spatially autocorrelated random normal variates
using the eigendecomposition method. Spatial covariance can
follow either and exponential or Gaussian model.
Usage
rmvn.spa(x, y, p, method = "exp", nugget = 1)
Arguments
x
vector of length n representing the x coordinates (or latitude; see latlon).
y
vector of length n representing the y coordinates (or longitude).
p
the range of the spatial models.
method
correlation function "exp" (exponential) or "gaus" (gaussian).
exponential is the default.
nugget
correlation at the origin (defaults to one)
Value
a vector of spatially correlated random normal variates with zero
mean and unit variance is returned
Details
A target covariance matrix A between the n units is generated by calculating
the distances between the locations and thereafter evaluating the covariance
function in each pairwise distance. A vector, Z, of spatially correlated
normal data with the target covariance is subsequently generated using
the eigendecomposition method (Ripley, 1987).
References
Ripley, B.D. (1987). Stochastic Simulation. Wiley.