Core Functionality

library(ggplot2)
library(madmR)

Reading in data matrices

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)

Read in data

data(maut_dm)
data(topsis_dm)

Run TOPSIS

topsisResults <- TOPSIS(topsis_dm) #version 0.0.0.1000 has no additional parameters
topsisResults$Results

Run MAUT

mautResults <- MAUT(maut_dm)
mautResults$Results

Examine sensitivity data

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

More examples

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


conradbm/madmR documentation built on May 28, 2019, 4:35 p.m.