mesa.ecospatial.local_moran

mesa.ecospatial.local_moran(grid: ndarray, tissue_only=False, p_value=0.01, seed=42, plot_weights=False)

Perform local Moran’s I test (LISA) for local spatial autocorrelation

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

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

  • p_value (float, optional) – The p-value threshold for significance. Defaults to 0.01.

  • seed (int, optional) – The random seed for reproducibility. Defaults to 42.

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

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).

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

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