p.mcdm.weight derives criterion weights from a user-supplied AHP pairwise comparison matrix (Saaty 1977), validates the consistency ratio, and writes results to a JSON file for use by p.mcdm.score and p.rank.
Pairwise matrix A: n×n where A[i,j] = importance of criterion i relative to j on the 1–9 Saaty scale.
Normalise: divide each element by its column sum; weight vector w is the row mean of the normalised matrix.
Principal eigenvalue λmax = mean of (Aw)ᵢ / wᵢ over all i.
Consistency Index (Liu et al. 2023, Eq. 9):
CI = (λmax − n) / (n − 1)
Consistency Ratio (Liu et al. 2023, Eq. 10):
CR = CI / RI(n)
Random Index RI: 0, 0, 0.58, 0.90, 1.12, 1.24, 1.32, 1.41, 1.45, 1.49 for n = 1…10 (Saaty 1977).
CR ≤ 0.10 is required; otherwise the matrix must be revised.
| Parameter | Default | Description |
|---|---|---|
pairwise |
required | CSV file with n×n pairwise comparison matrix |
criteria |
required | Comma-separated criterion names (matching matrix order) |
output |
weights.json |
Output JSON with weights and consistency metrics |
| Flag | Description |
|---|---|
-v |
Verbose — print eigenvector, λmax, CI, CR to console |
JSON file with keys: criteria, weights, lambda_max, CI, CR,
consistent.
cat > pcm.csv << 'EOF'
1, 3, 5
1/3, 1, 3
1/5, 1/3, 1
EOF
p.mcdm.weight pairwise=pcm.csv \
criteria=slope,illumination,earth_vis \
output=weights.json -v
A consistency ratio (CR) > 0.10 indicates the pairwise comparisons are internally inconsistent. The module prints a warning but still writes the weights; review and revise the matrix before using the weights in p.mcdm.score. The AHP pairwise matrix is supplied as a CSV file with one n×n row per line, no header.
p.mcdm.score, p.terrain.ellipse
Yann Chemin
Available at: p.mcdm.weight source code (history)
Accessed: Sunday Nov 15 11:06:02 2026
Main index | Paint index | Topics index | Keywords index | Graphical index | Full index
© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual