bayespecon.diagnostics.lmtests.bayesian_panel_lm_lag_sdem_test

bayespecon.diagnostics.lmtests.bayesian_panel_lm_lag_sdem_test(model)[source]

Panel LM-Lag test from an SDEM panel posterior (H₀: ρ = 0 | SDEM).

Panel analogue of bayesian_lm_lag_sdem_test(). Residuals are the spatially-filtered SDEM panel residuals (with RE alpha removed if present):

\[\mathbf{u} = \mathbf{y} - X\beta - WX\gamma - (\iota_T\otimes\alpha), \qquad \boldsymbol{\varepsilon} = \mathbf{u} - \lambda\,(I_T\otimes W)\mathbf{u}.\]

The score and variance follow the SDEM-filtered LM-Lag derivation: using the whitened lag vector \(\tilde z_\rho = \bar A_\lambda (I_T\otimes W)\mathbf{y}\) with \(\bar A_\lambda = I - \bar\lambda (I_T\otimes W)\) and the whitened design \(\tilde Z = \bar A_\lambda [X, WX]\),

\[S = \boldsymbol{\varepsilon}^\top \tilde z_\rho, \qquad V = \bar{\sigma}^4 \, T \, T_{WW} + \bar{\sigma}^2 \, \tilde z_\rho^{\top} M_{\tilde Z}\, \tilde z_\rho.\]

Note

Earlier revisions used an unwhitened \(S = \boldsymbol{ \varepsilon}^\top (I_T\otimes W)\mathbf{y}\) paired with \(V = \bar\sigma^4 T \, T_{WW} + \bar\sigma^2 \|(I_T\otimes W) \mathbf{y}\|^2\), which produced empirical size near 1 on SDEM-DGP because both the numerator and the denominator omitted the \(\bar A_\lambda\) whitening factor.

The LM statistic is \(\chi^2_1\) under H₀. Tests whether an SDEM panel should be extended to a SDARAR panel (SDEM with a spatial lag); this is the panel analogue of the SDEM-aware diagnostic discussed in Koley and Bera [2024]. Panel-data extensions follow Anselin et al. [2008] and Elhorst [2014]. The Bayesian LM statistic is computed per posterior draw following Doğan et al. [2021].