bayespecon.diagnostics.lmtests.bayesian_robust_lm_lag_sdem_test¶
- bayespecon.diagnostics.lmtests.bayesian_robust_lm_lag_sdem_test(model)[source]¶
Bayesian robust LM-Lag test in SDEM context (H₀: ρ = 0 | SDEM).
Tests whether a SDEM fit should be extended to MANSAR by adding a spatial lag, with the WX block already absorbed in the SDEM mean structure and the SDEM error parameter \(\lambda\) absorbed via a posterior-mean filter ([Doğan et al., 2021], Proposition 3; [Koley and Bera, 2024]).
For each posterior draw of \((\beta, \gamma, \lambda, \sigma^2)\) from the SDEM fit the whitened residual is
\[\mathbf{u}^{(d)} = (I - \lambda^{(d)} W) \bigl(\mathbf{y} - X\beta^{(d)} - WX\gamma^{(d)}\bigr).\]Letting \(Z = [X, WX]\), \(\tilde Z = \bar A_\lambda Z\) and \(\tilde z_\rho = \bar A_\lambda W\mathbf{y}\), the raw score and concentrated variance are
\[\begin{split}g_\rho^{(d)} &= \mathbf{u}^{(d)\,\top} \tilde z_\rho,\\ V_{\rho \cdot \beta,\gamma} &= \bar\sigma^4 \, T_{WW} + \bar\sigma^2 \, \tilde z_\rho^{\top} M_{\tilde Z}\, \tilde z_\rho.\end{split}\]Because the SDEM mean structure already contains \(WX\) (so the score for \(\gamma\) is identically zero from the SDEM normal equations) and the filter absorbs \(\lambda\) at \(\bar\lambda\), the Doǧan Neyman-orthogonal adjustment is a no-op and the statistic reduces to
\[\mathrm{LM}_R^{(d)} = \frac{(g_\rho^{(d)})^2} {V_{\rho \cdot \beta,\gamma}} \;\xrightarrow{d}\; \chi^2_1 \quad \text{under } H_0.\]