Spatial Regression 6. Specification Spatial Heterogeneity Luc Anselin http://spatial.uchicago.edu 1
homogeneity and heterogeneity spatial regimes spatially varying coefficients spatial random effects 2
Homogeneity and Heterogeneity 3
Global Perspective single equilibrium - stationarity functional form fixed coefficients fixed 4
Local Perspective multiple equilibria non-stationarity functional and/or parameter variability 5
Extreme Homogeneity model same everywhere parameters same everywhere yi = xiβ + εi β constant across i εi i.i.d. with Var[εi] = σ 2 for all i 6
Extreme Heterogeneity every observation is different yi = xiβi + εi a different parameters βi for each observation i εi i.n.i.d. with Var[εi] = σi 2 possible different functional forms for i 7
Incidental Parameter Problem number of unknown parameters increases with sample size no consistent estimation of individual parameters βi, σi 2 8
Solutions imposing structure discrete variation - finite subsets of the data continuous variation - parameter surface heterogeneity parameters fixed effects random effects spatial heterogeneity may be complicated by spatial autocorrelation 9
Spatial Regimes 10
Discrete Heterogeneity 11
Spatial Regimes systematic discrete spatial subsets of the data different coefficient values in each subset corrects for heterogeneity, but does not explain 12
Spatial Regime Specifications varying intercepts spatial ANOVA spatial fixed effects full spatial regimes 13
Varying Intercepts 14
ANOVA - Difference in Means approach is standard, regimes are spatial E[y1] = μ1 i R1 (R1 is region 1) E[y2] = μ2 i R2 (R2 is region 2) H0: μ1 = μ2 15
Dummy Variable Regression - Variant 1 no constant term indicator variable for each regime yi = β1d1i + β2d2i + εi d1(2)i = 1 i R1(2), 0 elsewhere H0: β1 = β2 16
Dummy Variable Regression - Variant 2 constant term for overall mean yi = α + βdi + εi di = 1 i R1, 0 elsewhere H0: β = 0, difference from reference mean α 17
Spatial Fixed Effects reference mean and difference by regime fixed effects multi-level specification 18
Spatial Fixed Effects and Spatial Autocorrelation (Anselin and Arribas-Bel 2013) common misconception that spatial fixed effects fix spatial autocorrelation only in special case of group weights each observation has all other observations as neighbors so-called Case weights (Case 1992) 19
Full Spatial Regimes 20
Spatial Regimes - Full Specification all coefficients (intercept, slope, variance) vary by regime equivalent to separate regression by regime Copyright 2013 by Luc Anselin, All Rights Reserved 21
Testing for Spatial Heterogeneity 22
Test on Spatial Homogeneity null hypothesis equal intercepts, equal slopes alternative hypothesis different intercepts different slopes both 23
Chow Test test on structural stability based on residual sum of squares in constrained (all coefficients equal - R) and unconstrained (coefficients different - U) regressions classic form C = e R e R e U e U k / e U e U N 2k F (k, N 2k) 24
General Test on Coefficient Stability as a set of linear constraints on the coefficients in a pooled regression can be readily extended to spatial models G = (J - 1)K V = variance J regimes K coefficients 25
Spatial Regimes with Spatial Dependence 26
Spatial Lag and Spatial Error Models allow varying coefficients by regime fixed spatial coefficient same spatial process throughout varying spatial coefficient different spatial process for each regime difficult assumption - needs to be based on a strong foundation 27
Spatial Regimes - Spatial Lag Model fixed spatial autoregressive coefficient varying spatial autoregressive coefficient Copyright 2013 by Luc Anselin, All Rights Reserved 28
Spatial Regimes - Spatial Error Model fixed spatial autoregressive coefficient varying spatial autoregressive coefficient Copyright 2013 by Luc Anselin, All Rights Reserved 29
Spatial Weights Specification necessary to construct spatially lagged variables neighbors spill over across regimes neighbors constrained to be within each regime weights truncated, possible isolates 30
Spatial Chow Test use general form of the test with V as coefficient variance matrix in pooled model 31
Spatially Varying Coefficients 32
Spatially Varying Coefficients systematic variation with covariates coefficient as a function of other variables (including as a trend surface) spatial expansion method local estimation over space coefficients obtained from a subset (kernel) of nearby data points geographically weighted regression (GWR) 33
Expansion Method 34
Casetti s Expansion Method special case of varying coefficients each coefficient is a function of other covariates creates interaction effects similar in form to multi-level models 35
Sequential Modeling Strategy initial model yi = α + xiβi + εi expansion equation βi = γ0 + zi1γ1 + zi2γ2 final model yi = α + xi (γ0 + zi1γ1 + zi2γ2) + εi yi = α + xiγ0 + (zi1xi)γ1 + (zi2xi)γ2 + εi 36
Implementation Issues multicollinearity t-test values unreliable various fixes principal components (orthogonal expansion) danger of overfitting 37
Random Expansion Model random error in expansion equation βi = γ0 + zi1γ1 + zi2γ2 + ψi error term in final model is heteroskedastic yi = α + xi (γ0 + zi1γ1 + zi2γ2 + ψi) + εi νi = xiψi + εi Var[νi] = xi 2 σ 2 ψ + σ 2 ε similar to random coefficient model and multilevel models 38
Geographically Weighted Regression 39
Geographically Weighted Regression local regression a different set of parameter values for each location parameter values obtained from a subset of observations using kernel regression 40
Local Regression non-parametric specification simple bivariate regression yi = m(xi) + ui functional form of m is unspecified m(xi) yields the conditional expectation of y x 41
Local Average what is the expected value of yi given x, E[yi x] special case: for a given x 0 with multiple yi example: two values for PATIO dummy, house price solution: take m(x0) as the average of yi for x0 =0 and x0 =1 42
local average predictor of PRICE for two values of PATIO 43
Locally Weighted Average expand the estimate of m(x 0) to include values of yi observed for values of x close to x0 compute a locally weighted average weights sum to one weights larger as x closer to x0 (for h ) m(x0) = i wi0,h yi 44
locally weighted average (lowess) of PRICE for LOTSZ 45
Kernel Regression special case of locally weighted average use kernel function as the weights m(x0) = i K [(xi - x0)/h ]yi K is kernel function h is bandwidth s.t. K = 0 for x i - x0 > h 46
Kernel Functions with Finite Bandwidth Epanechnikov K(z) = 1 - z 2 Bisquare K(z) = (1 - z 2 ) 2 with z = (x i - x0) / h 47
Gaussian Kernel asymptotic bandwidth specified in function of standard error or variance K(z) = exp(- z 2 /2) 48
GWR Estimation local estimation based on nearby locations not just yi but x-y pairs at nearby locations kernel regression yields a different coefficient for each location specify kernel function and bandwidth 49
GWR Kernel Regression location-specific kernel weights W(ui, vi) diagonal elements are weights b(u i,vi) = [X W(ui,vi)X] -1 X W(ui,vi)y fixed kernel vs adaptive kernel 50
fixed bandwidth kernel adaptive kernel Source: Fotheringham et al (2002) 51
GWR - Practical Issues choice of bandwidth use cross-validation parameter inference still several theoretical loose ends visualizing parameter heterogeneity 52
Spatial Random Effects 53
Random Coefficients 54
Random Coefficient Regression extreme heterogeneity, but variability in βi driven by a random process - no space βi = β + ψi with E[ψi]=0 and Var[ψi]=σ 2 heteroskedastic regression for mean effect yi = α + xiβ + νi, var[νi] =σ 2 ψxi 2 + σ 2 ε 55
Mixed Linear Models both fixed and random coefficients y = Xβ + Zψ + ε Z a design matrix, could be same as X ψ random coefficients with mean zero and variance Σ ψ ε random error vector with variance Σ ε 56
Spatial Random Coefficients introduce spatial dependence structure in random variation of coefficient βi - β = ρ Σj wij (βj - β) + ψi - SAR model βi = β + λ Σj wij ψj + ψi - SMA model complex covariance structures 57
Spatial Random Effects 58
Spatial Random Effects βi = β + ψi with spatial effects introduced through random effect ψi typically a CAR process Bayesian hierarchical model - BYM model βi = β + ψi + νi spatial dependence in ψi, heterogeneity in νi not identified in Gaussian (linear regression) model 59
Example - Poisson Regression spatial autocorrelation needs to be introduced indirectly auto-poisson model only allows negative spatial autocorrelation random effects model 60
Poisson Regression P[Y = y] = e- μ μ y / y! μ is the mean μ as a function of regressors to model heterogeneity μi = exp(xi β) no error term random effects μi = exp(xi β + ψi + νi) spatial effects through ψi, e.g, CAR model non-spatial heterogeneity through νi 61