3회지역분석여름학교region.snu.ac.kr/bk/achievement/data/BK_08-10.pdf · 2008-10-10 ·...
Transcript of 3회지역분석여름학교region.snu.ac.kr/bk/achievement/data/BK_08-10.pdf · 2008-10-10 ·...
제3회지역분석여름학교
Acknowledgements
5
IntroductionSpatial Autocorrelation: RefresherSpatial Autocorrelation: RefresherModel SpecificationSpecification TestingEstimationBibliography
6
7
Model‐Drivenf i l d ti l i t tinew focus on social and spatial interaction
▪ new economic geography, endogenous regional growth, ti l t liti i hb h d ff t tspatial externalities, neighborhood effects, etc.
Data‐Drivenuse of spatial data and geo‐referenced information▪ GIS data
8
Methods to Deal with Spatial Effects in Regression Models (Spatial Regression)Regression Models (Spatial Regression)Spatial Heterogeneitystandard methods apply▪ structural change, varying coefficients
Spatial Dependencespecialized methods neededspecialized methods needed▪ two‐dimensional and multi‐directional dependence
time series results do not applytime‐series results do not apply
9
Specifying the Structure of Spatial Dependencewith locations interactwith locations interact
Testing for the Presence of Spatial Dependenceh f d dwhat type of dependence
Estimating Models with Spatial DependenceSpatial lag, spatial error
Spatial PredictionInterpolation, missing values
10
11
12
13
15
Null Hypothesis: No Spatial Autocorrelationti l dspatial randomness
values observed at a location do not depend on those observed at neighboring locations
observed spatial pattern of values is equally likely p p q y yas any other spatial pattern
the location of values may be altered withoutthe location of values may be altered without affecting the information content of the data
16
Positive Spatial Autocorrelation i il l t d t l t isimilar values tend to cluster in space
neighbors are similar
compatible with diffusion▪ but not necessarily diffusiony
Negative Spatial Autocorrelationneighbors are dissimilarneighbors are dissimilar
checkerboard pattern
17
Positive Spatial Autocorrelation Does NOT Imply DiffusionImply Diffusiondiffusion tends to yield positive spatial autocorrelation, but the reverse is not necessary
spatial randomness is not compatible with diffusion/contagion
Apparent Contagionpp gcluster is the result of spatial heterogeneity
18
Distinguishing True from Apparent Contagiont ibl i ti ith t f thnot possible in cross‐section without further
information
extra information: time domain, theory, priorsContagion is Dynamicspace‐time analysis
19
20
Formal Test of Match between Locational Similarity and Value (Attribute) SimilaritySimilarity and Value (Attribute) SimilarityLocational Similarityspatial weights matrix W
Value Similarityycross‐product: xi∙xj
21
Moran’s I Spatial Autocorrelation StatisticI (N/S ) Σ Σ / Σ 2I = (N/S0) ΣiΣj wijzizj / Σizi2
with zi = xi ‐ μ and S0 = ΣiΣj wij
Interpretation of Moran’s Ipositive spatial autocorrelation: I > E(I) = ‐1/(N‐1)pos t e spat a autoco e at o : ( ) /( )▪ spatial clustering of high and/or low values▪ no distinction between high and lowg
negative spatial autocorrelation: I < E(I) = ‐1/(N‐1)▪ checkerboard pattern competitioncheckerboard pattern, competition
22
Identify Hot Spotssignificant local clusters in the absence of globalsignificant local clusters in the absence of global autocorrelation▪ some complications in the presence of globalsome complications in the presence of global autocorrelation (extra heterogeneity)
significant local outliersg▪ high surrounded by low and vice versa
Indicate Local Instabilityylocal deviations from global pattern of spatial autocorrelation
23
24
Tobler’s First Law of Geography“everything is related to everything else but neareverything is related to everything else, but near things are more related than distant things”there is a spatial decay function: even though all p y gobservations have incidence on all other observations, after some distance threshold that influence can be
l dneglectedIn order to address spatial autocorrelation and also model spatial interactionalso model spatial interaction we need to impose a structure to constrain the number of neighbors to be considerednumber of neighbors to be considered.
25
Spatial CorrelationC ( ) E( ) E( )E( ) 0 f i hCov(yi, yh) = E(yiyh) – E(yi)E(yh) ≠ 0, for i ≠ h
Structure of Correlationwhich i, h interact?
N observations to estimate N(N‐1)/2 interactionsobse at o s to est ate ( )/ te act o s
impose structure in terms of what are the “neighbors” for each locationneighbors for each location
26
DefinitionN by N positive matrix W with elements wijN by N positive matrix W, with elements wij
Simplest Form: Binary Contiguitywij = 1 for i and j “neighbors”wij 1 for i and j neighbors(e.g. dij < critical distance)
wij = 0 otherwise, wii = 0 by conventionij , ii yRow Standardizationaveraging of neighboring valuesg g g gws
ij = wij / Σjwij such that Σjwsij = 1
spatial parameters comparablespat a pa a ete s co pa ab e
27
Contiguityb dcommon boundary
Distancedistance band
k‐nearest neighborsea est e g bo sGeneralsocial distancesocial distance
complex distance decay functions
28
29
No Direct Counterpart to Time Series Shift OperatorOperatortime series: Lk = yt‐kspatial series: which h are shifted by “k” from location i?▪ on regular lattice: east, west, north, south▪ (i ‐ 1, j) (i + 1, j) (i, j ‐ 1) (i, j + 1)j j j j
arbitrary for irregular lattice▪ different number of neighbors by observationdifferent number of neighbors by observation
30
Distributed Lagt d di d i ht Σ 1row‐standardized weights Σjwij = 1
spatial lag is weighted average of neighboring values▪ Σjwijyj, for each i
▪ vector Wy
▪ spatial lag does not contain yispatial lag is a smoother▪ not a window averageg
31
33
Spatial Lag = Distributed Lagrow standardized weights Σw = 1row‐standardized weights Σjwij = 1spatial lag is weighted average of neighboring valuesvalues▪ Σjwijyj, for each i, or as a vector Wy▪ Note: spatial lag does not contain y▪ Note: spatial lag does not contain yi
Spatial Regression Modelincorporate spatial lag in the specificationincorporate spatial lag in the specificationfor dependent variables Wy, for explanatory variables WX for errors Wεvariables WX, for errors Wε
34
Spatial Lag Model Specificationy = ρWy + Xβ + uy ρ y βwith u as i.i.d.the presence of the spatial lag Wy will induce a non‐
l ti ith th tzero correlation with the error term▪ similar to the presence of an endogenous variable, but different from a serially lagged dependent variable in the time‐series case▪ yt‐1 uncorrelated with ut, in the absence of serial correlation in the errors( ) l l d h f h l▪ (Wy)i always correlated with ui, irrespective of the correlation structure of the errorsmoreover, not only correlated with ui, but also with the error terms at all other locationsat all other locations
35
Reduced Formy = (I ‐ ρW)‐1Xβ + (I ‐ ρW)‐1uy ( ρ ) β ( ρ )E[ y | X ] = (I ‐ ρW)‐1Xβ
Expansion of Reduced Formfor wij < 1 and |ρ| < 1, (I ‐ ρW)‐1 = I + ρW + ρ2W2 + ρ3W3 + ∙∙∙▪ Leontief inverse▪ Leontief inverse
Spatial MultiplierE[ y | X ] = [I + ρW + ρ2W2 + …] Xβ[ y | ] [ ρ ρ ] β▪ function of X, WX, W2X, …▪ first, second, third … order neighbors
ll l ti i l d b t ith di t d▪ all locations involved, but with distance decay
36
Spatial Filter(I W) Xβ(I ‐ ρW)y = Xβ + u
spatially filtered dependent variable (I ‐ ρW)y, i.e., with the effect of spatial autocorrelation taken out
interpretation of the significance of the exogenous p g gvariables in the model, after the spatial effects have been corrected, or filtered out
37
Interpretation of a Significant Spatial Autoregressive Coefficient ρAutoregressive Coefficient, ρtrue contagion or substantive spatial dependence
th t t f ti l ill tti▪ measures the extent of spatial spillovers, copy‐catting or diffusion
▪ valid when the actors under consideration match the spatialvalid when the actors under consideration match the spatial unit of observation and the spillover is the result of a theoretical model
spatial filtering▪ significance of the exogenous variables in the model, after the spatial effects have been corrected, or filtered out
38
Mixed Regressive Spatial Autoregressive ModelModelWy = spatial autoregressive
X = regressivey = ρWy + Xβ + uy ρ y βρ= spatial autoregressive coefficient
39
Ignoring Wy?O itt d V i bl BiOmitted Variable Bias
OLS: Biased and Inconsistent (Biased even asymptotically)▪ wrong magnitude in coefficients
▪ probably, wrong sign too▪ wrong significance (wrong standard error)▪ wrong fit
40
41
Spatial Error Model SpecificationXβy = Xβ + ε
ε = λWε + η
implies: ε = (I ‐ λW)‐1η and y = Xβ + (I ‐ λW)‐1η
(I ‐ λW)y = (I ‐ λW)Xβ + η(I λW)y (I λW)Xβ + η▪ OLS on spatially filtered variables
42
Interpretation of a Significant Spatial Autoregressive Coefficient λAutoregressive Coefficient, λnuisance spatial dependence▪ reflects spatial autocorrelation in measurement errors or in variables that are otherwise not crucial to the model (i th “i d” i bl ill th ti l(i.e., the “ignored” variables spillover across the spatial units of observation)
43
Non‐Diagonal Error Covariance MatrixE[εε’] = Σ ≠ σ2IE[εε ] = Σ ≠ σ2I E[εi εj] ≠ 0 for i ≠ j
y = Xβ + ε, ε = λWε + ηspatial autoregressive error modelp g
44
Ignoring We?bl f ffi iproblem of efficiency
OLS remains unbiased, but inefficient:▪ correct estimate
▪ wrong confidence intervals and significance▪ wrong fit▪ even though unbiased, OLS is not BLUE
45
46
Nature of Interaction(I – ρW)‐1 all locations interact(I – ρW) 1 all locations interact▪ spatial multiplier
Model TaxonomyModel Taxonomyunmodeled effects only: spatial AR error▪ y = Xβ + (I λW)‐1u or y = Xβ + ε with ε = λWε + η▪ y = Xβ + (I – λW) 1u or y = Xβ + ε with ε = λWε + η
both unmodeled and X: spatial lagy (I ρW)‐1Xβ + (I ρW)‐1u or y ρWy + Xβ + u▪ y = (I – ρW)‐1Xβ + (I – ρW)‐1u or y = ρWy + Xβ + u
X only: spatial lag with MA error(I W) 1Xβ + W + Xβ + W▪ y = (I – ρW)‐1Xβ + u or y = ρWy + Xβ + u ‐ ρWu
47
Nature of InteractionW (spatial lag): only immediate neighbors interactW (spatial lag): only immediate neighbors interact
Model Taxonomyunmodeled effects only spatial MA errorunmodeled effects only: spatial MA error▪ y = Xβ + u + λWu
X l ti l iX only: spatial cross‐regressive▪ y = Xβ + γWXβ + u
d l d ff t d X MA ith WXunmodeled effects and X: MA error with WX▪ y = Xβ + γWXβ + u + λWu
(I + λW)(Xβ + )▪ y = (I + λW)(Xβ + u)
48
50
Null Hypothesisl i li iclassic linear regression
Alternative Hypothesisspatial lag model
spatial error modelspat a e o ode
high‐order spatial processProblemProblemmultiple misspecifications: heteroskedasticity, f i l ffunctional form
51
Under the Nulllt ti H i λ 0error alternative: H0 is λ = 0
lag alternative: H0 is ρ = 0Constrained Modely = Xβ + ε, E[εε’] = σ2Iy β ε, [εε ] σ
same for lag and error dependence
52
Under the Alternatived l H i λ 0error model: H1 is λ ≠ 0
lag model: H1 is ρ ≠ 0Unconstrained Modely = Xβ + ε, E[εε’] = σ2Ω(λ)y β ε, [εε ] σ (λ)
y = ρWy + Xβ + ε
higher order alternativeshigher order alternatives
53
Test StatisticsM ’ I f i id lMoran’s I for regression residuals
moments‐based testsPropertiesalternative hypothesis is NOT a specific spatial a te at e ypot es s s O a spec c spat aprocess model
based on detecting deviation from “zerobased on detecting deviation from zero correlation”
54
Require Complete Specification of Likelihood FunctionFunctionassumption of normality
Types of TestsLagrange Multiplier/Score testsg g p /
Wald and Likelihood Ratio tests
55
56
Test StatisticI (N / S ) ’W / ’I = (N / S0) e’We / e’e▪ with S0 = ΣiΣj wij, e = y ‐ XbOLS▪ for row‐standardized W, S0 = N, s.t. I = e’We/e’e
test with OLS residuals
formal similarity to Durbin‐Watson statistic
57
Test for Spatial Error AutocorrelationLM E t t t ti tiLM‐Error test statistic
LM‐ERR = dλ’I‐1dλ = (e’We/σ2)2 / T ~ χ2(1)Test for Spatial Lag DependenceLM‐Lag test statisticag test stat st c
LM‐Lag = dρ’I‐1dρ = [e’Wy/σ2]2/T1 ~ χ2(1)▪ T = [(WXb)’M(WXb)/σ2 + T]▪ T1 = [(WXb) M(WXb)/σ2 + T]
58
Inconclusive EvidenceLM E d LM L ft b th hi hlLM‐Err and LM‐Lag are often both highly significant▪ each has power against other form of misspecification
Robust Teststest for spatial error robust to spatial lag
test for spatial lag robust to spatial errortest for spatial lag robust to spatial error
59
Use of Robust Testsb th LM E d LM L b i ifi t b tboth LM‐Err and LM‐Lag can be significant, but typically only one of the robust tests will be▪ significant one (or most significant one) points to proper spatial alternative (error or lag)
i b h dignore robust tests when LM‐Err and LM‐Lag are not significant
60
Choice of weights importantSpatial dependence and heteroskedasticitySpatial dependence and heteroskedasticityrelatedImportance of distinguishing between lag and errorRule of thumb for LM tests worksThese are large sample testsThese are large sample tests
61
63
Spatial Lag Modeli lt it ti l l t ( ) tsimultaneity spatial lag term(s) error term
simultaneous equation bias
OLS inconsistentSpatial Error Modelpnonspherical error variance
OLS unbiased but inefficientOLS unbiased but inefficient
64
65
Likelihood Principlebt i ti t i f j i t d it fobtain estimator as maximum of joint density of
the “sample”▪ joint density function = likelihood▪ L (θ | X) = f (x1, . . . , xn, θ)▪ log likelihood = ln L (θ | X) = Σi ln f(xi, θ)
Likelihood Equationfirst order conditions for maximum▪ ∂ ln L / ∂ θ = 0/
66
MLE requires specific density functionth i t f d t i ti fthe point of departure is an assumption of normality for the error terms
L Lik lih d f MVN (0 Σ)Log‐Likelihood for ε ~ MVN (0, Σ)ln L = ‐(n/2) ln(2π) ‐ (1/2)ln|Σ| ‐ (1/2)ε’Σ‐1ε
67
68
Principley = ρWy + Xβ + ε with ε ~ N(0 σ2I)y = ρWy + Xβ + ε with ε N(0, σ2I)log likelihood based on joint normality of εfor ε y ρWy Xβ ε ~ MVN (0 σ2Ι)▪ for ε = y ‐ ρWy – Xβ, ε ~ MVN (0, σ2Ι)
▪ ln L = ‐(n/2) ln(2π) ‐ (n/2)lnσ2 + ln|I ‐ ρW| ‐ (y ‐ ρWy ‐Xβ)’(y ‐ ρWy ‐ Xβ)/(2σ2)Xβ) (y ρWy Xβ)/(2σ )
MLE for Spatial Lag Modelfrom FO C for maximizing the log likelihoodfrom F.O.C. for maximizing the log likelihood function▪ βML = (X’X)‐1X’(I – ρW)yβML ( ) ( ρ )y
69
70
Principlel lik lih d b d j i t lit flog likelihood based on joint normality of ε▪ for ε = y – Xβ, ε ~ MVN (0, σ2[(I ‐ λW)’(I ‐ λW)]‐1)
▪ ln L = ‐(n/2) ln(2π) ‐ (n/2)lnσ2 + ln|I ‐ λW| ‐ (y ‐ Xβ)’(I ‐λW)’(I ‐ λW)(y ‐ Xβ)/(2σ2)
MLE f S ti l E M d lMLE for Spatial Error Modelfrom F.O.C. for maximizing the log likelihood function▪ βML = [X’(I ‐ λW)’(I ‐ λW)X]‐1X’(I – λW)’(I – λW)y
71
72
73
74
75
76
77
78
Anselin, L. 1988. Spatial Econometrics: Methods and Models. Dordrecht, the Netherlands: Kluwer Academic Publishers.Anselin, L. 2001. Spatial econometrics. In: B. H. Baltagi (ed.). A Companion to Theoretical Econometrics. Malden, MA: Bl k llBlackwell.Anselin, L., and A. K. Bera. 1998. Spatial dependence in linear regression models with an introduction to spatialregression models with an introduction to spatial econometrics. In: A. Ullah and D. E. A. Giles (eds.). Handbook of Applied Economic Statistics. New York, NY: Marcel Dekker.
80
Anselin, L. 1992. SpaceStat Tutorial: A Workbook for Using SpaceStat in the Analysis of Spatial Data. Santa Barbara, CA: p y f pNational Center for Geographical Information and Analysis, University of California.A li L 2005 E l i S i l D i h G D AAnselin, L. 2005. Exploring Spatial Data with GeoDa: A Workbook. Santa Barbara, CA: Center for Spatially Integrated Social Science University of CaliforniaSocial Science, University of California.
81