spatial and regional economic analysis mini-course
TRANSCRIPT
Vicente Rios
Spatial and Regional Economic Analysis
Mini-Course:
Author: Vicente Rios
Vicente Rios
Practice: Spatial Weight Matrices for European
Regions
Testing Spatial Autocorrelation
Global Spatial Autocorrelation
Local Spatial Autocorrelation
Practice: Unemployment Rate Spatial
Autocorrelation Analysis
Lecture 2: Introduction Spatial Analysis
2
Vicente Rios
We are going to put in practice some of previous ideas/concepts by
developing W matrices to describe connectivity among European
NUTS-2 regions
NUTS-2 regions (Nomenclature of Territorial Units for Statistics)
NUTS2 is the territorial unit most commonly used in the literature
on regional analysis in the EU
NUTS2 regions are the basic unit for the application of cohesion
policies in the EU
(http://ec.europa.eu/regional_policy/sources/docoffic/official/repo
rts/cohesion7/7cr.pdf)
Spanish Autonomous Communities, French regions, etc..
NUTS-x refers to a level of data aggregation (3 is provinces, 0 are
countries, 1(is intermediate between country aggrregation and
regional aggregation))
Practice (W matrices)
3
Vicente Rios
Practice (W matrices)
4
Vicente Rios
In Italy there are 20 NUTS-2 regions
NUTS-2 regions
5
Vicente Rios
In Germany this is the current NUTS-2 regional division:
NUTS-2 regions
6
Vicente Rios
Switch to Matlab โTutorial1_W_Matrices.mโ
7
Vicente Rios
Goals
In a first place, we are going to use latitude and longitude
coordinates of each NUTS2 region to obtain a matrix of
distances ๐ซ๐๐ in kilometers for all European regions.
Second, we will use this distance matrix ๐ซ๐๐ to derive different
spatial weight matrices W using some of the spatial functional
forms we have seen before.
In particular we will derive (i) the gravity W matrix, (ii) the 5 and
25 nearest neighbors and (iii) an exponential matrix with cut-offs
at the first quartile of the distribution of distances.
Practice (W matrices)
8
Vicente Rios
Software: Matlab
We are going to use some already built in functions in this exercise:
1) distance.mโ calculates distances (in degrees) between points in a sphere
2) deg2km.m โ converts degrees into kilometers
3) normw.mโ row-normalizes the matrices
4) make_nnw.mโ finds โkโ nearest neighbors and builts W based on the specified k
5) spy.mโ plots the sparsity pattern of a matrix
6) vec.mโ vectorizes a matrix
7) quantile.mโ finds quantiles of the distribution of the supplied variable
8) gplot.mโ creates a network representation of a matrix
Practice (W matrices)
9
Vicente Rios
Practice (W matrices)
10
Code
Vicente Rios
(code continued)
Practice part 1
11
Vicente Rios
(code continued)
Practice (W matrices)
12
Vicente Rios
(code continued)
Practice (W matrices)
13
Vicente Rios
(code continued)
Practice Day 1
14
Vicente Rios
An interesting thing to do is to visualize how sparse or how dense is
our matrix.
In applied analysis matrix sparsity greatly accelerates computations.
Sparsity carries a number of substantive and computational advantages:
Dense matrices are noisy and contain a potentially large number of
irrelevant connections.
Dense matrices will bias downward indirect effects of a change in
observation j (the individual weights of non-zero entries in row-
standardized weight matrices will be smaller).
Dense matrices can be computationally intensive to the point that even
simple matrix operations are infeasible
Practice (W matrices)
15
Vicente Rios
Some computational facts on W sparsity:
With n = 65K
Dense Matrix = 31.9 GB of storage vs Sparse Matrix = 0.01 GB
With n = 208K
Dense Matrix = 324.8 GB of storage vs Sparse Matrix = 0.03 GB
With n = 8M (big data)
Dense Matrix = 501659.33 GB of storage vs Sparse Matrix = 1.1 GB
Ways to increase efficiency: ordering north-south or east-west
Concentrates nonzero elements around the diagonal
Log determinant of W with n=62K more than 12GB and almost infeasible in time for
most of machines
The same operation for a geographically ordered matrix takes less than a minute
Practice (W matrices)
16
Vicente Rios
Practice (W matrices)
17
Vicente Rios
K-nearest neighbor matrices
Practice (W matrices)
18
Vicente Rios
K-nearest neighbor matrices
Practice (W matrices)
19
Vicente Rios
(code continued)
Practice (W matrices)
20
Vicente Rios
The gravity matrix
Practice (W matrices)
21
Vicente Rios
Exponential decay matrices with cut-offs
Practice (W matrices)
22
Vicente Rios
5-nearest neighbor representation of NUTs-2 European regions
Practice (W matrices)
23
Vicente Rios
Practice (W matrices)
24
Vicente Rios
Indicator of spatial association
Global Autocorrelation
Local Autocorrelation
Global Autocorrelation:
It is a measure of overall clustering in the data. It yields one statistic to
summarize the whole study area.
Captures departures from random spatial distribution
Famous/Commonly employed statistics:
Moranโs I
Geryโs C
Getis and Ordโs G(d)
Testing Spatial Autocorrelation
25
Vicente Rios
Real distribution of unemployment rates in European regions (2011) vs a
spatially random distribution with the same parameters
๐ ~ (๐ = 9.4, ๐ = 5.25)
Real world vs spatial randomness
26
Vicente Rios
Moranโs I
This statistic is given by:
๐ผ =๐ฯ๐=1
๐ ฯ๐=1,๐โ ๐๐ ๐ค๐๐(๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
๐ ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ 2
where ๐ = ฯ๐=1๐ ฯ๐=1
๐ ๐ค๐๐ and ๐ค๐๐ is an element of the spatial weight matrix
that measures spatial distance or connectivity between regions i and j.
In matrix form:
๐ผ =๐
๐
๐งโฒ๐๐ง
๐งโฒ๐งwhere ๐ง = x โ าง๐ฅ. If the W matrix is row-standardized, then:
๐ผ =๐งโฒ๐๐ง
๐งโฒ๐งbecause S=n.
Values range from -1 (perfect dispersion) to +1 (perfect correlation). A zero
value indicates a random spatial pattern
Testing Spatial Autocorrelation
27
Vicente Rios
Note that:
แ๐ฝ๐๐ฟ๐ =ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ ๐ฆ๐ โ เดค๐ฆ
๐ฅ๐ โ าง๐ฅ 2
Therefore
๐ผ =๐ฯ๐=1
๐ ฯ๐=1,๐โ ๐๐ ๐ค๐๐(๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
๐ ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ 2
I, is equivalent to the slope of coefficient of a linear regression of the
spatial Wx on the observation vector x, measured in deviation from their
means. เทช๐๐ = ๐ฝ1 เทจ๐
where the tilde represents the variable is in deviation from the mean
Testing Spatial Autocorrelation
28
Vicente Rios
A very useful tool for understanding the Moranโs I test is the
Moranโs scatterplot:
Testing Spatial Autocorrelation
29
Vicente Rios
๐ฅ = ๐๐๐ฅ + ๐ โ ๐ฅ = (๐ผ โ ๐๐)โ1๐
Example with ๐ = 0.99
Testing Spatial Autocorrelation
30
Vicente Rios
๐ฅ = ๐๐๐ฅ + ๐ โ ๐ฅ = (๐ผ โ ๐๐)โ1๐
Example with ๐ = 0.00
Testing Spatial Autocorrelation
31
Vicente Rios
๐ฅ = ๐๐๐ฅ + ๐ โ ๐ฅ = (๐ผ โ ๐๐)โ1๐
Example with ๐ = โ0.99
Testing Spatial Autocorrelation
32
Vicente Rios
Many spatial econometric based studies use Moranโs I to motivate the
employment of spatial econometrics to analyze a specific variable
It can be complemented by means of spatially conditioned stochastic
kernels estimates of ๐ ๐ฆ|๐๐ฆ :
๐ ๐ฆ|๐๐ฆ =๐(๐ฆ,๐๐ฆ)
๐(๐ฆ)
where ๐ ๐ฆ|๐๐ฆ is the density of y conditional on the neighborโs values of y
The kernel ๐ ๐ฆ|๐๐ฆ is a conditional density and shows the probability that a
given region has a specific value or state of y, given their neighborโs values.
To estimate ๐ ๐ฆ|๐๐ฆ one first estimates the joint density of f ๐ฆ,๐๐ฆ and
then the marginal density ๐ ๐ฆ is calculated by integrating over y.
Testing Spatial Autocorrelation
33
Vicente Rios
Visual inspection of the kernel shape g(y|Wy) allows to observe if spatial patterns
are strong or weak.
If probability density flows along the main diagonal it means y would have had similar
values even if it have had different neighborโs (space not relevant)
If probability density flows in paralallel to the y axis it means spatial effects are
important drivers of the observed distribution of y. (space is relevant)
Testing Spatial Autocorrelation
34
Vicente Rios
Moranโs I calculation (example of Kosfeld lecture notes)
Assume we have the following spatial arrangement of units:
and the following geo-referenced variable
Testing Spatial Autocorrelation
35
Unemployment
Region 1 8
Region 2 6
Region 3 6
Region 4 3
Region 5 2
Vicente Rios
The spatial scheme:
can be represented by the following 5 x 5 contiguity matrix:
๐ =
0 1 1 0 01 0 1 1 0100
110
010
101
010
We will work first with the non-standardized W
Testing Spatial Autocorrelation
36
Vicente Rios
๐ผ =๐ฯ๐=1
๐ ฯ๐=1,๐โ ๐๐ ๐ค๐๐
โ (๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
๐ ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ 2
Table 1: Cross products (๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
Testing Spatial Autocorrelation
37
UR
Region 1 8
Region 2 6
Region 3 6
Region 4 3
Region 5 2
Avg 5
Vicente Rios
Unstandardized weights
Table 2: Unstandardized weights (๐ค๐๐โ )
Testing Spatial Autocorrelation
38
Vicente Rios
Table 3: weighted cross products: ฯ๐=1๐ ฯ๐=1,๐โ ๐
๐ ๐ค๐๐โ (๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
Testing Spatial Autocorrelation
39
Vicente Rios
Table 4: Sum of squared deviations ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ 2
Moranโs I (unstandardized weight matrix):
๐ผ =๐
๐
๐งโฒ๐๐ง
๐งโฒ๐ง=
5
12
18
24= 0.3125
Testing Spatial Autocorrelation
40
Vicente Rios
Opening Matlab you can reproduce these tedious calculations by
typing:
n=length(x);
xm=mean(x);
xmv=ones(n,1)*xm;
cprod1 = (x-xmv)'*W*(x-xmv); % this is Table 3
xsqr=(x-xmv)'*(x-xmv); % this is Table 4 (part of the denominator)
Wv=vec(W,2);
S=sum(Wv); %needed for the calculation of the numerator
I = [n/S]*[cprod1/xsqr]; % this is the Moranโs I value
res.I = I;
Testing Spatial Autocorrelation
41
Vicente Rios
Calculation of Moranโs I with standardized weight matrix:
๐ผ =ฯ๐=1๐ ฯ๐=1,๐โ ๐
๐ ๐ค๐๐(๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ 2
The cross-products are the same as in our previous case: (๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
Testing Spatial Autocorrelation
42
Vicente Rios
The row-normalized W, however, is different:
Table 5: Standardized weights ๐ค๐๐
Table 6: Weighted cross-products๐ค๐๐(๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
Testing Spatial Autocorrelation
43
Vicente Rios
Again, the sum of squared deviations is ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ 2 = 24
Thus, the Moranโs I (for the standardized W) is slightly higher:
๐ผ =ฯ๐=1๐ ฯ๐=1,๐โ ๐
๐ ๐ค๐๐ (๐ฅ๐ โ าง๐ฅ)(๐ฅ๐ โ าง๐ฅ)
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ 2
=11
24= 0.4583
Check in Matlab that by inputing the standardized W you actually
get this value.
This was the standardized W matrix
Testing Spatial Autocorrelation
44
Vicente Rios
Moranโs I statistical significance
To analyze significance of the observed spatial correlated pattern we need a Z statistic that allows
us to calculate p-values
It is given by:
๐ ๐ผ =๐ผ โ ๐ธ(๐ผ)
๐๐ด๐ (๐ผ)~๐(0,1)
Expected value ๐ธ ๐ผ = โ1
๐โ1
Variance of I (normal aprox)
๐๐ด๐ ๐ผ =๐2๐1+๐๐2+3๐0
2
(๐โ1)๐02 โ ๐ธ(๐ผ) 2
where:
๐0 =
๐=1
๐
๐=1
๐
๐ค๐๐ ; ๐1 =1
2
๐=1
๐
๐=1
๐
(๐ค๐๐ + ๐ค๐๐)2 ;
๐2 =
๐=1
๐
๐=1
๐
๐ค๐๐ +
๐=1
๐
๐ค๐๐
2
Testing Spatial Autocorrelation
45
Vicente Rios
In the example of 5 regions (n=5) we have calculated a value of Moranโs I of
0.4583 on the basis of the standardized weight matrix
Despite the small sample, we use the proportional approximation of the significance
of the Moranโs I test for illustrative purposes.
Expected value ๐ธ ๐ผ = โ1
๐โ1= โ0.25
๐0 =
๐=1
๐
๐=1
๐
๐ค๐๐ = 5
Testing Spatial Autocorrelation
46
Vicente Rios
๐1 =1
2
๐=1
๐
๐=1
๐
๐ค๐๐ +๐ค๐๐2
= [ ๐ค12 + ๐ค212 + ๐ค13 +๐ค31
2 + ๐ค14 +๐ค412 + ๐ค15 +๐ค51
2
+ ๐ค21 +๐ค122 + ๐ค23 +๐ค32
2 + ๐ค24 +๐ค422 + ๐ค25 +๐ค52
2
+ ๐ค31 +๐ค132 + ๐ค32 +๐ค23
2 + ๐ค34 +๐ค432 + ๐ค35 +๐ค53
2
+ ๐ค41 +๐ค142 + ๐ค42 +๐ค24
2 + ๐ค43 +๐ค342 + ๐ค45 +๐ค54
2
+ ๐ค51 +๐ค152 + ๐ค52 + ๐ค25
2 + ๐ค53 + ๐ค352 + ๐ค54 + ๐ค45
2
= [ ๐ค12 + ๐ค212 + ๐ค13 +๐ค31
2 + ๐ค14 +๐ค412 + ๐ค15 +๐ค51
2
+ ๐ค21 +๐ค122 + ๐ค23 +๐ค32
2 + ๐ค24 +๐ค422 + ๐ค25 +๐ค52
2
+ ๐ค31 +๐ค132 + ๐ค32 +๐ค23
2 + ๐ค34 +๐ค432 + ๐ค35 +๐ค53
2
+ ๐ค41 +๐ค142 + ๐ค42 +๐ค24
2 + ๐ค43 +๐ค342 + ๐ค45 +๐ค54
2
+ ๐ค51 +๐ค152 + ๐ค52 + ๐ค25
2 + ๐ค53 + ๐ค352 + ๐ค54 + ๐ค45
2
= ๐ค12 +๐ค212 + ๐ค13 + ๐ค31
2 + ๐ค21 +๐ค122 + ๐ค23 +๐ค32
2 + ๐ค24 +๐ค422 +
๐ค31 + ๐ค132 + ๐ค32 + ๐ค23
2 + ๐ค34 + ๐ค432 + ๐ค42 + ๐ค24
2 + ๐ค43 + ๐ค342 +
๐ค45 + ๐ค542 + ๐ค54 + ๐ค45
2
Testing Spatial Autocorrelation
47
Vicente Rios
= ๐ค12 +๐ค212 + ๐ค13 +๐ค31
2 + ๐ค21 + ๐ค122 + ๐ค23 +๐ค32
2
+ ๐ค24 + ๐ค422 + ๐ค31 + ๐ค13
2 + ๐ค32 + ๐ค232 + ๐ค34 + ๐ค43
2
+ ๐ค42 + ๐ค242 + ๐ค43 + ๐ค34
2 + ๐ค45 + ๐ค542 + ๐ค54 + ๐ค45
2
Recall that the standardized W is given by:
=1
2+1
3
2
+1
2+1
3
2
+1
3+1
2
2
+1
3+1
3
2
+1
3+1
3
2
+1
3+1
2
2
+1
3+1
3
2
+1
3+1
3
2
+1
3+1
3
2
+1
3+1
3
2
+1
3+ 1
2
= 4.5
Testing Spatial Autocorrelation
48
Vicente Rios
๐2 =
๐=1
๐
๐=1
๐
๐ค๐๐ +
๐=1
๐
๐ค๐๐
2
=
๐=1
๐
๐ค๐โ + ๐คโ๐2
๐=1
๐
๐ค๐โ +๐คโ๐2 =
= ๐ค1โ + ๐คโ12 + ๐ค2โ + ๐คโ2
2 + ๐ค3โ + ๐คโ32 + ๐ค4โ + ๐คโ4
2 + ๐ค5โ + ๐คโ52
= 1.16
Suming up we have:
โข ๐0 = 5
โข ๐1 = 4.5
โข ๐2 =21
18= 1.16
โข ๐๐ด๐ ๐ผ =๐2๐1+๐๐2+3๐0
2
(๐โ1)๐02 โ ๐ธ ๐ผ
2= 0.0745
โข ๐ ๐ผ = 2.5955 โ ๐ = 0.0095
Testing Spatial Autocorrelation
49
Vicente Rios
MATLAB code for the test on the statistical significance of the Moranโs I
EI=-(1./(n-1)); % expected value
S0=S; s1=zeros(n,n);
for i =1:n % loop over i
for j =1:n % loop over j
s1(i,j) = (W(i,j) + W(j,i)).^2;
end
end
s1v=vec(s1,2); S1=0.5*sum(s1v); %vectorize s1 and sum
s2=zeros(n,1);
for i= 1:n
s2(i) =([sum(W(i,:))+ sum(W(:,i))].^2);
end
S2=sum(s2);
NumVarI=(n^2)*S1-n*S2 + 3.*(S0).^2; DenVarI=(n^2-1)*(S0).^2;
VARI=(NumVarI./DenVarI)-EI^2;
Z=(I-EI)./(sqrt(VARI)); prob = norm_prb(Z);
Testing Spatial Autocorrelation
50
Vicente Rios
Testing Spatial Autocorrelation
51
Vicente Rios
If you copy previous sequence of code to calculate Moranโs I and to
calculate its significance in the Matlab editor and save it as a
function, each time you provide the function a variable x and a W
matrix, Matlab will calculate for you the corresponding values.
Testing Spatial Autocorrelation
52
Vicente Rios
Moran scatterplot (5 regions)
Testing Spatial Autocorrelation
53
Vicente Rios
The Moranโs scatterplot is a special form of a bivariate scatterplot which
makes use of the standardized values of the pairs (X,WX)
Augmented with the regression line it can be used to asses to the degree of
fit and to identify outliers
Table: Types of local spatial association
Positive spatial association: HH and LL
Negative spatial association: LH and HL (spatial outliers in case of + spatial
autocorrelation
Testing Spatial Autocorrelation
54
Spatially lagged geo-referenced variable
(WX)
High Low
Geo-referenced
variable (X)
High Quadrant I (HH) Quadrant IV(HL)
Low Quadrant II (LH) Quadrant III (LL)
Vicente Rios
Goals
Draw a Moranโs Scatterplot using of the unemployment rate in
European regions using the W matrices created previously. We will use
the 5-nearest neighbors and the exponential with cut-off at the first
quartile.
Run a OLS regression of X (unemployment rates) and WX (the
spatial lag of unemployment rates) using the two matrices with the
variables expressed in deviations with respect the sample average (or
use the originals with a constant)
Check the slopes obtained in the regression with the results of the
MoranI.m function we have coded. Is the Moranโs I statistically
significant at the 5% level ?
Practice (Global Spatial Autocorrelation)
55
Vicente Rios
Switch to MatlabโTutorial2_Global_Spat_Autocorr.mโ
56
Vicente Rios
Matlab functions
MoranI.m โ function that calculates Moranโs I statistic and its
significance level
OLS_demo.m โ function to perform basic OLS regression
prt.m โ prints the results into the command window of a regression
structure results.
Practice (Part Global Spatial Autocorr)
57
Vicente Rios
Practice (Part Global Spatial Autocorr)
58
Vicente Rios
Moranโs scatterplot of unemployment rates in European NUTS-2
regions
Practice (Part Global Spatial Autocorr)
59
Vicente Rios
Practice (Part Global Spatial Autocorr)
60
Vicente Rios
Practice (Part Global Spatial Autocorr)
61
Vicente Rios
Main message: spatial correlation is NOT universal like time
correlation. Depends on our defenition of space and interdependence.
Finding the true W is of key importance to model real spatial associations
Practice (Part Global Spatial Autocorr)
62
Vicente Rios
Global spatial correlation summarizes the strength of spatial
dependencies by a single statistic.
LISA focuses on heterogeneity of spatial association over space.
LISA provide detailed information of spatial clustering.
LISA for each observation tells how values around that observation are
clustered.
Useful for detecting local clusters and spatial outliers.
A local cluster is characterized by a concentration of high values of an
attribute variable X. A spatial clustering of high value contiguous
region is called hot spot whereas a spatial clustering of low value
contiguous regions is called cold spot.
Spatial outliers are regions with reversed orientation compared to the
predominant global one
Local Indicators of Spatial Association (LISA)
63
Vicente Rios
We deal with one of two may well-known LISA:
The Local Moranโs I statistic
Useful for detecting spatial outliers and general clustering
formations (we focus on this one)
The Getis-Ord G statistic
Better suited for identifying specific cluster formations
Local Indicators of Spatial Association (LISA)
64
Vicente Rios
Local Moran statistic I(i) detects local spatial autocorrelation. The I(i)โs are
indicators of local instability. They decompose the Moranโs I into contributions for
each location.
According to this property, Local Moranโs I can be used for two purposes:
Indicators of local spatial clusters
Diagnostics for outliers in global spatial patterns
Local Moranโs I statistic:
๐ผ๐ =(๐ฅ๐โ าง๐ฅ) ฯ๐=1
๐ ๐ค๐๐ ๐ฅ๐โ าง๐ฅ
1
๐ฯ๐=1๐ ๐ฅ๐โ าง๐ฅ
2
Numerator: determines the sign of I(i)
+ if both the i-th region and neighbors have above or below average values in the geo-
referenced variable X and
(-) if the i-th region as an above(below) neighboring regions have a below(above) average
values of X
Denominator: standardization of the cross-product by the variance of the georeferenced
variable X
Local Indicators of Spatial Association (LISA)
65
Vicente Rios
Below is a plot of Local Moran Z-scores for the 2004 Presidential
Elections. Higher absolute values of z scores (red) indicate the presence of
hot spots", where the percentage of the vote received by President Bush was
significantly different from that in neighboring counties.
Testing Spatial Autocorrelation
66
Vicente Rios
Example of Local Moranโs I:
We calculate Local Moran statistics with the standardized weights wij:
The sum of squared deviations from the mean has already been calculated with
the Moranโs I:
1/๐
๐=1
๐
๐ฅ๐ โ าง๐ฅ2= 4.8
This will be our denominator in the following calculations
Local Indicators of Spatial Association (LISA)
67
Vicente Rios
Region 1
๐ผ1 =(๐ฅ1 โ าง๐ฅ)ฯ๐=1
๐ ๐ค1๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
= 0.625
๐=1
๐
๐ค1๐ ๐ฅ๐ โ าง๐ฅ =1
26 โ 5 +
1
26 โ 5 = 1
๐ฅ1 โ าง๐ฅ = 8 โ 5
So:
๐ผ1 =(๐ฅ1 โ าง๐ฅ)ฯ๐=1
๐ ๐ค1๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
=(3)(1)
4.8= 0.625
Local Indicators of Spatial Association (LISA)
68
Vicente Rios
Region 2
๐ผ2 =(๐ฅ2 โ าง๐ฅ)ฯ๐=1
๐ ๐ค2๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
= 0.1389
๐=1
๐
๐ค2๐ ๐ฅ๐ โ าง๐ฅ =1
38 โ 5 +
1
36 โ 5 +
1
33 โ 5 =
2
3
๐ฅ2 โ าง๐ฅ = 6 โ 5 = 1
So:
๐ผ2 =(๐ฅ2 โ าง๐ฅ)ฯ๐=1
๐ ๐ค2๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
=1 (
23)
4.8= 0.1389
Local Indicators of Spatial Association (LISA)
69
Vicente Rios
Region 3
๐ผ3 =(๐ฅ3 โ าง๐ฅ)ฯ๐=1
๐ ๐ค3๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
= 0.1389
๐=1
๐
๐ค3๐ ๐ฅ๐ โ าง๐ฅ =1
38 โ 5 +
1
36 โ 5 +
1
33 โ 5 =
2
3
๐ฅ3 โ าง๐ฅ = 6 โ 5 = 1
So:
๐ผ3 =(๐ฅ3 โ าง๐ฅ)ฯ๐=1
๐ ๐ค3๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
=1 (
23)
4.8= 0.1389
Local Indicators of Spatial Association (LISA)
70
Vicente Rios
Region 4
๐ผ4 =(๐ฅ4 โ าง๐ฅ) ฯ๐=1
๐ ๐ค4๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
= 0.1389
๐=1
๐
๐ค4๐ ๐ฅ๐ โ าง๐ฅ =1
36 โ 5 +
1
36 โ 5 +
1
32 โ 5 = โ
1
3
๐ฅ4 โ าง๐ฅ = 3 โ 5 = โ2
So:
๐ผ4 =(๐ฅ4 โ าง๐ฅ)ฯ๐=1
๐ ๐ค4๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
=(โ2)(โ
13)
4.8= 0.1389
Local Indicators of Spatial Association (LISA)
71
Vicente Rios
Region 5
๐ผ5 =(๐ฅ5 โ าง๐ฅ)ฯ๐=1
๐ ๐ค5๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
= 1.25
๐=1
๐
๐ค5๐ ๐ฅ๐ โ าง๐ฅ = 1 3 โ 5 = โ2
๐ฅ5 โ าง๐ฅ = 2 โ 5 = โ3
So:
๐ผ5 =(๐ฅ5 โ าง๐ฅ)ฯ๐=1
๐ ๐ค5๐ ๐ฅ๐ โ าง๐ฅ
ฯ๐=1๐ ๐ฅ๐ โ าง๐ฅ
2/๐
=(โ2)(โ3)
4.8= 1.25
Local Indicators of Spatial Association (LISA)
72
Vicente Rios
Does the average of local Moranโs I produce the global Moranโs I calculated
before?
Recall that from our previous example with standardized weights we have:
I = 0.4583
๐ผ =1
5
๐
5
๐ผ๐ =1
50.625 + 0.1389 + 0.1389 + 0.1390 + 1.25 = 0.4583
Interpretation of the results in this example:
- A local spatial cluster is identified around region 5 and to somewhat les
around region 1, as both, ๐ผ5 and ๐ผ1 exceed the global Moranโs I noticeably
- Since all ๐ผ๐ values exceed their expected value, no outlying region with
respect to the orientation is identififed
Local Indicators of Spatial Association (LISA)
73
Vicente Rios
Goals
Estimate Local Moranโs I using unemployment rates in European
regions using the exponential with cut-off at the third quartile W
matrix. Use the function โlocalMoranI.mโ
Check that the average of the Local Moran Iโs add up to the global
Moran I (you need to calculate the global Moran for these Ws)
Create a scatterplot of the estimated Local Moran Iโs and another of its
estimated p-values. Is there any pattern?
Create one map of the estimated Local Moranโs I and another one of
the estimated p-values
Practice (Part Local Spatial Autocorr)
74
Vicente Rios
Switch to MatlabโTutorial3_Local_Spat_Autocorr.mโ
75
Vicente Rios
Practice (Part Local Spatial Autocorr)
76
You should obtain a global Moranโs I of 0.8797 and that the average over
Local Moranโs I is also 0.8797
Vicente Rios
Local Moranโs I Map
Practice (Part Local Spatial Autocorr)
77
Local cluster of high
unemployment rates
Vicente Rios
Some simplified insights in the south-of Spain local cluster of
unemployment:
(1) Low-valued addded specialization in agriculture (olive oil) dependent on
subsidies and strong public-sector employment share (non-market services)
(2) Distribution of land and income, highly unequal (due to historical reasons)
(1) + (2) โ dependent population
(3) Socialist Party stronghold โ Monopoly of political power
(4) High levels of corruption
(3) + (4) โ clientelistic regime
(5) High levels of religiosity โ traditional values and few entrepreneurship
(6) High levels of luminosity + nice weather โ strong amenity
All together: corrupt regime with dependent population that does not migrate
to other region (there is not regional re-balancing of the labor supply)
Practice (Part Local Spatial Autocorr)
78
Vicente Rios
Practice (Part Local Spatial Autocorr)
79
Vicente Rios
Practice (Part Local Spatial Autocorr)
80
Vicente Rios
Practice (Part Local Spatial Autocorr)
81