Title: | Stochastic Multi-Criteria Acceptability Analysis |
---|---|
Description: | Implementation of the Stochastic Multi-Criteria Acceptability Analysis (SMAA) family of Multiple Criteria Decision Analysis (MCDA) methods. Tervonen, T. and Figueira, J. R. (2008) <doi:10.1002/mcda.407>. |
Authors: | Gert van Valkenhoef [aut, cre, cph] |
Maintainer: | Gert van Valkenhoef <[email protected]> |
License: | GPL-3 |
Version: | 0.3-3 |
Built: | 2024-11-07 06:15:15 UTC |
Source: | CRAN |
This R package implements the Stochastic Multi-criteria Acceptability Analysis (SMAA) family of methods for stochastic Multiple Criteria Decision Analysis (MCDA). In SMAA methods, uncertainty in criteria measurements and incomplete information on the weights are accounted for by Monte Carlo integration of probability distributions.
The smaa
function implements the core Monte Carlo integration method. It calculates
the SMAA decision metrics (rank acceptabilities and central weights) in one go.
Alternatively, the smaa.values
, smaa.ranks
, smaa.ra
, and
smaa.cw
perform the individual steps. Note that smaa
is slightly more
efficient because it does not store the alternatives' values or rankings.
The hitandrun-package is complementary to this package in that it provides methods for sampling weights when incomplete preference information is available in the form of linear constraints on the weight vector.
Gert van Valkenhoef
T. Tervonen and J.R. Figueira (2008), A survey on stochastic multicriteria acceptability analysis methods, Journal of Multi-Criteria Decision Analysis 15(1-2):1-14. [doi:10.1002/mcda.407]
T. Tervonen, G. van Valkenhoef, N. Basturk, and D. Postmus (2012), Hit-And-Run enables efficient weight generation for simulation-based multiple criteria decision analysis, European Journal of Operational Research 224(3):552-559. [doi:10.1016/j.ejor.2012.08.026]
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate SMAA metrics (one-stage) result <- smaa(meas, pref) print(result) # Calculate SMAA metrics (multi-stage) values <- smaa.values(meas, pref) summary(values) ranks <- smaa.ranks(values) smaa.ra(ranks) smaa.entropy.ranking(ranks) smaa.cw(ranks, pref) # Calculate confidence factors smaa.cf(meas, result$cw)
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate SMAA metrics (one-stage) result <- smaa(meas, pref) print(result) # Calculate SMAA metrics (multi-stage) values <- smaa.values(meas, pref) summary(values) ranks <- smaa.ranks(values) smaa.ra(ranks) smaa.entropy.ranking(ranks) smaa.cw(ranks, pref) # Calculate confidence factors smaa.cf(meas, result$cw)
Calculate SMAA decision indices based on a set of samples from the criteria values distribution and a set of samples from the feasible weight space.
smaa(meas, pref)
smaa(meas, pref)
meas |
Criteria measurements. An |
pref |
Weights. An |
The one-stage method does not store the alternatives' values or the raw rankings. Instead, only standard summary metrics are provided.
ra |
Rank acceptabilities (see |
cw |
Central weights (see |
Gert van Valkenhoef
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) # Read weights from file pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Alternatively, sample weights using hitandrun: # library(hitandrun) # pref <- simplex.sample(n, N)$samples # Calculate SMAA metrics result <- smaa(meas, pref) print(result) plot(result) result <- smaa(meas, c(0.5, 0.2, 0.3)) print(result)
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) # Read weights from file pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Alternatively, sample weights using hitandrun: # library(hitandrun) # pref <- simplex.sample(n, N)$samples # Calculate SMAA metrics result <- smaa(meas, pref) print(result) plot(result) result <- smaa(meas, c(0.5, 0.2, 0.3)) print(result)
Calculate SMAA confidence factors of the central weights.
smaa.cf(meas, cw)
smaa.cf(meas, cw)
meas |
Criteria measurements. An |
cw |
An |
The confidence factor for an alternative is its first-rank acceptability under its central weight.
An object of class smaa.cf
, with the following elements:
cf |
A vector of confidence factors, one for each alternative. |
cw |
The central weights (see |
The number of SMAA iterations is stored in attr(x, "smaa.N")
.
Gert van Valkenhoef
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate central weights values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) cw <- smaa.cw(ranks, pref) print(cw) cf <- smaa.cf(meas, cw) print(cf) plot(cf)
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate central weights values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) cw <- smaa.cw(ranks, pref) print(cw) cf <- smaa.cf(meas, cw) print(cf) plot(cf)
Calculate SMAA central weights from sampled rankings and the corresponding weights.
smaa.cw(ranks, pref)
smaa.cw(ranks, pref)
ranks |
An |
pref |
An |
An matrix of central weights, where each row corresponds to an
alternative and each column to a criterion.
The number of SMAA iterations is stored in
attr(x, "smaa.N")
.
The value is given class smaa.cw
, use unclass(x)
to treat it as a regular matrix.
Gert van Valkenhoef
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate central weights values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) cw <- smaa.cw(ranks, pref) print(cw) plot(cw)
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate central weights values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) cw <- smaa.cw(ranks, pref) print(cw) plot(cw)
Calculate decision entropy from the sampled SMAA rankings. For both ranking and choice problematics.
smaa.entropy.ranking(ranks, p0 = 1) smaa.entropy.choice(ra, p0 = 1)
smaa.entropy.ranking(ranks, p0 = 1) smaa.entropy.choice(ra, p0 = 1)
ranks |
Object of class |
ra |
Object of class |
p0 |
Baseline probability for the entropy calculation. |
Calculates the entropy for the given problematic, quantifying either the uncertainty in the ranking
of the alternatives (where the outcome space consists of the
possible
rankings) or in the choice of the best alternative (where the outcome space
consists of
the
alternatives). The entropy is given by:
where is the space of feasible weights.
Since the SMAA analysis samples from the outcome space, the
can be estimated
directly from the given sample.
The entropy (a single numeric value).
The number of samples needed to accurately estimate for the ranking problematic
is currently unknown.
Gert van Valkenhoef
G. van Valkenhoef and T. Tervonen, Optimal weight constraint elicitation for additive multi-attribute utility models, presentation at EURO 2013, July 2013, Rome, Italy.
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate ranks values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) # Calculate ranking entropy smaa.entropy.ranking(ranks) # Calculate choice entropy # (equal to ranking entropy because there are only two alternatives) smaa.entropy.choice(ranks) smaa.entropy.choice(smaa.ra(ranks))
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate ranks values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) # Calculate ranking entropy smaa.entropy.ranking(ranks) # Calculate choice entropy # (equal to ranking entropy because there are only two alternatives) smaa.entropy.choice(ranks) smaa.entropy.choice(smaa.ra(ranks))
Given a set of reference levels and their values, compute a linearly interpolated (piece-wise linear) partial value function.
smaa.pvf(x, cutoffs, values, outOfBounds="error")
smaa.pvf(x, cutoffs, values, outOfBounds="error")
x |
Values to compute the PVF for, a numeric vector |
cutoffs |
Reference levels (ascending order) |
values |
Values of the reference levels |
outOfBounds |
What to do when some of the |
A numeric vector the same length as x
.
The values are computed by linear interpolation between the values of the two closest reference levels. This has been implemented in C for a dramatic performance improvement.
Gert van Valkenhoef
x <- c(50, 90, 100, 10, 40, 101, 120) values <- smaa.pvf(x, cutoffs=c(50, 75, 90, 100), values=c(1, 0.8, 0.5, 0), outOfBounds="clip") stopifnot(all.equal(values, c(1.0, 0.5, 0.0, 1.0, 1.0, 0.0, 0.0)))
x <- c(50, 90, 100, 10, 40, 101, 120) values <- smaa.pvf(x, cutoffs=c(50, 75, 90, 100), values=c(1, 0.8, 0.5, 0), outOfBounds="clip") stopifnot(all.equal(values, c(1.0, 0.5, 0.0, 1.0, 1.0, 0.0, 0.0)))
Calculate SMAA pair-wise winning indices from sampled rankings.
smaa.pwi(ranks)
smaa.pwi(ranks)
ranks |
An |
An matrix of pair-wise winning indices. The
index at (i, j) describes the share of samples for which alternative i
has a better (lower) rank than alternative j.
Tommi Tervonen
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate pair-wise winning indices values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) pwi <- smaa.pwi(ranks) print(pwi)
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate pair-wise winning indices values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) pwi <- smaa.pwi(ranks) print(pwi)
Calculate SMAA rank acceptabilities from sampled rankings.
smaa.ra(ranks)
smaa.ra(ranks)
ranks |
An |
An matrix of rank probabilities, where each row corresponds to an
alternative.
The number of SMAA iterations is stored in
attr(x, "smaa.N")
.
The value is given class smaa.ra
, use unclass(x)
to treat it as a regular matrix.
Gert van Valkenhoef
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate rank acceptabilities values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) ra <- smaa.ra(ranks) print(ra) plot(ra)
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate rank acceptabilities values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) ra <- smaa.ra(ranks) print(ra) plot(ra)
Calculate SMAA ranks based on the sampled alternatives' values.
smaa.ranks(values)
smaa.ranks(values)
values |
An |
An array of ranks obtained by each alternative in each iteration.
The value is given class smaa.ranks
, use unclass(x)
to treat it as a regular matrix.
Gert van Valkenhoef
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate alternative ranks values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) summary(ranks) ranks.expected <- dget(system.file("extdata/thrombo-ranks-nopref.txt.gz", package="smaa")) stopifnot(all.equal(ranks, ranks.expected))
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Calculate alternative ranks values <- smaa.values(meas, pref) ranks <- smaa.ranks(values) summary(ranks) ranks.expected <- dget(system.file("extdata/thrombo-ranks-nopref.txt.gz", package="smaa")) stopifnot(all.equal(ranks, ranks.expected))
Calculate the alternative values based on a set of samples from the criteria values distribution and a set of samples from the feasible weight space.
smaa.values(meas, pref)
smaa.values(meas, pref)
meas |
Criteria measurements. An |
pref |
Weights. An |
An array of alternative values.
Gert van Valkenhoef
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) # Read weights from file pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Alternatively, sample weights using hitandrun: # library(hitandrun) # pref <- simplex.sample(n, N)$samples # Calculate alternative values values <- smaa.values(meas, pref) summary(values) plot(values) values.expected <- dget(system.file("extdata/thrombo-values-nopref.txt.gz", package="smaa")) stopifnot(all.equal(values, values.expected))
N <- 1E4; m <- 2; n <- 3 meas <- dget(system.file("extdata/thrombo-meas.txt.gz", package="smaa")) # Read weights from file pref <- dget(system.file("extdata/thrombo-weights-nopref.txt.gz", package="smaa")) # Alternatively, sample weights using hitandrun: # library(hitandrun) # pref <- simplex.sample(n, N)$samples # Calculate alternative values values <- smaa.values(meas, pref) summary(values) plot(values) values.expected <- dget(system.file("extdata/thrombo-values-nopref.txt.gz", package="smaa")) stopifnot(all.equal(values, values.expected))