library(ggplot2) library(madmR)
The general format for any decision matrix is N rows by D columns. Decision analysts almost always exempt row 1 as the row to enforce attribute weighting, so this is also enforced in read.data.matrix() function. Additionally, enforcing columns as benefits or costs is paramount in decision analysis, so this is also brutally enforced in the read function; I.e., any attributes which do not contain the word 'cost' in them will be treated as benefit.
#maut_dm <- read.data.matrix("Data/maut_validate_benefits.csv", header=TRUE) #topsis_dm <- read.data.matrix("Data/topsis_validate_benefits.csv", header=TRUE)
data(maut_dm) data(topsis_dm)
topsisResults <- TOPSIS(topsis_dm) #version 0.0.0.1000 has no additional parameters topsisResults$Results
mautResults <- MAUT(maut_dm) mautResults$Results
Since we know there are no additional parameters for the topsis function, we can run it without concerning ourselves with the algParams. This will only be applicable to the MAUT algorithm.
FinalDB <- sensitivity(data=maut_dm) FinalDB$Results # Output from all the runs head(FinalDB$EdgeCasesResults) # Show all of the cases in Final_DB$Results which rank changed
TOPSIS
dm <- TOPSIS(topsis_dm) head(dm)
MAUT
dm <- MAUT(maut_dm, scales=c("linear","linear","exponential") #default to all linear ) head(dm)
Sensitivity
# All attributes, specific step size, only 1 algorithm, algorithm specified parameters FinalDB <- sensitivity(data=topsis_dm, step=0.1, algs="MAUT", algParams=list(MAUT=list(scales=list("linear", "linear", "linear", "exponential", "exponential", "exponential", "linear"))) ) FinalDB$Plot
Specific attributes, specific step size, algorithm specific parameters
FinalDB <- sensitivity(data=maut_dm, attr=c("Sq.Foot","Preference"), step=0.01, algParams=list(MAUT=list(scales=list("linear", "linear", "exponential"))) ) FinalDB$Plot
Single attribute, specific step size, specific algorithms, specific window to study that attribute on.
FinalDB <- sensitivity(data=maut_dm, attr="Sq.Foot", algs=c("TOPSIS", "MAUT"), step=0.01, window=c(0.1,0.5) ) FinalDB$Plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.