Skip to contents

Model \(y = X\beta + u\), \(u = \lambda W u + e\) (Kelejian and Prucha 1999). The OLS residuals give the moment system of KPMoments; \((\lambda, \sigma^2)\) minimise \(|G (\lambda, \lambda^2, \sigma^2)' - g|^2\) (profiled over \(\sigma^2\), then Brent on \(\lambda\)), and \(\beta\) is the feasible GLS fit of \(y - \lambda Wy\) on \(X - \lambda WX\). As spatialreg::GMerrorsar, the coefficient covariance is \(s^2 (B'B)^{-1}\) with \(B = X - \lambda WX\) and \(s^2 = |e - \lambda We|^2 / n\) from the OLS residuals e.

Usage

GMErrorSAR(
  y,
  X,
  W,
  se_lambda = TRUE,
  lambda_se_method = c("trace", "spatialreg"),
  interval = c(-0.999, 0.999)
)

Arguments

y

Response.

X

Design matrix, including any intercept column.

W

Spatial weights matrix.

se_lambda

Also compute the standard error of \(\lambda\).

lambda_se_method

"trace" or "spatialreg".

interval

Search interval for \(\lambda\).

Value

List with lambda, sigma2_gm, coefficients, se, s2, lambda_se, fitted, residuals.

Details

The standard error of \(\lambda\) follows Kelejian and Prucha (2004), with \(\Phi_{rs} = s^4 tr((A_r + A_r')(A_s + A_s')) / (2n)\), \(A_2 = W'W\), \(A_1 = c (W'W - (tr(W'W)/n) I)\). spatialreg uses the trace for \(\Phi_{11}\) but the sum of all entries of the product for \(\Phi_{12}\) and \(\Phi_{22}\). lambda_se_method = "trace" (default) uses the trace throughout, as Kelejian and Prucha (2004); "spatialreg" reproduces spatialreg's entry sums.

References

Kelejian, H. H. and Prucha, I. R. (1999). A generalized moments estimator for the autoregressive parameter in a spatial model. International Economic Review 40, 509-533.

Kelejian, H. H. and Prucha, I. R. (2004). Estimation of simultaneous systems of spatially interrelated cross sectional equations. Journal of Econometrics 118, 27-50.

Examples

W <- 1 * (abs(outer(1:8, 1:8, "-")) == 1)
W <- W / rowSums(W)
X <- cbind(1, c(.1, .6, .2, .9, .3, .5, .8, .4))
GMErrorSAR(c(1, 2.2, 1.4, 3.1, .9, 2, 2.6, 1.1), X, W)$lambda
#> [1] -0.04211688