Skip to content

Add spatial autocorrelation statistics (Moran's I, LISA, Geary's C) #1135

@brendancol

Description

@brendancol

Motivation

We already have Getis-Ord Gi* via hotspots() and emerging_hotspots(), but Moran's I (global and local/LISA) is the other fundamental spatial statistic that most analysis workflows depend on. Right now users have to leave xarray-spatial to compute these, which breaks the pipeline.

Scope

Statistics:

  • Global Moran's I
  • Local Moran's I (LISA) with significance testing via random permutation
  • Geary's C (global and local)
  • Join count statistics for categorical rasters

Spatial weights:

  • Queen and rook contiguity derived from the raster grid structure
  • Distance-band weights (binary and inverse-distance)

Implementation notes

  • Should follow the existing backend dispatch pattern: numpy, cupy, dask+numpy, dask+cupy via ArrayTypeFunctionMapping.
  • Local statistics (LISA, local Geary) return xarray DataArrays matching the input grid. Global statistics (Moran's I, Geary's C) return scalar results.
  • P-values from permutation testing should be included in the output, either as a second DataArray or as attributes.
  • Permutation-based significance is embarrassingly parallel and maps well to both dask chunks and GPU threads.

Related

  • hotspots() already computes Gi* z-scores
  • emerging_hotspots() does temporal hot spot classification
  • PySAL/esda covers this for vector data, but there's nothing raster-native

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions