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. 0 computes them deterministically from sparse matrix powers, which is exact and preferred unless W is too large for that.
  • rng: random source, used only when n_probes > 0.

See also ExactLU, chebyshev_logdet.

source
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.

source
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.

source
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.

source
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.

source
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.

source