Test how far a decision ranking moves when the weights are perturbed
Source:R/decision_sensitivity.R
sframe_sensitivity_analysis.RdPerturbs each criterion weight up and down by delta, renormalises the
weight vector to sum to 1, reruns the same ranking method, and compares
the perturbed ranking against the base ranking. A ranking that survives
this unchanged is one a reviewer can be told is robust to the weights. A
ranking whose leader changes under a 5 percent nudge is not.
Usage
sframe_sensitivity_analysis(
x,
weights,
criteria_types,
method = "topsis",
delta = 0.05,
alternatives = NULL,
criteria = NULL,
...
)Arguments
- x
Numeric performance matrix, alternatives in rows and criteria in columns.
- weights
Numeric weight vector, one per criterion. Renormalised to sum to 1 before use. Unnamed weights are taken in the order of the criteria. Named weights are matched to the criteria by name, in any order, and a name that is not a criterion, or a criterion with no weight, is an error.
- criteria_types
Character vector of
"benefit"or"cost", one per criterion.- method
Ranking method. One of
"topsis","vikor","moora","smart","waspas","promethee", or"electre".- delta
Perturbation size as a proportion of the weight, default
0.05. A weight of 0.40 withdelta = 0.05is tested at 0.42 and 0.38 before renormalisation.- alternatives
Optional labels for the rows of
x.- criteria
Optional labels for the columns of
x.- ...
Passed to the underlying method, for example
vfor VIKOR orlambdafor WASPAS.
Value
An object of class sframe_sensitivity, a list with $table (one
row per criterion and direction, carrying criterion, direction,
rho, rank_changed, and top_changed), $base_ranks, $method,
$delta, $stable, $degenerate, $n_perturbations, $n_effective
and $n_failed. $stable is TRUE when at least one perturbation moved
the weights and none of those that did changed the ranking. A
perturbation that leaves the renormalised weights unchanged, as every one
does for weights such as c(1, 0), is not effective and tests nothing.
$degenerate marks a base ranking that places every alternative at the
same rank, which no perturbation can move.
Examples
x <- matrix(c(4.1, 3.0, 210, 3.6, 4.5, 180, 4.8, 2.5, 260),
nrow = 3, byrow = TRUE)
sa <- sframe_sensitivity_analysis(
x,
weights = c(0.4, 0.3, 0.3),
criteria_types = c("benefit", "benefit", "cost"),
method = "topsis",
alternatives = c("Alpha", "Basilica", "Coral"),
criteria = c("service", "location", "price")
)
sa$stable
as.data.frame(sa)