bayespecon.diagnostics.bayesian_lmtests.bayesian_panel_lm_wx_sem_test

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

Bayesian panel LM test for WX coefficients in SEM (H₀: γ = 0 | SEM).

Tests whether spatially lagged covariates (WX) should be added to a panel SEM model, i.e., whether the SEM panel model should be extended to an SDEM panel. Follows the multi-parameter Bayesian LM test framework of Dogan et al. (2021).

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

\[\mathbf{e} = \mathbf{y} - X \beta\]

The score vector for the WX coefficients is:

\[\mathbf{g}_\gamma = (WX)^\top \mathbf{e}\]

The concentration matrix is the information matrix evaluated at the posterior mean:

\[J_{\gamma\gamma} = \frac{1}{\bar{\sigma}^2} (WX)^\top (WX)\]
Parameters:
model : SEMPanelFE or SEMPanelRE

Fitted SEM panel model instance with inference_data attribute containing posterior draws for beta, lambda, and sigma.

Returns:

Dataclass containing LM samples, summary statistics, and metadata. The df field is set to \(k_{wx}\) (number of WX columns).

Return type:

BayesianLMTestResult