neighbayes.diagnostics.lmtests.bayesian_glm_lm_error_test¶
- neighbayes.diagnostics.lmtests.bayesian_glm_lm_error_test(model)[source]¶
Bayesian LM test for omitted spatial error in a GLM (logit / NB).
PG-augmented analog of
bayesian_lm_error_test(). Conditional on the working weights \(\omega\), the augmented model is a weighted Gaussian regression of \(\tilde z = \kappa/\omega\) on \(X\) with covariance \(\Omega^{-1}\) (Polson, Scott & Windle 2013). The SEM-null LM score is\[S^{(d)} = \tilde e^{(d)\top}\, \Omega^{(d)}\, W\, \tilde e^{(d)}, \qquad \tilde e^{(d)} = \tilde z^{(d)} - X\beta^{(d)},\]and its variance under \(H_0\) is
\[V = \mathrm{tr}(W^2) + \sum_{i,j} \bar\omega_i/\bar\omega_j\, W_{ij}^2,\]evaluated at the posterior-mean weights \(\bar\omega\). This reduces to the Anselin (1996) \(\sigma^4 T_{WW}\) formula when \(\Omega = \sigma^{-2} I\).