Skip to contents

MoranEigenvectors: Moran eigenvector maps, the eigenvectors of the doubly centred symmetrised weights computed in the Helmert basis of the complement of the constant, with Moran's I (n/S0) lambda and the positive/negative sets. EigenvectorFiltering: forward selection of eigenvectors by residual Moran's I (Tiefelsdorf and Griffith 2007), AIC, leave-one-out prediction error or R-squared gain, keeping at least two residual degrees of freedom. GetisFilter: Getis (1995) filtering. Identical to the Python arm morie.fn.sfilter (eigenvector indices are 1-based here).

Usage

MoranEigenvectors(W)

EigenvectorFiltering(
  y,
  W,
  X = NULL,
  criterion = "moran",
  candidates = "positive",
  tol = 0.1,
  max_vectors = NULL
)

GetisFilter(x, W)

Arguments

W

Spatial weights matrix.

y

Response.

X

Optional covariate matrix (an intercept is added).

criterion

"moran", "aic", "press" or "r2".

candidates

"positive", "negative" or "all".

tol

Stopping tolerance.

max_vectors

Maximum number of eigenvectors.

x

Positive variable to filter.

Value

List.

References

Griffith, D. A. (2003). Spatial Autocorrelation and Spatial Filtering. Springer.

Tiefelsdorf, M. and Griffith, D. A. (2007). Semiparametric filtering of spatial autocorrelation: the eigenvector approach. Environment and Planning A 39, 1193-1221.

Getis, A. (1995). Spatial filtering in a regression framework. In L. Anselin and R. Florax (eds), New Directions in Spatial Econometrics, Springer, 172-185.

Examples

MoranEigenvectors(rbind(c(0, 1, 0), c(1, 0, 1), c(0, 1, 0)))$moran_i
#> [1]  4.163336e-17 -1.000000e+00
GetisFilter(c(2, 4, 6), rbind(c(0, 1, 0), c(1, 0, 1), c(0, 1, 0)))$filtered
#> [1] 2.5 4.0 4.5