bayespecon.diagnostics.lmtests.bayesian_robust_lm_wx_test¶
- bayespecon.diagnostics.lmtests.bayesian_robust_lm_wx_test(model)[source]¶
Bayesian robust LM-WX test (H₀: γ = 0, robust to ρ).
Bayesian extension of the robust LM-WX test ([Koley and Bera, 2024],
rlm_wx) using the Doğan, Taşpınar & Bera (2021) Neyman-orthogonal score adjustment ([Doğan et al., 2021], Proposition 3).The alternative model is SAR (includes \(\rho\) but not \(\gamma\)). For each posterior draw of \((\beta, \rho, \sigma^2)\) from the SAR fit, residuals are \(\mathbf{e} = \mathbf{y} - \rho W\mathbf{y} - X\beta\) and the raw scores are
\[g_\rho = \mathbf{e}^\top W \mathbf{y}, \qquad \mathbf{g}_\gamma = (WX)^\top \mathbf{e}.\]The Neyman-orthogonal adjusted score for \(\gamma\) is
\[\mathbf{g}_\gamma^* = \mathbf{g}_\gamma - \frac{V_{\gamma\rho}}{V_{\rho\rho}}\, g_\rho ,\]with raw-score variance blocks supplied by
_info_matrix_blocks_sdm(). By the standard Schur-complement identity ([Anselin et al., 1996], Appendix), the variance of \(\mathbf{g}_\gamma^*\) under \(H_0\) is\[V_{\gamma \cdot \rho} = V_{\gamma\gamma} - \frac{V_{\gamma\rho} V_{\rho\gamma}^\top}{V_{\rho\rho}}.\]The robust LM statistic is therefore
\[\mathrm{LM}_R^{(d)} = \mathbf{g}_\gamma^{*\,(d)\,\top} V_{\gamma \cdot \rho}^{-1}\, \mathbf{g}_\gamma^{*\,(d)} \;\xrightarrow{d}\; \chi^2_{k_{wx}} \quad \text{under } H_0,\]independent of local misspecification in \(\rho\).