lmFilter: Unsupervised Spatial Filtering with Eigenvectors in Linear...

View source: R/lmFilter.R

lmFilterR Documentation

Unsupervised Spatial Filtering with Eigenvectors in Linear Regression Models

Description

This function implements the eigenvector-based semiparametric spatial filtering approach in a linear regression framework using ordinary least squares (OLS). Eigenvectors are selected by an unsupervised stepwise regression technique. Supported selection criteria are the minimization of residual autocorrelation, maximization of model fit, significance of residual autocorrelation, and the statistical significance of eigenvectors. Alternatively, all eigenvectors in the candidate set can be included as well.

Usage

lmFilter(
  y,
  x = NULL,
  W,
  objfn = "MI",
  MX = NULL,
  sig = 0.05,
  bonferroni = TRUE,
  positive = TRUE,
  ideal.setsize = FALSE,
  alpha = 0.25,
  tol = 0.1,
  boot.MI = NULL,
  na.rm = TRUE
)

## S3 method for class 'spfilter'
summary(object, EV = FALSE, ...)

Arguments

y

response variable

x

vector/ matrix of regressors (default = NULL)

W

spatial connectivity matrix

objfn

the objective function to be used for eigenvector selection. Possible criteria are: the maximization of the adjusted R-squared ('R2'), minimization of residual autocorrelation ('MI'), significance level of candidate eigenvectors ('p'), significance of residual spatial autocorrelation ('pMI') or all eigenvectors in the candidate set ('all')

MX

covariates used to construct the projection matrix (default = NULL) - see Details

sig

significance level to be used for eigenvector selection if objfn = 'p' or objfn = 'pMI'

bonferroni

Bonferroni adjustment for the significance level (TRUE/ FALSE) if objfn = 'p'. Set to FALSE if objfn = 'pMI' - see Details

positive

restrict search to eigenvectors associated with positive levels of spatial autocorrelation (TRUE/ FALSE)

ideal.setsize

if positive = TRUE, uses the formula proposed by Chun et al. (2016) to determine the ideal size of the candidate set (TRUE/ FALSE)

alpha

a value in (0,1] indicating the range of candidate eigenvectors according to their associated level of spatial autocorrelation, see e.g., Griffith (2003)

tol

if objfn = 'MI', determines the amount of remaining residual autocorrelation at which the eigenvector selection terminates

boot.MI

number of iterations used to estimate the variance of Moran's I. If boot.MI = NULL (default), analytical results will be used

na.rm

remove observations with missing values (TRUE/ FALSE)

object

an object of class spfilter

EV

display summary statistics for selected eigenvectors (TRUE/ FALSE)

...

additional arguments

Details

If W is not symmetric, it gets symmetrized by 1/2 * (W + W') before the decomposition.

If covariates are supplied to MX, the function uses these regressors to construct the following projection matrix:

M = I - X (X'X)^-1X'

Eigenvectors from MWM using this specification of M are not only mutually uncorrelated but also orthogonal to the regressors specified in MX. Alternatively, if MX = NULL, the projection matrix becomes M = I - 11'/*n*, where 1 is a vector of ones and *n* represents the number of observations. Griffith and Tiefelsdorf (2007) show how the choice of the appropriate M depends on the underlying process that generates the spatial dependence.

The Bonferroni correction is only possible if eigenvector selection is based on the significance level of the eigenvectors (objfn = 'p'). It is set to FALSE if eigenvectors are added to the model until the residuals exhibit no significant level of spatial autocorrelation (objfn = 'pMI').

Value

An object of class spfilter containing the following information:

estimates

summary statistics of the parameter estimates

varcovar

estimated variance-covariance matrix

EV

a matrix containing the summary statistics of selected eigenvectors

selvecs

vector/ matrix of selected eigenvectors

evMI

Moran coefficient of all eigenvectors

moran

residual autocorrelation in the initial and the filtered model

fit

adjusted R-squared of the initial and the filtered model

residuals

initial and filtered model residuals

other

a list providing supplementary information:

ncandidates

number of candidate eigenvectors considered

nev

number of selected eigenvectors

sel_id

ID of selected eigenvectors

sf

vector representing the spatial filter

sfMI

Moran coefficient of the spatial filter

model

type of the fitted regression model

dependence

filtered for positive or negative spatial dependence

objfn

selection criterion specified in the objective function of the stepwise regression procedure

bonferroni

TRUE/ FALSE: Bonferroni-adjusted significance level (if objfn = 'p')

siglevel

if objfn = 'p' or objfn = 'pMI': actual (unadjusted/ adjusted) significance level

References

Tiefelsdorf, Michael and Daniel A. Griffith (2007): Semiparametric filtering of spatial autocorrelation: the eigenvector approach. Environment and Planning A: Economy and Space, 39 (5): pp. 1193 - 1221.

Griffith, Daniel A. (2003): Spatial Autocorrelation and Spatial Filtering: Gaining Understanding Through Theory and Scientific Visualization. Berlin/ Heidelberg, Springer.

Chun, Yongwan, Daniel A. Griffith, Monghyeon Lee, Parmanand Sinha (2016): Eigenvector selection with stepwise regression techniques to construct eigenvector spatial filters. Journal of Geographical Systems, 18, pp. 67 – 85.

Le Gallo, Julie and Antonio Páez (2013): Using synthetic variables in instrumental variable estimation of spatial series models. Environment and Planning A: Economy and Space, 45 (9): pp. 2227 - 2242.

Tiefelsdorf, Michael and Barry Boots (1995): The Exact Distribution of Moran's I. Environment and Planning A: Economy and Space, 27 (6): pp. 985 - 999.

See Also

glmFilter, getEVs, MI.resid

Examples

data(fakedata)
y <- fakedataset$x1
X <- cbind(fakedataset$x2, fakedataset$x3, fakedataset$x4)

res <- lmFilter(y = y, x = X, W = W, objfn = 'MI', positive = FALSE)
print(res)
summary(res, EV = TRUE)

E <- res$selvecs
(ols <- coef(lm(y ~ X + E)))
coef(res)


spfilteR documentation built on Aug. 23, 2022, 1:06 a.m.