Variants & Specification Tags
Shared tag types. Every estimator takes the same SAR(), TwoWayFE() or ChebyshevApprox(), so no call needs a module qualifier.
SpatialEconometrics.SpatialUtils.ChebyshevApprox — Type
ChebyshevApprox(; order = 6, n_probes = 0, rng = Random.default_rng())Approximate log|I - ρW| by a Chebyshev expansion in ρ.
The traces the expansion needs depend only on W, so they are computed once by precompute_chebyshev_traces and every later evaluation is a polynomial in ρ — which is what makes repeated likelihood evaluation affordable.
Arguments
order: degree of the expansion, at least 2. Accuracy improves with order; 6 is adequate for point estimation and 12 is accurate to several decimal places acrossρ ∈ (-1, 1), degrading mildly as|ρ| → 1.n_probes: number of Hutchinson random probes used to estimate the traces.0computes them deterministically from sparse matrix powers, which is exact and preferred unlessWis too large for that.rng: random source, used only whenn_probes > 0.
See also ExactLU, chebyshev_logdet.
SpatialEconometrics.SpatialUtils.ExactLU — Type
ExactLU()Evaluate log|I - ρW| exactly, by sparse LU factorization at each trial ρ.
Accurate to machine precision and the right default for moderate N. Cost grows with the fill-in of the factorization, so for large or densely connected W — and for samplers that need thousands of evaluations — ChebyshevApprox is usually the better trade.
See also LogDetMethod.
SpatialEconometrics.SpatialUtils.FixedEffectsSpec — Type
FixedEffectsSpecWhich fixed effects a panel estimator sweeps out before estimating.
The transform is applied by within_transform, and the degrees of freedom it consumes are reported by effective_dims. Subtypes: NoFE, IndivFE, TimeFE, TwoWayFE.
SpatialEconometrics.SpatialUtils.IndivFE — Type
IndivFE()Individual (unit) fixed effects, removed by subtracting unit means.
Absorbs any time-invariant unit characteristic, at the cost of not identifying time-invariant regressors. Costs T - 1 effective periods.
See also FixedEffectsSpec, TwoWayFE.
SpatialEconometrics.SpatialUtils.LogDetMethod — Type
LogDetMethodHow log|I - ρW| is evaluated inside a spatial likelihood.
Every concentrated-likelihood estimator in this package needs that log-determinant at each trial value of the spatial parameter, so the choice is the main speed/accuracy lever available. Subtypes: ExactLU and ChebyshevApprox.
SpatialEconometrics.SpatialUtils.NoFE — Type
NoFE()Pooled estimation: no fixed effects removed.
Consistent only if the unobserved heterogeneity is uncorrelated with the regressors. spatial_hausman_test is the usual check.
See also FixedEffectsSpec.
SpatialEconometrics.SpatialUtils.SAR — Type
SAR()Spatial autoregressive model — dependence in the dependent variable.
\[y = ρWy + Xβ + ε\]
Because y appears on both sides, a change in one unit's x propagates through (I - ρW)^{-1} to every other unit, so coefficients are not marginal effects; use spatial_effects to decompose them into direct, indirect and total.
See also SDM, SpatialVariant.
SpatialEconometrics.SpatialUtils.SARAR — Type
SARAR()Spatial dependence in both the dependent variable and the errors.
\[y = ρWy + Xβ + u, u = λWu + ε\]
Used by fit_gs2sls_panel, which estimates it by generalized spatial two-stage least squares rather than maximum likelihood, so endogenous regressors can be instrumented at the same time.
See also SpatialVariant.
SpatialEconometrics.SpatialUtils.SDM — Type
SDM()Spatial Durbin model — dependence in y and in the covariates.
\[y = ρWy + Xβ + WXθ + ε\]
The design is augmented with the spatial lags of X, so the fitted coefficient vector carries W_-prefixed entries for the θ terms. It nests SAR at θ = 0, which common_factor_test tests.
See also SpatialVariant.
SpatialEconometrics.SpatialUtils.SpatialVariant — Type
SpatialVariantWhich spatial structure a model places on the data.
One tag type shared by every estimation module, so the same SAR() can be passed to fit_spatial, fit_spatial_panel and fit_dynamic_spatial_panel. Subtypes: SAR, SDM, SARAR.
SpatialEconometrics.SpatialUtils.TimeFE — Type
TimeFE()Time fixed effects, removed by subtracting period means.
Absorbs common shocks hitting every unit in a period. Costs N - 1 effective units.
See also FixedEffectsSpec.
SpatialEconometrics.SpatialUtils.TwoWayFE — Type
TwoWayFE()Both individual and time fixed effects.
The usual specification for spatial panels, since it absorbs unit heterogeneity and common time shocks together — the latter matters because a common shock can otherwise masquerade as spatial dependence. Costs N - 1 units and T - 1 periods.
See also FixedEffectsSpec, IndivFE.