bayespecon.diagnostics.lmtests.bayesian_panel_lm_wx_sem_test¶
- bayespecon.diagnostics.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 Doğan et al. [2021]. The classical WX-in-SEM construction is discussed in Koley and Bera [2024]; panel-data extensions are covered in Elhorst [2014] and Anselin et al. [2008].
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_dataattribute containing posterior draws forbeta,lambda, andsigma.
- Returns:¶
Dataclass containing LM samples, summary statistics, and metadata. The
dffield is set to \(k_{wx}\) (number of WX columns).- Return type:¶