Spatial Statistics

Measure the pattern instead of eyeballing the map.

A map of points always looks clustered, because population is clustered. Spatial statistics is the set of tools that tell you whether a pattern is more clustered than chance would produce, and where. These guides run from the question that undermines all of them — the modifiable areal unit problem — through density surfaces, hexagonal binning, DBSCAN, spatial weights, Moran's I and Getis-Ord hotspots, with the parameter choices that decide the answer made explicit rather than left on their defaults.

13 Steps in this path

The full path, in order

13 guides: the concepts underneath the work, then each task, then the errors that task produces. Work down, or jump to the step you need.

  1. Kernel Density Explained: What a Heatmap Actually Shows kernel density explained 🧭 Concept
  2. How to Make a Point Density Heatmap in Python point density heatmap python ⚙️ How-To
  3. Your Heatmap Looks Wrong: KDE Bandwidth and Cell Size kde bandwidth wrong 🔧 Fix
  4. How to Bin Points into Hexagons in Python hexbin points python ⚙️ How-To
  5. Spatial Clustering Explained: DBSCAN, K-Means and What They Assume spatial clustering explained 🧭 Concept
  6. How to Cluster Points by Location with DBSCAN in Python dbscan spatial clustering python ⚙️ How-To
  7. DBSCAN Returns One Giant Cluster or Labels Everything Noise dbscan one cluster 🔧 Fix
  8. How to Build a Distance Matrix Between Two Layers in Python distance matrix geopandas ⚙️ How-To
  9. Spatial Autocorrelation Explained spatial autocorrelation explained 🧭 Concept
  10. How to Calculate Moran's I in Python morans i python ⚙️ How-To
  11. Spatial Weights Warn About Islands or Moran's I Returns nan spatial weights islands warning 🔧 Fix
  12. How to Find Hotspots with Getis-Ord Gi* in Python getis ord hotspot python ⚙️ How-To

Topics this path covers

A path is a route; a topic is everything the site has on a subject. Open a topic to see the guides this path skips.

Other ways in