The AHPtools package facilitates the construction, analysis, and evaluation of Analytic Hierarchy Process (AHP) structures, particularly using pairwise comparison matrices.
This vignette provides an overview of the package, its key functions, and links to more detailed vignettes.
Creates a Pairwise Comparison Matrix of order n for Analytic Hierarchy Process from a vector of length \(\binom{n}{2}\) comparison ratios
createPCM(vec)
where
A Pairwise Comparison Matrix corresponding to the upper triangular elements
Generates simulated logical Pairwise Comparison Matrix for the Analytic Hierarchy Process such as would be created by a rational decision maker based on a relative vector of preferences for the alternatives involved.
Choices of the pairwise comparison ratios are from the Fundamental Scale and simulate a reasonable degree of error. The algorithm is modified from a paper by Bose, A [2022],
createLogicalPCM(ord, prefVec=rep(NA,ord))
where
Computes the Saaty CR Consistency of a PCM
CR((PCM,typePCM=TRUE)
where
A list of 3 elements,
Improves the CR consistency of a PCM.
For an input pairwise comparison matrix, PCM that is inconsistent, this function returns a consistent PCM if possible, with the relative preference for its alternatives as close as possible to the original preferences, as in the principal right eigenvector
improveCR((PCM,typePCM=TRUE)
where
A list of 4 elements,
Computes a sensitivity measure for an input pairwise comparison matrix, PCM.
Sensitivity is measured by Monte Carlo simulation of 500 PCMs which are perturbations of the input PCM. The perturbation algorithm makes a random choice from one of the 5 closest items in the Fundamental Scale {1/9, 1/8, ….. 1/2, 1, 2, ….. 8, 9} for each element in the PCM, ensuring the the pairwise reciprocity is maintained. The sensitivity measure is the average Spearman’s rank correlation of the vector of ranks of the principal eigenvectors of (i) the input PCM and (ii) the perturbed PCM. The average of the 500 such rank correlations is reported as the measure of sensitivity.
sensitivity(PCM,typePCM=TRUE,granularityLow=TRUE)
where
The average Spearman’s rank correlation between the principal eigenvectors of the input and 500 perturbed ‘PCMs’
This function returns the revised consistency classification for a PCM, evaluated by comparison with the threshold of consistency for intentional PCMs in the same preference heterogeneity quartile. The measure for inconsistency is the geometric mean of ratios in comparison with the corresponding benchmark PCM.
revisedConsistency(PCM,typePCM=TRUE)
where
A list of four elements,
Finds the consistency of a PCM, a probabibility value based on a logit model, from triads based Preference Reversals for the input PCM
consEval(pcm)
where
A list of four elements,
Builds a hierarchical tree from a flat AHP representation.
viewTree(ahp)
where
A data tree object that can be viewed as a parent - child hierarchy
Compute weights for Alternatives and lowest level sub criteria in AHP responses
AHPweights(ExcelPath, AHPsheet, PCMsheet)
where
A list of two items,