
Stepwise Moran eigenvector spatial filter
Source:R/MoranEigenvectorFilter.R
MoranEigenvectorFilter.RdFollowing 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).
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.