Given a spatial weights matrix and degree of autocorrelation, returns autocorrelated data.
The number of samples required. Defaults to m=1
to return an n
-length vector; if m>1
, an m x n
matrix is returned (i.e. each row will contain a sample of correlated values).
An n
-length vector of mean values. Defaults to a vector of zeros with length equal to nrow(w)
.
Row-standardized n x n
spatial weights matrix.
Spatial autocorrelation parameter in the range (-1, 1). Typically a scalar value; otherwise an n-length numeric vector.
Scale parameter (standard deviation). Defaults to sigma = 1
. Typically a scalar value; otherwise an n-length numeric vector.
further arguments passed to MASS::mvrnorm
.
If m = 1
a vector of the same length as mu
, otherwise an m x length(mu)
matrix with one sample in each row.
Calls MASS::mvrnorm
internally to draw from the multivariate normal distribution. The covariance matrix is specified following the simultaneous autoregressive (SAR) model.
aple
, mc
, moran_plot
, lisa
, shape2mat