Skip to contents

SdmML: \(y = \rho W y + X\beta + W X\theta + e\) by maximum likelihood (SpatialRegressionML lag model on \([X, WX]\), constant columns not lagged), with average direct, indirect and total impacts and the spillover index indirect/total, as spatialreg::lagsarlm(Durbin = TRUE) and impacts. BreuschPagan: original (half the explained sum of squares of \(e^2/\sigma^2 - 1\) on \(Z\)) or Koenker's studentized (\(n R^2\)) test, as lmtest::bptest. SpatialBPTest: the test on lag-model residuals (\(Z = X\)) or error-model residuals (\(Z = X - \lambda W X\)), as spatialreg::bptest.Sarlm. Identical to the Python arm morie.fn.sptests.

Usage

SdmML(y, X, W, interval = c(-0.999, 0.999))

BreuschPagan(residuals, Z, studentize = TRUE)

SpatialBPTest(y, X, W, model = "lag", studentize = TRUE)

Arguments

y

Response.

X

Design matrix including the intercept column.

W

Spatial weights matrix.

interval

Search interval for \(\rho\).

residuals

Residuals.

Z

Variance regressors including the intercept.

studentize

Koenker's studentized version.

model

"lag" or "error".

Value

List.

References

LeSage, J. and Pace, R. K. (2009). Introduction to Spatial Econometrics. CRC Press.

Breusch, T. S. and Pagan, A. R. (1979). A simple test for heteroscedasticity and random coefficient variation. Econometrica 47, 1287-1294.

Koenker, R. (1981). A note on studentizing a test for heteroscedasticity. Journal of Econometrics 17, 107-112.

Examples

BreuschPagan(c(1, -1, 2, -2, 3, -3), cbind(1, c(0, 0, 1, 1, 0, 0), c(0, 0, 0, 0, 1, 1)))$statistic
#> [1] 6