mesa.ecospatial.local_spatial_stats

mesa.ecospatial.local_spatial_stats(grid, mode='MoranI', tissue_only=False, p_value=0.01, seed=42, plot_weights=False)

Compute local indicators of spatial association (LISA) for local spatial autocorrelation, and return significant hotspots and coldspots.

Parameters:
  • grid (numpy.ndarray) – The 2D grid of diversity indices to be analyzed.

  • mode (str, optional (default='MoranI')) – The spatial statistic to use. One of {‘MoranI’, ‘GearyC’, ‘GetisOrdG’}.

  • tissue_only (bool, optional (default=False)) – If True, the analysis is restricted to tissue regions.

  • p_value (float, optional (default=0.01)) – The p-value cutoff for significance.

  • seed (int, optional (default=42)) – Random seed for reproducibility.

  • plot_weights (bool, optional (default=False)) – If True, visualize the spatial weights matrix.

Returns:

  • hotspots (numpy.ndarray) – Boolean array indicating hotspots (high value surrounded by high values).

  • coldspots (numpy.ndarray) – Boolean array indicating coldspots (low value surrounded by low values).