Dynamic Spatial Panels
Panels carrying both a time lag and a spatial lag, with bias correction.
SpatialEconometrics.DynamicSpatialPanelEconometrics.DynamicSpatialEffectsResult — Type
DynamicSpatialEffectsResultShort-run and long-run direct, indirect and total effects for a dynamic spatial panel, returned by dynamic_spatial_effects.
The short-run effects are the impact within the period of the shock; the long-run effects cumulate the time dynamics to the new steady state and are larger whenever the autoregressive coefficient is positive.
SpatialEconometrics.DynamicSpatialPanelEconometrics.DynamicSpatialPanelModel — Type
DynamicSpatialPanelModelA fitted dynamic spatial panel, returned by fit_dynamic_spatial_panel. Implements the StatsAPI.RegressionModel interface.
The specification carries three dependence parameters, all reported separately:
| Field | Term | Meaning |
|---|---|---|
gamma | y_{t-1} | pure time lag |
eta | W*y_{t-1} | space-time lag: last period's neighbours |
rho | W*y_t | contemporaneous spatial lag |
Other fields
coef,vcov,coefnames,sigma2,loglik,residuals: as usual.coefnamesruns"y_lag","Wy_lag", the covariates, theW_-prefixed terms for anSDM, then"ρ".coef_uncorrected,sigma2_uncorrected: the estimates before the bias correction, so you can see what it moved.spectral_radius_A: stability diagnostic for the implied system. The long-run effects only exist if this is below 1.W,Z_tilde,y_tilde,trace_powers: the weight matrix, the transformed design and response, and traces reused bydynamic_spatial_effects.N,T_total,T_post: one period is consumed in forming the lag, so estimation usesT_post = T_total - 1.
Because dependence runs over both space and time, short-run and long-run effects differ — see dynamic_spatial_effects.
SpatialEconometrics.DynamicSpatialPanelEconometrics.dynamic_spatial_effects — Function
dynamic_spatial_effects(model; max_power = 50, vcov_mat = model.vcov)
dynamic_spatial_effects(model, spec::AbstractRobustVCOV; max_power = 50)Short-run and long-run marginal effects for a dynamic spatial panel.
The short-run effects are the within-period response through (I - rho*W)^{-1}, so the total is (beta + theta) / (1 - rho).
The long-run effects cumulate the time dynamics to the steady state, which brings in both lag parameters: the total becomes
\[(beta + theta) / (1 - gamma - rho - eta)\]
and the direct effect is evaluated at the long-run spatial parameter (rho + eta) / (1 - gamma), scaled by 1 / (1 - gamma). Each of the six quantities comes with a delta-method standard error.
Returns
A DynamicSpatialEffectsResult, whose fields are prefixed sr_ for short-run and lr_ for long-run.
SpatialEconometrics.DynamicSpatialPanelEconometrics.fit_dynamic_spatial_panel — Function
fit_dynamic_spatial_panel(variant, fe_spec, W, X, y, N, T_total; method,
varnames, rho_bounds, n_bias_probes, rng)Fit a dynamic spatial panel — one carrying both a time lag and a spatial lag of the dependent variable — by bias-corrected quasi-maximum likelihood.
With fixed effects and a lagged dependent variable the QML estimator suffers the Nickell bias, of order 1/T. The Yu, de Jong and Lee analytical correction is applied, using stochastic probes to estimate the traces the correction needs.
Arguments
variant:SARorSDM.fe_spec: aFixedEffectsSpec;IndivFEorTwoWayFEare the meaningful choices here.W:N x Ncross-sectional weight matrix.X,y: stacked over allT_totalperiods, units varying fastest.N,T_total: units and periods including the one consumed by the lag; estimation usesT_total - 1.
Keywords
n_bias_probes,rng: probes used by the bias correction, and the random source for them. Results vary slightly withrng; pass a seeded one for reproducibility.method,varnames,rho_bounds: as forfit_spatial_panel.
Returns
Same stacking requirement as fit_spatial_panel: units vary fastest within each period. The bias correction also assumes T is small relative to N; with long panels the correction matters less and the uncorrected estimates are already close.
Examples
m = fit_dynamic_spatial_panel(SAR(), IndivFE(), W, X, y, N, T_total;
rng = MersenneTwister(1))
dynamic_spatial_effects(m)References
Yu, J., de Jong, R. & Lee, L.-F. (2008). Journal of Econometrics, 146(1).