Function to generate spatially autocorrelated random normal variates using the eigendecomposition method. Spatial covariance can follow either and exponential or Gaussian model.
rmvn.spa(x, y, p, method = "exp", nugget = 1)
vector of length n representing the x coordinates (or latitude; see latlon).
vector of length n representing the y coordinates (or longitude).
the range of the spatial models.
correlation function "exp" (exponential) or "gaus" (gaussian). Exponential is the default.
correlation at the origin (defaults to one)
A vector of spatially correlated random normal variates with zero mean and unit variance is returned
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).
Ripley, B.D. (1987). Stochastic Simulation. Wiley.