Top Banner
51

Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

Feb 27, 2019

Download

Documents

dodieu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial EconometricsLecture 2: Spatial weight matrix W

Andrzej Torój

Institute of Econometrics � Department of Spatial Econometrics

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 1 / 34

Page 2: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Outline

1 Spatial weight matrix

2 Main construction methods of WNeighbourhood-based matrixDistance-based matrix

3 Other methods of building matrix WAlternative methods of selecting neighboursFigurative measures of distance

4 Normalisation of WNormalisationConclusion

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 2 / 34

Page 3: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Plan prezentacji

1 Spatial weight matrix

2 Main construction methods of W

3 Other methods of building matrix W

4 Normalisation of W

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 3 / 34

Page 4: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Identi�cation problem in spatial models (1)

Consider the vector y = (y1, ..., yN) of spatially dependentobservations.

The spatial interdependence could potentially be formalized as:y1 = c1,1 + α1,2y2 + α1,3y3 + ...+ α1,NyNy2 = c2,1 + α2,1y1 + α2,3y3 + ...+ α2,NyN...yN = cN,1 + αN,1y1 + αN,2y2 + ...+ αN,N−1yN−1

If all the elements of αi ,j were to be estimated (excludingconstants), the number of estimated parameters would equalN2 − N and the number of observations N. Obviouslyimpossible to do.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 4 / 34

Page 5: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Identi�cation problem in spatial models (1)

Consider the vector y = (y1, ..., yN) of spatially dependentobservations.

The spatial interdependence could potentially be formalized as:y1 = c1,1 + α1,2y2 + α1,3y3 + ...+ α1,NyNy2 = c2,1 + α2,1y1 + α2,3y3 + ...+ α2,NyN...yN = cN,1 + αN,1y1 + αN,2y2 + ...+ αN,N−1yN−1

If all the elements of αi ,j were to be estimated (excludingconstants), the number of estimated parameters would equalN2 − N and the number of observations N. Obviouslyimpossible to do.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 4 / 34

Page 6: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Identi�cation problem in spatial models (1)

Consider the vector y = (y1, ..., yN) of spatially dependentobservations.

The spatial interdependence could potentially be formalized as:y1 = c1,1 + α1,2y2 + α1,3y3 + ...+ α1,NyNy2 = c2,1 + α2,1y1 + α2,3y3 + ...+ α2,NyN...yN = cN,1 + αN,1y1 + αN,2y2 + ...+ αN,N−1yN−1

If all the elements of αi ,j were to be estimated (excludingconstants), the number of estimated parameters would equalN2 − N and the number of observations N. Obviouslyimpossible to do.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 4 / 34

Page 7: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Identi�cation problem in spatial models (2)

In practice, we make things feasible by treating the squarematrix α ≡ [αi ,j ] (with zero diagonal elements) as a product:

α = ρ ·W

of unknown parameter ρof known, exogenous matrix W

Interpretation:Non-zero elements of i-th row indicate regions linked to the i-thregion, while proportions between positive values indicate therelative strength of this link.ρ is estimated. The exact interpretation depends on theconstruction details of W (see further), but if ρ is not signi�cantlydi�erent from 0, no spatial e�ects occur (and e.g. the classicallinear regression model applies).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 5 / 34

Page 8: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Identi�cation problem in spatial models (2)

In practice, we make things feasible by treating the squarematrix α ≡ [αi ,j ] (with zero diagonal elements) as a product:

α = ρ ·W

of unknown parameter ρof known, exogenous matrix W

Interpretation:Non-zero elements of i-th row indicate regions linked to the i-thregion, while proportions between positive values indicate therelative strength of this link.ρ is estimated. The exact interpretation depends on theconstruction details of W (see further), but if ρ is not signi�cantlydi�erent from 0, no spatial e�ects occur (and e.g. the classicallinear regression model applies).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 5 / 34

Page 9: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Spatial weight matrix

W is a central notion to spatial econometrics. It describes thenetwork of relationships between any pair of units (e.g.regions).

Every element represents a link between a pair of regions.

W is a square matrix. Its i-th row shall be interpreted as avector of weights that de�ne the impact of other regions onthe i-th region.

Matrix W has zero diagonal. I.e., the region does not impacton itself directly.

But it does indirectly: we impact the neighbour, and theinduced change impact.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 6 / 34

Page 10: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Spatial weight matrix

W is a central notion to spatial econometrics. It describes thenetwork of relationships between any pair of units (e.g.regions).

Every element represents a link between a pair of regions.

W is a square matrix. Its i-th row shall be interpreted as avector of weights that de�ne the impact of other regions onthe i-th region.

Matrix W has zero diagonal. I.e., the region does not impacton itself directly.

But it does indirectly: we impact the neighbour, and theinduced change impact.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 6 / 34

Page 11: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Spatial weight matrix

W is a central notion to spatial econometrics. It describes thenetwork of relationships between any pair of units (e.g.regions).

Every element represents a link between a pair of regions.

W is a square matrix. Its i-th row shall be interpreted as avector of weights that de�ne the impact of other regions onthe i-th region.

Matrix W has zero diagonal. I.e., the region does not impacton itself directly.

But it does indirectly: we impact the neighbour, and theinduced change impact.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 6 / 34

Page 12: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

Example matrix W

Source: Arbia (2014).Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 7 / 34

Page 13: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

How to build W matrix?

1 De�ne �space� adequately to the problem.1 geography?2 something else? (proximity / remoteness as a function of

economic, social, cultural factors...)

2 Use an adequate measure for this de�nition.1 binary metrics: neighbourhood / adherence to a group2 continuous metrics: function of distance / �distance�3 hybrid metrics: choose k nearest / �nearest� neighbours

3 Normalise matrix W .

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 8 / 34

Page 14: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

How to build W matrix?

1 De�ne �space� adequately to the problem.1 geography?2 something else? (proximity / remoteness as a function of

economic, social, cultural factors...)

2 Use an adequate measure for this de�nition.1 binary metrics: neighbourhood / adherence to a group2 continuous metrics: function of distance / �distance�3 hybrid metrics: choose k nearest / �nearest� neighbours

3 Normalise matrix W .

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 8 / 34

Page 15: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Spatial weight matrix

How to build W matrix?

1 De�ne �space� adequately to the problem.1 geography?2 something else? (proximity / remoteness as a function of

economic, social, cultural factors...)

2 Use an adequate measure for this de�nition.1 binary metrics: neighbourhood / adherence to a group2 continuous metrics: function of distance / �distance�3 hybrid metrics: choose k nearest / �nearest� neighbours

3 Normalise matrix W .

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 8 / 34

Page 16: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Plan prezentacji

1 Spatial weight matrix

2 Main construction methods of W

3 Other methods of building matrix W

4 Normalisation of W

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 9 / 34

Page 17: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Neighbourhood-based matrix

Neighbourhood matrix is a special, most popular case.

Regions (columns) neighbouring the i-th region are indicatedas 1 in the i-th row (otherwise 0).

The case of isolated regions might be problematic (NorthernIreland in UK, Sicilia in IT, etc.). One can attempt to avoidthis by e.g. indicating the nearest region as the only neighbour,or one can correct the existing methods accordingly.

Method adequate for polygons / regions (but not for points).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 10 / 34

Page 18: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Neighbourhood-based matrix

Neighbourhood matrix is a special, most popular case.

Regions (columns) neighbouring the i-th region are indicatedas 1 in the i-th row (otherwise 0).

The case of isolated regions might be problematic (NorthernIreland in UK, Sicilia in IT, etc.). One can attempt to avoidthis by e.g. indicating the nearest region as the only neighbour,or one can correct the existing methods accordingly.

Method adequate for polygons / regions (but not for points).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 10 / 34

Page 19: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Neighbourhood-based matrix

Neighbourhood matrix is a special, most popular case.

Regions (columns) neighbouring the i-th region are indicatedas 1 in the i-th row (otherwise 0).

The case of isolated regions might be problematic (NorthernIreland in UK, Sicilia in IT, etc.). One can attempt to avoidthis by e.g. indicating the nearest region as the only neighbour,or one can correct the existing methods accordingly.

Method adequate for polygons / regions (but not for points).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 10 / 34

Page 20: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Neighbourhood-based matrix

Neighbourhood matrix is a special, most popular case.

Regions (columns) neighbouring the i-th region are indicatedas 1 in the i-th row (otherwise 0).

The case of isolated regions might be problematic (NorthernIreland in UK, Sicilia in IT, etc.). One can attempt to avoidthis by e.g. indicating the nearest region as the only neighbour,or one can correct the existing methods accordingly.

Method adequate for polygons / regions (but not for points).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 10 / 34

Page 21: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Neighbourhood-based matrix: example

Does... ...neighbour... ...?

USA Canada YES

Canada USA YES

USA Mexico YES

Mexico USA YES

Canada Mexico NO

Mexico Canada NO

W S =

US0

CA1

MX1

1 0 01 0 0

W =

US0

CA0.5

MX0.5

1 0 01 0 0

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 11 / 34

Page 22: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Construction of matrixW in R based on neighbourhood

1 Create SpatialPolygonDataFrame (see: lecture 1). The mapimplies information about sharing borders by individual regions.

2 Create an object storing lists of neighbours � nb.contnb <- poly2nb(spatial_data, queen = T)

queen = T � treat as neighbours even when the shared borderis only one vertex (chess players know where this comesfrom...)

3 Normalise by rows, creating a listw object.W_list <- nb2listw(contnb, style = "W")

If we have (and intend to keep) isolated regions, then thecommand nb2listw must be supplemented by the argumentzero.policy = TRUE.listw is an e�cient form of storing the (usually sparse) matrixW .

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 12 / 34

Page 23: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Construction of matrixW in R based on neighbourhood

1 Create SpatialPolygonDataFrame (see: lecture 1). The mapimplies information about sharing borders by individual regions.

2 Create an object storing lists of neighbours � nb.contnb <- poly2nb(spatial_data, queen = T)

queen = T � treat as neighbours even when the shared borderis only one vertex (chess players know where this comesfrom...)

3 Normalise by rows, creating a listw object.W_list <- nb2listw(contnb, style = "W")

If we have (and intend to keep) isolated regions, then thecommand nb2listw must be supplemented by the argumentzero.policy = TRUE.listw is an e�cient form of storing the (usually sparse) matrixW .

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 12 / 34

Page 24: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Construction of matrixW in R based on neighbourhood

1 Create SpatialPolygonDataFrame (see: lecture 1). The mapimplies information about sharing borders by individual regions.

2 Create an object storing lists of neighbours � nb.contnb <- poly2nb(spatial_data, queen = T)

queen = T � treat as neighbours even when the shared borderis only one vertex (chess players know where this comesfrom...)

3 Normalise by rows, creating a listw object.W_list <- nb2listw(contnb, style = "W")

If we have (and intend to keep) isolated regions, then thecommand nb2listw must be supplemented by the argumentzero.policy = TRUE.listw is an e�cient form of storing the (usually sparse) matrixW .

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 12 / 34

Page 25: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Queen criterion (queen = T) (1)

Source: Arbia (2014).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 13 / 34

Page 26: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Queen criterion (queen = T) (2)

Appears as a virtual problem when we think about Polish poviats.But real if we look at counties in Texas (US) or point dataaggregated into �regions� on a rectangular grid (we'll come back toit).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 14 / 34

Page 27: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Neighbourhood of order 1 for Polish poviats

Function: plot.nb

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 15 / 34

Page 28: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Neighbourhood-based matrix

Neighbourhood of order 1 and 2 for Polish poviats

Every neighbour of my neighbour is also my neighbour (nblag andnblag_cumul)

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 16 / 34

Page 29: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Distance-based matrix

Construction of distance-based matrix

A alternative way of building matrix W is allowing for directinteractions between all regions. The intensity of link dependson the distance.

Let di ,j denote the distance between i and j. Then:

W =

0 1

(d1,2)γ · · · 1

(d1,N)γ

1(d1,2)

γ 0 · · · 1

(d2,N)γ

......

. . .1

(d1,N)γ

1

(d2,N)γ 0

γ is a calibrated parameter of decay. In the absence of anyother evidence, one could assume that e.g. γ = 1.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 17 / 34

Page 30: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Distance-based matrix

Construction of distance-based matrix

A alternative way of building matrix W is allowing for directinteractions between all regions. The intensity of link dependson the distance.

Let di ,j denote the distance between i and j. Then:

W =

0 1

(d1,2)γ · · · 1

(d1,N)γ

1(d1,2)

γ 0 · · · 1

(d2,N)γ

......

. . .1

(d1,N)γ

1

(d2,N)γ 0

γ is a calibrated parameter of decay. In the absence of anyother evidence, one could assume that e.g. γ = 1.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 17 / 34

Page 31: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Distance-based matrix

Construction of distance-based matrix

A alternative way of building matrix W is allowing for directinteractions between all regions. The intensity of link dependson the distance.

Let di ,j denote the distance between i and j. Then:

W =

0 1

(d1,2)γ · · · 1

(d1,N)γ

1(d1,2)

γ 0 · · · 1

(d2,N)γ

......

. . .1

(d1,N)γ

1

(d2,N)γ 0

γ is a calibrated parameter of decay. In the absence of anyother evidence, one could assume that e.g. γ = 1.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 17 / 34

Page 32: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Distance-based matrix

Construction of distance-based matrix in R

The function DistanceMatrix is required.

It takes an object of type SpatialPolygonDataFrame as anargument.

The function works correctly only if points / vertices ofpolygons are supplied as degrees of longitude and latitude.

In the maps from CODGiK, this is not the case.This is why we need to spTransform.When working with your own data, one should always look upthe order of coordinates' magnitude or, if available, the codingstandard of coordinates.

The distances are computed either between pairs of points (fora map of points) or pairs of centroids (for a map of polygons).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 18 / 34

Page 33: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Distance-based matrix

Centroids -- geometric centers of gravity (1)

In each case, the denominator is the area of the �gure.The real-world borders of regions are usually not represented as functional forms :-) (Texas might be anexception...), so R is using numerical approximations to the above integrals.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 19 / 34

Page 34: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Distance-based matrix

Centroids (2)

Paradox � notice the location of centroid for the pozna«ski poviat(not the same as poviat city Pozna«!).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 20 / 34

Page 35: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Distance-based matrix

Centroids (3)

Paradox � notice the location of centroid for the pozna«ski poviat(not the same as poviat city Pozna«!).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 21 / 34

Page 36: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Plan prezentacji

1 Spatial weight matrix

2 Main construction methods of W

3 Other methods of building matrix W

4 Normalisation of W

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 22 / 34

Page 37: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Alternative methods of selecting neighbours

Neighbour selection by distance criterion

Elements of matrix W are put equal to 1, if the distancebetween two regions does not exceed a pre-speci�ed value, or0 otherwise.

The method works well, when:

our data does not represent spatial polygons, but spatial points(and the logic of sharing borders does not apply);we intend to avoid the presence of isolated regions.

Instead of poly2nb we use the function dnearneigh (afterobtaining the centroids via function coordinates).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 23 / 34

Page 38: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Alternative methods of selecting neighbours

k nearest neighbours method

Elements of matrix W = [wi ,j ] are equal to 1, if region jbelongs to k geographically nearest regions for i (0 otherwise).

Numerical investigations con�rm that modelling results areusually robust to the choice of k (LeSage and Pace, 2014).

The method works well, when:

our data does not represent spatial polygons, but spatial points(and the logic of sharing borders does not apply);we intend to avoid the presence of isolated regions.

Instead of poly2nb we use the function knearneigh (oncentroids, again).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 24 / 34

Page 39: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Figurative measures of distance

Figurative measures of distance

Sometimes we measure distance in a non-geographical,�gurative way (Corrado, Fingleton, 2012).

Instead, we look at cultural, social or economic proximity ofregions � not necessarily the neighbouring or nearby ones.E.g., in some respects, Warsaw is more connected to Pozna«than to Otwock.

Then we have to construct W on our own (example providedin the R �le).

But let's be careful!

Using such an approach, we are more exposed to the risk of breaking thefundamental assumption: about exogeneity of W . As a result, theestimation of spatial models could be inconsistent.Solution: network co-evolution models (cf. Franzese, Hays, Kachi2012).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 25 / 34

Page 40: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Figurative measures of distance

User-supplied neighbourhood matrices

For example: neighbourhood only within one voivodship oronly capitals of voivodships being neighbours.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 26 / 34

Page 41: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Plan prezentacji

1 Spatial weight matrix

2 Main construction methods of W

3 Other methods of building matrix W

4 Normalisation of W

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 27 / 34

Page 42: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Normalisation

Why do we normalise W?

To obtain an intuitive interpretation of ρ as the weightedaverage impact of neighbours.

To avoid the risk of inverting a near-singular matrix.

To avoid numerical issues related to di�erent scaling ofvariables.

To avoid �explosive� spatial multipliers implied by ρ (byanalogy to time series econometrics, where autoregressionparameter is expected to be < 1 in modulus � we'll come backto that when discussing spatial panels).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 28 / 34

Page 43: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Normalisation

Why do we normalise W?

To obtain an intuitive interpretation of ρ as the weightedaverage impact of neighbours.

To avoid the risk of inverting a near-singular matrix.

To avoid numerical issues related to di�erent scaling ofvariables.

To avoid �explosive� spatial multipliers implied by ρ (byanalogy to time series econometrics, where autoregressionparameter is expected to be < 1 in modulus � we'll come backto that when discussing spatial panels).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 28 / 34

Page 44: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Normalisation

Why do we normalise W?

To obtain an intuitive interpretation of ρ as the weightedaverage impact of neighbours.

To avoid the risk of inverting a near-singular matrix.

To avoid numerical issues related to di�erent scaling ofvariables.

To avoid �explosive� spatial multipliers implied by ρ (byanalogy to time series econometrics, where autoregressionparameter is expected to be < 1 in modulus � we'll come backto that when discussing spatial panels).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 28 / 34

Page 45: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Normalisation

Why do we normalise W?

To obtain an intuitive interpretation of ρ as the weightedaverage impact of neighbours.

To avoid the risk of inverting a near-singular matrix.

To avoid numerical issues related to di�erent scaling ofvariables.

To avoid �explosive� spatial multipliers implied by ρ (byanalogy to time series econometrics, where autoregressionparameter is expected to be < 1 in modulus � we'll come backto that when discussing spatial panels).

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 28 / 34

Page 46: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Normalisation

Normalisation techniques (1)

Most frequently, we normalise W row by row, so as to makethe elements of each row sum to unity (row-stochastic,row-standardized).

nb2listw(..., style = "W")

side e�ect: asymmetry of normalised W (against theoreticalarguments: Vega and Elhorst, 2014)

Instead of �W� we can also use:

�B� : not normalised�C� : normalised by scalar (all elements sum to N, butindividual rows not necessarily sum to 1)�N� : normalised by scalar (all elements sum to 1)�S� : Tiefelsdorf, Gri�th, Boots (1999)�minmax� : Kelejian, Prucha (2010)

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 29 / 34

Page 47: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Normalisation

Normalisation by row � always good?

Advantage: vector Wx (spatial lag � more about it in the next lecture)can be interpreted as a weighted average of the variables for the unitsconnected to the �rst, second, third unit... etc. (e.g. for theirneighbours).

Disadvantage: whose apartment is louder? 's or 's?

0 dB 150 dB

0 dB 0 dB 0 dB 0 dB

0 dB 0 dB 0 dB 0 dB

When elements of neighbourhood-basedW (queen-criterion) arenormalised by row:

: 15(0+ 0+ 0+ 0+ 150) = 30dB (which is more silent than...)

: 13(0+ 0+ 150) = 50dB (is that intuitive...?)

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 30 / 34

Page 48: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Normalisation

Normalisation techniques (2)

Alternative method: normalise by scalar � maximum modulusof W 's eigenvalue:

W∗ = W

λmax

Most popular strategy among normalisations by scalar.

Advantage: 1λmin

< ρ < 1.

Disadvantage: ρ not interpretable in a standard way.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 31 / 34

Page 49: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Conclusion

How does R store matrix W?

Depending on the input information and the end-point of theanalysis, we use and convert di�erent objects all along the way.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 32 / 34

Page 50: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Conclusion

How to select the optimumW?

Usually few arguments to support any choice (Anselin, 2002). Best guess.

Neumayer, Plumper (2016) advise to let the theory guide you(sometimes di�cult...).

Post-estimation comparison of log-likelihood or Bayesian posterior modelprobabilities for di�erent W .

The fundamental question to address:

Does W adequately represent the network of direct links between units in thecontext of the analysed dependent variable?

Consequences of a mistake:

low power of diagnostic tests;inconsistency and bias of estimators;weak statistical identi�cation of models.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 33 / 34

Page 51: Spatial Econometrics - web.sgh.waw.plweb.sgh.waw.pl/~atoroj/ekonometria_przestrzenna/2_W_EN.pdf · W matrix Main construction methods Other methods Normalisation Spatial Econometrics

W matrix Main construction methods Other methods Normalisation

Conclusion

Homework 2

For the spatial dataset considered in the �rst homework, build threeadditional W matrices:

1 neighbourhood (order 1), but normalised with the highesteigenvalue (tip: you can do it with the matrix immediately, and thentransform it into listw without normalisation).

2 based on inverted squared distances, but only up to 200 km (abovethat � no link at all).

3 based on Euclidian distance between 3 standardised variables forpairs of regions i , j(√

(x1,i − x1,j)2 + (x2,i − x2,j)

2 + (x3,i − x3,j)2

); these variables

should, in our view, correctly re�ect the network of connectionsrelated to the variable presented in Homework 1.

In future homeworks, one can consider other matrices than those builthere.

Andrzej Torój Institute of Econometrics � Department of Spatial Econometrics

(2) Spatial Econometrics 34 / 34