Run sensitivity analysis
sdm_run_sensitivity.RdVaries one objective's weight for a stakeholder group and returns how satisfaction scores change. Identifies tipping points where the top-ranked alternative changes. Use this to test whether the ranking is robust or fragile.
Usage
sdm_run_sensitivity(
scenario,
group,
objective,
weight_seq = seq(0, 1, by = 0.05),
dry_run = FALSE,
verbosity = 0
)Arguments
- scenario
An
sdm_scenario()object.- group
Character. Generic key of the stakeholder group (e.g.,
"group_1").- objective
Character. Generic key of the objective to vary (e.g.,
"obj_1").- weight_seq
Numeric vector. Weight values to evaluate, typically
seq(0, 1, by = 0.05).- dry_run
Logical. If TRUE, return the request without sending.
- verbosity
Integer. Verbosity level (0 = silent).
Value
A data frame with columns:
weightThe weight value being tested.
- One column per alternative
Satisfaction scores (0–100) at each weight, named after the alternative.
top_alternativeName of the highest-scoring alternative at that weight.
tipping_pointLogical.
TRUEif the top alternative changed from the previous weight step. Tipping points close to the current weight indicate a fragile ranking.
Details
When the focal objective's weight is set to w, the remaining
weights are rescaled proportionally so the total still sums to
1.0. The relative proportions among the other objectives stay
the same.
Examples
if (FALSE) { # \dontrun{
sens <- sdm_run_sensitivity(
scenario = scn,
group = "group_1",
objective = "obj_1",
weight_seq = seq(0, 1, by = 0.05)
)
# Find tipping points
sens[sens$tipping_point, ]
} # }