Model Selection
Information criteria and tests for choosing between specifications.
SpatialEconometrics.SpatialModelSelection.CommonFactorTestResult — Type
CommonFactorTestResultTest of the common-factor restriction, returned by common_factor_test.
Fields: stat, df, p_value, reject.
A Spatial Durbin model reduces to a spatial error model exactly when theta = -rho * beta. Failing to reject means the simpler error specification is adequate; rejecting means the Durbin terms carry information the error model cannot represent.
See also SDM, fit_spatial_error.
SpatialEconometrics.SpatialModelSelection.LRTestResult — Type
LRTestResultLikelihood-ratio test between nested models, returned by lr_test.
Fields: stat, df, p_value, and both log-likelihoods (ll_restricted, ll_unrestricted).
Valid only when one model genuinely nests the other and both were fitted to the same data by maximum likelihood. For non-nested comparisons use vuong_test.
SpatialEconometrics.SpatialModelSelection.VuongTestResult — Type
VuongTestResultVuong test between two non-nested models, returned by vuong_test.
Fields: stat, p_value, aic_correction, and preference, which is :model1, :model2 or :indistinguishable.
Use this where lr_test does not apply — comparing a spatial lag against a spatial error specification, for instance, since neither nests the other. :indistinguishable is a genuine outcome, not a failure: the data may simply not separate the two.
SpatialEconometrics.SpatialModelSelection.WaldTestResult — Type
WaldTestResultWald test of a linear restriction R*beta = r, returned by wald_test.
Fields: stat, df, p_value. Needs only the fitted model's coefficients and covariance, so unlike lr_test it does not require refitting under the restriction.
SpatialEconometrics.SpatialModelSelection.common_factor_test — Function
common_factor_test(coef_beta, coef_theta, rho, vcov_full)Tests whether SDM simplifies to SEM, i.e. H₀: θ + ρβ = 0.
coef_beta: vector of K slope coefficients (excluding intercept)coef_theta: vector of K spatial lag coefficients (WX terms)rho: spatial autoregressive parametervcov_full: full variance-covariance matrix of [β; θ; ρ]
Uses the Wald test formulation from Burridge (1981).
SpatialEconometrics.SpatialModelSelection.lr_test — Function
lr_test(m_restricted, m_unrestricted)Likelihood ratio test for nested models. The unrestricted model must have more parameters than the restricted model.
SpatialEconometrics.SpatialModelSelection.model_comparison_table — Function
model_comparison_table(models...; names=nothing)Print a formatted comparison table of spatial models.
SpatialEconometrics.SpatialModelSelection.spatial_aic — Function
spatial_aic(m)Akaike Information Criterion: AIC = -2 ln L + 2k where k is the number of estimated parameters.
SpatialEconometrics.SpatialModelSelection.spatial_bic — Function
spatial_bic(m)Bayesian Information Criterion: BIC = -2 ln L + k ln(n)
SpatialEconometrics.SpatialModelSelection.vuong_test — Function
vuong_test(m1, m2)Vuong (1989) test for non-nested model comparison. Uses AIC-corrected version. Positive statistic favors model 1.
SpatialEconometrics.SpatialModelSelection.wald_test — Function
wald_test(m, R, r)General Wald test: H₀: Rβ = r.
R: Q×K restriction matrixr: Q-vector of restriction values