bayespecon.diagnostics.bayesian_lmtests.bayesian_robust_lm_lag_sdm_test

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

Bayesian robust LM-Lag test in SDM context (H₀: ρ = 0, robust to γ).

Tests the null hypothesis that the spatial lag 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, which is the Bayesian analogue of the robust LM-Lag-SDM test in Koley and Bera [2024].

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

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

The unadjusted scores are:

\[\begin{split}g_\rho &= \mathbf{e}^\top W \mathbf{y} \\ \boldsymbol{g}_\gamma &= (WX)^\top \mathbf{e}\end{split}\]

The Neyman-adjusted score for ρ is:

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

The adjusted variance is:

\[V^* = J_{\rho\rho \cdot \sigma} - J_{\rho\gamma \cdot \sigma} J_{\gamma\gamma \cdot \sigma}^{-1} J_{\gamma\rho \cdot \sigma}\]

The robust LM statistic for each draw is:

\[\mathrm{LM}_R = \frac{(g_\rho^*)^2}{V^*}\]

which is distributed as \(\chi^2_1\) under H₀, irrespective of local misspecification in γ ([Doğan et al., 2021], Proposition 3).

Parameters:
model : SLX

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

Returns:

Dataclass containing LM samples, summary statistics, and metadata. The df field is set to 1.

Return type:

BayesianLMTestResult