Skip to contents

Following Tiefelsdorf and Griffith (2007) as spatialreg::SpatialFiltering (style C, symmetric, ExactEV FALSE): the binary neighbour matrix is symmetrised and scaled to sum to n, projected with \(M_X = I - X(X'X)^{-1}X'\) to \(M_X S M_X\) and eigendecomposed. Among the eigenvectors whose eigenvalue has the sign of the residual autocorrelation (|value| > zerovalue), each step adds the one bringing the residual Moran's I closest to its expectation in standard deviations under the current design (\(E = tr(MSM)/df\), \(Var = 2(df\,tr(MSM^2) - tr(MSM)^2) / (df^2(df + 2))\)). Selection stops once |z| < tol or |z| grows (with alpha: once the two-sided p-value reaches alpha).

Usage

MoranEigenvectorFilter(
  y,
  X,
  adjacency,
  tol = 0.1,
  zerovalue = 1e-04,
  alpha = NULL
)

Arguments

y

Response.

X

Design matrix, including any intercept column.

adjacency

Neighbour indicator matrix; symmetrised internally.

tol

Stop when |z| of the residual Moran's I is below it.

zerovalue

Eigenvalues within it of zero are never candidates.

alpha

Optional p-value stopping rule in place of tol.

Value

List with selection (data frame: step, evec (1-based, decreasing eigenvalue order), eval, moran, z, p_value, r2, gamma), vectors, coefficients, fitted and stop_reason ("tol", "alpha", "inversion" or "exhausted"). Eigenvector signs are arbitrary, so a gamma can flip sign with its vector; fitted values do not.

References

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

Examples

A <- 1 * (abs(outer(1:12, 1:12, "-")) == 1)
y <- c(1, 1.4, 2.2, 2.9, 3.1, 2.6, 2, 1.1, .8, 1.5, 2.4, 2.7)
X <- cbind(1, c(.2, .5, .1, .9, .4, .3, .8, .6, .7, .05, .35, .55))
MoranEigenvectorFilter(y, X, A)$selection$evec
#> [1] 0 1 3