Вы находитесь на странице: 1из 46

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

ERSA Summer School 2006

Spatial Analysis with GeoDa


2. Spatial Weights
Luc Anselin
University of Illinois, Urbana-Champaign
http://sal.uiuc.edu/
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Outline
Concepts
Contiguity Weights
Distance-Based Weights
Characteristics of Weights
Spatially Lagged Variables
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Concepts

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Spatial Autocorrelation
Match

value similarity
locational similarity

How to Specify Locational Similarity


Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Why Spatial Weights


Identification Problem

spatial covariance Cov[y , y ]


total number of interactions is N(N-1)/2
only N observations in a cross-section
i

Incidental Parameter Problem

number of parameters increases with


sample size, O(N2)

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Solution
Impose Structure on the Problem
set some interactions to zero
only neighbors interact directly
constrain the number of neighbors

Assume a Single Parameter

spatial autocorrelation coefficient


Copyright 2004-2006 by Luc Anselin, All Rights Reserved

5
4

6 Polygon Layout
Neighbor as Having Common Boundary
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Neighbor Structure as a Graph


6

Links
Nodes

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Spatial Weights Matrix


by N positive matrix W
Nelements
are w

w
w

ij

nonzero for i,j neighbors, wij = 0 not


ii = 0 no self-neighbors
ij

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Binary Contiguity
Weights are 0 or 1
for i, j neighbors, w = 1
Example, using common boundary
ij

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Types of Spatial Weights


Geographic Weights
contiguity
distance
general weights
graph-based weights

Socio-Economic Weights
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Contiguity Weights

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Contiguity
Common Boundary

boundary of non-zero length

What is a Non-zero Boundary


Three Views
rook
bishop
queen

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Regular Grid Contiguity


1

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Rook Contiguity
1

Neighbors for 5: 2, 4, 6, 8
Common Border
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Rook Weights

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Bishop Contiguity
1

Neighbors for 5: 1, 3, 7, 9
Common Vertex
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Bishop Weights

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Queen Contiguity
1

8 Neighbors for 5
Both Border and Vertex
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Queen Weights

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Irregular Unit Contiguity

Rook Contiguity: common border only


Queen Contiguity: border and vertices - 039 and 067
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Contiguity for Points


F

Thiessen Polygons

Contiguity Weights

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Contiguity Gotchas
Derived from GIS
Contiguity
checking boundary file for common arcs

and/or points

Grid Polygons
Regular
lack of precision can cause misalignment

artificial neighbors
Centerline
Street
different conventions can cause islands
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Misaligned Grid Cells

misaligned

properly aligned
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Street Centerline Islands

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Distance-Based Weights

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Distance Metrics
For Projected Points
planar coordinates

Euclidean Distance

as

dij = [ (xi - yi)2 + (yi - yj)2 ]1/2


the crow flies

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Distance Metrics (2)


Manhattan Block Distance
d =|x -x |+|y -y |
right angles only
ij

Minkowski Metric

general distance metric

dij = ( | xi - xj |p + | yi - yj |p )(1/p)

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Great Circle Distance


For Unprojected Points (on a sphere)
lat-lon, but note: lat is y and lon is x
distance on a sphere (spheroid)

Arc Distance

d = R. arccos[sin(y ).sin(y )
+cos(x ).cos(x ).cos(x -x )]
R = radius of earth 6378 km or 3963 mi
ij

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Distance-Based Weights
Distance Cut-Off

critical distance
w = 1 for d < , w = 0 otherwise
avoid islands max (min d )
ij

ij

ij

K-Nearest Neighbors

ij

no islands, always k neighbors


problems with ties
weights are asymmetric
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Threshold
F

Text
D

Nearest Neighbor
A

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Distance Matrix

Distance Weights
symmetric

critical distance threshold = 11.2 (radius around D)


C is an island -- no neighbors
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Distance Matrix

Distance Weights

min neighbor distance

symmetric

critical distance threshold = 14.1


max of nearest neighbor distances
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

K-Nearest Neighbors

Distance Weights

k=3

asymmetric

wij = 1 for 3 nearest neighbors


Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Characteristics of
Weights

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Connectivity
Measures of Overall Connectedness
% non-zero weights: sparseness
distribution/average number of links
average weight

Location-Specific Measures

most/least connected observations


unconnected observations = islands
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Spatial Weights
Characteristics in R

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Connectivity Histogram

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Island Connectivity

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Spatially Lagged
Variables

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Spatial Lag
Weighted Average of Neighbors

y = w .y + w .y + ... + w .y
y = w y , y = Wy
most w are zero, only non-zero count
iL

i1 1

iL

ij j

i2 2

iN N

ij

Spatial Lag is a Smoother

Wy has smaller variance than y


Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Spatial Lag Example

Average Neighbor Land Values


1/4x50200 + 1/4x45000 + 1/4x34200 + 1/4x64600
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Alexander County and its First Order Neighbors


Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Spatial Lag for SIDR74


Computed as Average of 4 Neighbors
Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Copyright 2004-2006 by Luc Anselin, All Rights Reserved

Вам также может понравиться