bayespecon.diagnostics.bayesian_lmtests.bayesian_panel_lm_sdm_joint_test

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

Bayesian panel joint LM test for SDM (H₀: ρ = 0 AND γ = 0).

Tests the joint null hypothesis that both the spatial lag coefficient and the WX coefficients are zero, i.e., whether the OLS panel model should be extended to an SDM specification.

The null model is OLS panel. The joint score vector is:

\[\begin{split}\mathbf{g} = \begin{pmatrix} \mathbf{e}^\top W \mathbf{y} \\ (WX)^\top \mathbf{e} \end{pmatrix}\end{split}\]

a \((1 + k_{wx}) \times 1\) vector for each draw. The concentration matrix uses panel-adjusted J_{ρρ}:

\[\begin{split}J = \begin{pmatrix} J_{\rho\rho} & J_{\rho\gamma} \\ J_{\gamma\rho} & J_{\gamma\gamma} \end{pmatrix}\end{split}\]

The LM statistic is \(\chi^2_{1 + k_{wx}}\) under H₀.

Parameters:
model : SpatialPanelModel

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

Returns:

Dataclass containing LM samples, summary statistics, and metadata. The df field is set to \(1 + k_{wx}\).

Return type:

BayesianLMTestResult