bayespecon.diagnostics.bayesian_lmtests.bayesian_panel_robust_lm_error_sdem_test

bayespecon.diagnostics.bayesian_lmtests.bayesian_panel_robust_lm_error_sdem_test(model)[source]

Bayesian panel robust LM-Error test in SDEM context (H₀: λ = 0, robust to γ).

Tests the null hypothesis that the spatial error coefficient is zero, robust to the local presence of WX effects (γ). Uses the Neyman orthogonal score adjustment from Doğan et al. [2021], Proposition 3.

The alternative model is SLX panel (includes γ but not λ). For each posterior draw from the SLX model, residuals are:

\[\mathbf{e} = \mathbf{y} - X\beta_1 - WX\beta_2\]

The Neyman-adjusted score for λ is:

\[g_\lambda^* = g_\lambda - J_{\lambda\gamma \cdot \sigma} J_{\gamma\gamma \cdot \sigma}^{-1} \boldsymbol{g}_\gamma\]

Under H₀, \(J_{\lambda\gamma \cdot \sigma} = 0\) (odd moments vanish for normal errors), so the adjustment is a no-op and the robust test equals the non-robust test.

The robust LM statistic is \(\chi^2_1\) under H₀.

Parameters:
model : SLXPanelFE or SLX-like panel model

Fitted SLX panel model with inference_data containing posterior draws for beta and sigma.

Returns:

Dataclass containing LM samples, summary statistics, and metadata.

Return type:

BayesianLMTestResult