1 of 20

Spatial Autocorrelation is

EVERYWHERE

Pelayo Arbués

Data Scientist

@pelayoarbues

2 of 20

AGENDA

What is Spatial Autocorrelation?

How to test it?

Quick note on Spatial Cross Validation

2

3 of 20

“Everything is related to everything else, but near things are more related than distant things”

Waldo Tobler (1970)

4 of 20

Spatial Autocorrelation: What is it? Why you should care

Relationship between nearby locations of the realization of a single variable

  • Positive:
    • Similar values in Similar location. (Clustered)

  • Negative:
    • Similar values further apart. (Checkerboard pattern)

Uses of Spatial Autocorrelation (Getis, 2010):

  • A test on model misspecification
  • A measure of spatial effects
  • A test on spatial heterogeneity
  • A means of identifying spatial clusters
  • A way to understand Modifiable Areal Unit Problem (MAUP)
  • A means of identifying outliers (spatial and non spatial)
  • ...

5 of 20

6 of 20

Introducing Uber’s H3

  • Data points are bucketed in hexagons
  • Hexagons have regular shapes vs Postal areas, Census tracts and other administrative polygons
  • H3 supports sixteen resolutions. Each finer resolution has cells with one seventh the area of the coarser resolution.
  • Square grids have two different neighbors: edge and vertex

7 of 20

8 of 20

9 of 20

10 of 20

Testing for Spatial Autocorrelation:

1. Choose a neighborhood criterion ? Which areas are linked?

2. Assign weights to the areas that are linked ? Create a spatial weights matrix

3. Run statistical test, using weights matrix, to examine spatial autocorrelation

11 of 20

Testing for Spatial Autocorrelation:

1. Choose a neighborhood criterion: Which areas are linked?

2. Assign weights to the areas that are linked: Create a spatial weights matrix

3. Run statistical test, using weights matrix, to examine spatial autocorrelation

12 of 20

Testing for Spatial Autocorrelation:

1. Choose a neighborhood criterion: Which areas are linked?

2. Assign weights to the areas that are linked: Create a spatial weights matrix (W)

3. Run statistical test, using weights matrix, to examine spatial autocorrelation

13 of 20

Testing for Spatial Autocorrelation:

1. Choose a neighborhood criterion: Which areas are linked?

2. Assign weights to the areas that are linked: Create a spatial weights matrix

3. Run statistical test, using weights matrix, to examine spatial autocorrelation

Global Tests: Moran’s I:

Local Tests: Local Indicators Of Spatial Associations (LISAs):

  • Local Moran’s I
  • Getis-Ord G

14 of 20

15 of 20

16 of 20

Global Tests

17 of 20

Local Tests

18 of 20

Cross Validation under Spatial Autocorrelation

19 of 20

References

Arribas-Bel, Daniel (2019): Geographic Data Science Course by @darribasbel: http://darribas.org/gds19/

Uber’s H3: https://eng.uber.com/h3/

Spatial Weights Matrix: https://crd230.github.io/lab5.html#spatial_weights_matrix

Geocomputation with R: https://geocompr.robinlovelace.net/

Machine Learning for Spatial Data: http://www.opengeohub.org/machine-learning-spatial-data

Fischer, M. M., & Getis, A. (Eds.). (2010). Handbook of Applied Spatial Analysis. Berlin, Heidelberg: Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-03647-7

20 of 20

We data