Skip to content

Add MCDA module for spatial multi-criteria decision analysis (#1030)#1058

Open
brendancol wants to merge 1 commit intomasterfrom
issue-1030
Open

Add MCDA module for spatial multi-criteria decision analysis (#1030)#1058
brendancol wants to merge 1 commit intomasterfrom
issue-1030

Conversation

@brendancol
Copy link
Contributor

Closes #1030

Summary

  • New xrspatial.mcda subpackage with five modules: standardize, weights, combine, constrain, sensitivity
  • Six standardization methods (linear, sigmoidal, gaussian, triangular, piecewise, categorical) for converting raw criterion layers to a 0-1 suitability scale
  • AHP pairwise comparison weights with consistency ratio validation, plus rank-order weighting (ROC, rank sum, reciprocal)
  • Five combination methods: WLC, WPM, OWA (tunable risk attitude), fuzzy overlay (AND/OR/sum/product/gamma), boolean overlay
  • Constraint masking and sensitivity analysis (one-at-a-time perturbation and Monte Carlo CV)
  • All operations are element-wise, so they work across numpy, cupy, dask+numpy, and dask+cupy without explicit backend dispatch
  • No new dependencies

Test plan

  • 148 tests passing (pytest xrspatial/tests/test_mcda.py)
  • Correctness against known values (AHP textbook example, ROC formula, WLC/WPM manual computation)
  • Edge cases: degenerate triangles, inf/NaN propagation through all methods, single-criterion datasets, single-pixel rasters, sigmoid overflow, inverted bounds, duplicate breakpoints, AHP self-comparison/zero/negative, extra weight keys, boolean overlay with floats, mismatched coords
  • Dask: chunk alignment for standardize/WLC/fuzzy/OAT, Monte Carlo eager computation to prevent graph explosion, piecewise/categorical map_blocks cupy safety
  • Sensitivity: weight boundary clamping, single-criterion no-op, Monte Carlo reproducibility (same seed = same result), WPM combine method
  • Docs reference page and README feature matrix updated
  • User guide notebook (35_MCDA.ipynb)

@github-actions github-actions bot added the performance PR touches performance-sensitive code label Mar 23, 2026
New xrspatial.mcda subpackage covering the four stages of raster MCDA:

Standardize (6 value functions):
  linear, sigmoidal, gaussian, triangular, piecewise, categorical

Weight derivation:
  AHP eigenvector method with consistency ratio, rank-order weighting
  (ROC, rank sum, reciprocal of ranks)

Combination methods:
  WLC, WPM, OWA, fuzzy overlay (AND/OR/sum/product/gamma), boolean overlay

Validation:
  Constraint masking, one-at-a-time and Monte Carlo sensitivity analysis

All operations are element-wise or reductions across layers, so they work
on numpy, cupy, dask+numpy, and dask+cupy without ArrayTypeFunctionMapping
dispatch. No new dependencies.

148 tests covering correctness, edge cases (degenerate triangles, inf/NaN
propagation, single-criterion datasets, AHP validation, dask graph safety,
weight boundary clamping, MC reproducibility), and a full end-to-end
suitability workflow.

Includes docs reference page, README feature matrix section, and user
guide notebook (35_MCDA.ipynb).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MCDA module for spatial multi-criteria decision analysis

1 participant