Skip to contents

With residuals u, \(wu = Wu\) and \(wwu = W Wu\), the three moment conditions are \(G (\lambda, \lambda^2, \sigma^2)' = g\) (Kelejian and Prucha 1999), as spatialreg:::.kpwuwu.

Usage

KPMoments(u, W)

Arguments

u

Residual vector.

W

Spatial weights matrix.

Value

List with G (3 x 3), g, trwpw (\(tr(W'W)\)), wu, wwu.

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.

Examples

W <- 1 * (abs(outer(1:6, 1:6, "-")) == 1)
KPMoments(c(.3, -.2, .5, -.1, .4, -.6), W / rowSums(W))$g
#> [1]  0.1516667  0.1179167 -0.1066667