bayespecon.diagnostics.lmtests.bayesian_robust_lm_error_test

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

Bayesian robust LM-Error test (H₀: λ = 0, robust to local ρ).

Cross-sectional analogue of bayesian_panel_robust_lm_error_test(). Tests whether the spatial-error coefficient is zero, robust to the local presence of a spatial lag. The null model is OLS.

For each posterior draw,

\[\mathrm{LM}_R = \frac{\bigl(g_\lambda/\sigma^2 - (T_{WW}/J^*_{\rho\rho})\,g_\rho/\sigma^2\bigr)^2} {T_{WW}\bigl(1 - T_{WW}/J^*_{\rho\rho}\bigr)}\]

where \(J^*_{\rho\rho} = J_{\rho\rho}/\sigma^2\) and the remaining quantities are as in bayesian_robust_lm_lag_test(). Distributed as \(\chi^2_1\) under H₀ following the Anselin–Bera–Florax–Yoon locally-robust construction ([Anselin et al., 1996], [Bera and Yoon, 1993]). The Bayesian LM statistic is computed per posterior draw following Doğan et al. [2021].

Parameters:
model : SpatialModel

Fitted OLS-style model with inference_data containing posterior draws for beta and sigma.

Returns:

Dataclass containing LM samples, summary statistics, and metadata.

Return type:

BayesianLMTestResult