rmvn.spa: Simulate spatially correlated data

View source: R/utilities.R

rmvn.spaR Documentation

Simulate spatially correlated 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)

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).

Value

A vector of spatially correlated random normal variates with zero mean and unit variance is returned

Author(s)

Ottar N. Bjornstad onb1@psu.edu

References

Ripley, B.D. (1987). Stochastic Simulation. Wiley.

See Also

mSynch


ncf documentation built on May 7, 2022, 5:05 p.m.