bayespecon.diagnostics.lmtests.bayesian_robust_lm_error_sdm_test

bayespecon.diagnostics.lmtests.bayesian_robust_lm_error_sdm_test(model)[source]

Bayesian robust LM-Error test in SDM context (H₀: λ = 0 | SDM).

Tests whether a SDM fit should be extended to MANSAR by adding a spatial-error process, robust to the SDM lag parameter \(\rho\). The WX coefficients \(\gamma\) are already in the SDM mean structure and are absorbed via the \(M_Z\)-projection with \(Z = [X, WX]\); the only nuisance to Schur against is \(\rho\) ([Doğan et al., 2021], Proposition 3; [Anselin et al., 1996]; [Koley and Bera, 2024]).

For each posterior draw of \((\beta, \gamma, \rho, \sigma^2)\) from the SDM fit the residual is \(\mathbf{e}^{(d)} = \mathbf{y} - \rho^{(d)} W\mathbf{y} - X\beta^{(d)} - WX\gamma^{(d)}\). Raw scores \(g_\lambda = \mathbf{e}^\top W \mathbf{e}\) and \(g_\rho = \mathbf{e}^\top W \mathbf{y}\) are evaluated per draw, and the variance blocks \((V_{\lambda\lambda}, V_{\lambda\rho}, V_{\rho\rho})\) use the SAR-null Magnus identities of _sar_null_lambda_info() with \(X_{\text{design}} = Z\). The Neyman-orthogonal adjustment and Schur complement are identical to bayesian_robust_lm_error_sar_test(); only the projector differs. The statistic is \(\chi^2_1\) under \(H_0\).

Parameters:
model : SDM

Fitted SDM model with inference_data containing posterior draws for beta (covering [X, WX]), rho, sigma.

Returns:

Per-draw LM samples, summary statistics and df = 1.

Return type:

BayesianLMTestResult