FuzzyAHP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Package ‘FuzzyAHP’

October 12, 2022


Type Package
Title (Fuzzy) AHP Calculation
Version 0.9.5
Date 2019-12-06

URL http://github.com/JanCaha/FuzzyAHP/
Description Calculation of AHP (Analytic Hierarchy Process -
<http://en.wikipedia.org/wiki/Analytic_hierarchy_process>)
with classic and fuzzy weights based on Saaty's pairwise
comparison method for determination of weights.
Encoding UTF-8
Depends R (>= 3.0.0), methods, MASS
Suggests knitr, testthat
License LGPL (>= 3)
LazyData TRUE
VignetteBuilder knitr
RoxygenNote 7.0.1
Collate 'class-FuzzyData.R' 'class-PairwiseComparisonMatrix.R'
'class-FuzzyPairwiseComparisonMatrix.R' 'class-FuzzyWeights.R'
'class-Weights.R' 'function-bindFuzzyData.R'
'function-buildFuzzyPairwiseComparisonMatrix.R'
'function-buildPairwiseComparisonMatrix.R'
'function-calculateAHP.R' 'function-calculateWeights.R'
'function-compare.R' 'function-consistencyIndex.R'
'function-consistencyRatio.R' 'function-defuzzify.R'
'function-getFuzzyNumbers.R' 'function-getFuzzyScale.R'
'function-insertInto.R' 'function-internal-optimization.R'
'function-internal-weights.R' 'function-print.R'
'function-strictConsistency.R' 'function-textRepresentation.R'
'function-weakConsistency.R' 'package-FuzzyAHP.R'
NeedsCompilation no
Author Jan Caha [aut, cre]

1
2 FuzzyAHP-package

Maintainer Jan Caha <cahik@atlas.cz>


Repository CRAN
Date/Publication 2019-12-06 16:40:02 UTC

R topics documented:
FuzzyAHP-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
bindColums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
buildFuzzyPairwiseComparisonMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
buildPairwiseComparisonMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
calculateAHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
calculateWeights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
calculateWeights_old_methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
calculate_weighting_vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
compareFuzzyNumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
compareResults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
consistencyIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
consistencyRatio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
defuzziffy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
fuzzyData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
FuzzyData-class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
fuzzyPairwiseComparisonMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
FuzzyPairwiseComparisonMatrix-class . . . . . . . . . . . . . . . . . . . . . . . . . . 14
fuzzyPairwiseComparisonMatrix1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
FuzzyWeights-class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
getFuzzyNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
getFuzzyScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
insertInto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
pairwiseComparisonMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
PairwiseComparisonMatrix-class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
strictConsistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
textRepresentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
weakConsistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Weights-class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Index 23

FuzzyAHP-package Package for calculation of classic and Fuzzy AHP


bindColums 3

Description

FuzzyAHP is an open source (LGPL 3) package for R. The package is only suitable for AHP that
uses categorical rating of criteria for alternatives instead of pairwise comparison of alternatives
according to each criteria. This adaptation of AHP is common in situations when the number of
alternatives is hight and the pairwise comparison is thus inadequate or impossible to construct.
The weights for criteria are, however, still determined from the pairwise comparison matrix. This
approach towards AHP is common in Geosciences as well as other fields.
The determination of criteria weights is done according to process described by Krejčí, Pavlačka,
and Talašová (2016), which yelds significantly narrower fuzzy numbers than previously used ap-
proaches.

Details

Please see vignettes for more details about the package and examples of use.
Complete list of classes and methods call help(package="FuzzyAHP").

Author(s)

Jan Caha <cahik@atlas.cz>, with contributions from Aneta Drážná

References

Krejčí, Jana, Ondřej Pavlačka, and Jana Talašová. 2016. “A fuzzy extension of Analytic Hierarchy
Process based on the constrained fuzzy arithmetic.” Fuzzy Optimization and Decision Making.
doi:10.1007/s10700-016-9241-0.

bindColums Function that binds two FuzzyData together into one FuzzyData

Description

This methods construct object FuzzyData based on two FuzzyData. The functions merges the
sources into single output. This method should be used in situations when both weights and input
data are fuzzy.

Usage

bindColums(data1, data2)

## S4 method for signature 'FuzzyData,FuzzyData'


bindColums(data1, data2)
4 buildPairwiseComparisonMatrix

Arguments
data1 An object of FuzzyData.
data2 An object of FuzzyData.

Value
An object of class FuzzyData

buildFuzzyPairwiseComparisonMatrix
Function that builds Fuzzy Pairwise Comparison Matrix based on list
of Pairwise Comparison Matrices

Description
This functions builds Fuzzy Pairwise Comparison Matrix based on list of Pairwise Comparison
Matrices the resulting Fuzzy Pairwise Comparison Matrix is calculated as minimum, geometric
mean and maximum of each cell of all Pairwise Comparison Matrices in listOfMatrices.

Usage
buildFuzzyPairwiseComparisonMatrix(listOfMatrices)

## S4 method for signature 'list'


buildFuzzyPairwiseComparisonMatrix(listOfMatrices)

Arguments
listOfMatrices An object of list.

Value
An object of class FuzzyPairwiseComparisonMatrix

buildPairwiseComparisonMatrix
Function that builds Pairwise Comparison Matrix based on list of
Pairwise Comparison Matrices

Description
This functions builds Pairwise Comparison Matrix based on list of Pairwise Comparison Matrices
the resulting Pairwise Comparison Matrix is calculated as geometric mean of all Pairwise Compar-
ison Matrices in listOfMatrices.
calculateAHP 5

Usage

buildPairwiseComparisonMatrix(listOfMatrices)

## S4 method for signature 'list'


buildPairwiseComparisonMatrix(listOfMatrices)

Arguments

listOfMatrices An object of list.

Value

An object of class PairwiseComparisonMatrix

calculateAHP Function to calculate result of AHP

Description

This function calculates output of AHP based on Weights or FuzzyWeights on data represented
either by matrix or FuzzyData.

Usage

calculateAHP(weights, data)

## S4 method for signature 'Weights,matrix'


calculateAHP(weights, data)

## S4 method for signature 'FuzzyWeights,matrix'


calculateAHP(weights, data)

## S4 method for signature 'FuzzyWeights,FuzzyData'


calculateAHP(weights, data)

## S4 method for signature 'PairwiseComparisonMatrix,matrix'


calculateAHP(weights, data)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix,matrix'


calculateAHP(weights, data)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix,FuzzyData'


calculateAHP(weights, data)
6 calculateWeights

Arguments
weights object of class Weights or FuzzyWeights. Alternatively objects of classes Pair-
wiseComparisonMatrix or FuzzyPairwiseComparisonMatrix can be passed to
directly calculate weights from these classes.
data matrix or FuzzyData with number of colums equal to number of rows in weights.

Value
Either a matrix (if Weights and matrix were used as inputs) or FuzzyData (if FuzzyWeights were
used).

calculateWeights Function to calculate fuzzy weights based on comparison matrix

Description
This functions calculates Weights or FuzzyWeights based on input pairwise comparison matrix.

Usage
calculateWeights(comparisonMatrix)

## S4 method for signature 'PairwiseComparisonMatrix'


calculateWeights(comparisonMatrix)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix'


calculateWeights(comparisonMatrix)

Arguments
comparisonMatrix
object of either PairwiseComparisonMatrix or FuzzyPairwiseComparisonMa-
trix

References
KREJČÍ, Jana, PAVLAČKA, Ondřej and TALAŠOVÁ, Jana, 2016, A fuzzy extension of Analytic
Hierarchy Process based on the constrained fuzzy arithmetic. Fuzzy Optimization and Decision
Making. 2016. DOI 10.1007/s10700-016-9241-0.

See Also
PairwiseComparisonMatrix-class
calculateWeights_old_methods 7

calculateWeights_old_methods
Function to calculate fuzzy weights based on comparison matrix using
older approaches

Description
This functions calculates FuzzyWeights based on input fuzzy pairwise comparison matrix.

Usage
calculateWeights_old_methods(comparisonMatrix, type = "Chang")

## S4 method for signature 'FuzzyPairwiseComparisonMatrix'


calculateWeights_old_methods(comparisonMatrix, type = "Chang")

Arguments
comparisonMatrix
object of FuzzyPairwiseComparisonMatrix
type A "character" representing type of method used for weights or fuzzy weights
determination. Currently implemented methods are "Chang", "Wang" and "Tesfamariam".
The default value is "Chang".

Value
FuzzyWeights. If fuzzy weighting vector is to be obtained please see calculate_weighting_vector
function.

References
CHANG, Da-Yong, 1996, Applications of the extent analysis method on fuzzy AHP. European Jour-
nal of Operational Research. 1996. Vol. 95, no. 3, p. 649–655. DOI 10.1016/0377-2217(95)00300-
2.
TESFAMARIAM, Solomon and SADIQ, Rehan, 2006, Risk-based environmental decision-making
using fuzzy analytic hierarchy process (F-AHP). Stochastic Environmental Research and Risk As-
sessment. 2006. Vol. 21, no. 1, p. 35–50. DOI 10.1007/s00477-006-0042-9.
WANG, Tien-Chin and CHEN, Yueh-Hsiang, 2008, Applying fuzzy linguistic preference relations
to the improvement of consistency of fuzzy AHP. Information Sciences [online]. October 2008.
Vol. 178, no. 19, p. 3755–3765. DOI 10.1016/j.ins.2008.05.028.

See Also
calculate_weighting_vector
8 compareFuzzyNumbers

calculate_weighting_vector
Function to calculate fuzzy weighting vector

Description
This functions calculates fuzzy weighting vector from FuzzyWeights. The calculation was first
described by Chang (1996).

Usage
calculate_weighting_vector(fuzzyWeights)

## S4 method for signature 'FuzzyWeights'


calculate_weighting_vector(fuzzyWeights)

Arguments
fuzzyWeights object of FuzzyWeights

Value
weighting vector for defined FuzzyWeights.

References
CHANG, Da-Yong, 1996, Applications of the extent analysis method on fuzzy AHP. European Jour-
nal of Operational Research. 1996. Vol. 95, no. 3, p. 649–655. DOI 10.1016/0377-2217(95)00300-
2.

compareFuzzyNumbers Function to mutually compare fuzzy data

Description
This function compares fuzzy data FuzzyData to identify the optimal (best) cases. The FuzzyData
can only contain one fuzzy number, otherwise the comparison is not possible. The calculation of
type "possibilityTheory" can be time consuming as it is based on comparing each fuzzy number
to a maximal fuzzy number obtained from the set of fuzzy numbers.

Usage
compareFuzzyNumbers(fuzzyData, type, progressBar = FALSE)

## S4 method for signature 'FuzzyData,character'


compareFuzzyNumbers(fuzzyData, type, progressBar = FALSE)
compareResults 9

Arguments

fuzzyData A FuzzyData
type A "character" representing type of comparison. Currently implemented meth-
ods are "Chen" and "possibilityTheory".
progressBar logical value indicating if textual progress bar should be printed (default value
FALSE)

Value

A "matrix" of numeric value in case of "Chen" method or a "matrix" with two values in case of
"possibilityTheory".

compareResults Function to rank results

Description

This function ranks data from the highest value to the lowest. Essentially it does (nrow(data)+1)
- rank(data, na.last ="keep", ties.method= "max").

Usage

compareResults(data)

## S4 method for signature 'matrix'


compareResults(data)

Arguments

data A matrix with one column. Usually an output of function calculateAHP.

Value

A "matrix" of numeric value that indicates ranking of each row, with the highest value ranked as
1.
10 consistencyRatio

consistencyIndex Function to determine Consistency Index

Description
This methods calculates Consistency index for PairwiseComparisonMatrix.

Usage
consistencyIndex(comparisonMatrix)

## S4 method for signature 'PairwiseComparisonMatrix'


consistencyIndex(comparisonMatrix)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix'


consistencyIndex(comparisonMatrix)

Arguments
comparisonMatrix
A PairwiseComparisonMatrix

Value
A numeric value of Consistency index.

consistencyRatio Function to determine Consistency Ratio

Description
This methods calculates Consistency Ratio for PairwiseComparisonMatrix. The consistency ratio
can only be provided for PairwiseComparisonMatrix with less than 10 rows. For bigger matrices
the value is not known.

Usage
consistencyRatio(comparisonMatrix, print.report = TRUE)

## S4 method for signature 'PairwiseComparisonMatrix'


consistencyRatio(comparisonMatrix, print.report = TRUE)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix'


consistencyRatio(comparisonMatrix, print.report = TRUE)
defuzziffy 11

Arguments
comparisonMatrix
A PairwiseComparisonMatrix
print.report Optional boolean parameter stating if short report should be printed along with
determination of Consistency Ratio. Default value is TRUE.

Details
Generally pairwise comparison matrixes are considered to be consistent if the value of Consistency
Ration is smaller than 0.1. For matrices comparing more then 10 elements then Consistency Ratio
is unsuitable, because the values of random index, that is necessary to obtain Consistency Ratio, are
only known for matrixes with size smaller than 10 × 10.

Value
A numeric value of Consistency Ratio, for PairwiseComparisonMatrix with more than 10 an error
is raised.

defuzziffy Function to defuzzify fuzzy data

Description
This function defuzzifies FuzzyData into single value. The FuzzyData can only contain one fuzzy
number, otherwise the defuzzification is not possible.

Usage
defuzziffy(fuzzyData, type = "mean")

## S4 method for signature 'FuzzyData'


defuzziffy(fuzzyData, type = "mean")

Arguments
fuzzyData A FuzzyData
type A "character" representing type of defuzzification. Currently implemented
methods are "Yager", "modalValue", "modalValueDominancy", "mean". The
default value is "mean".

Details
The triangular fuzzy numbers à represented as triplet [a1, a2, a3] are defuzzified using these meth-
ods: "Yager":

(a2 − a1)(a1 + 2/3(a2 − a1) + (a3 − a2)(a2 + 1/3(a3 − a2))


def (Ã) =
(a2 − a1) + (a3 − a2))
12 fuzzyData

"modalvalue":
def (Ã) = a2
"modalValueDominancy":
def (Ã) = (a1 + 4 ∗ a2 + a3)/6
"mean":
def (Ã) = (a1 + a2 + a3)/3
.

Value
A numeric value of defuzzified value, based on deffuzification method.

fuzzyData Function that creates FuzzyData

Description
This methods construct object FuzzyData based on provided matrix. The matrix needs to be
have rows represent individual fuzzy numbers and three colums that represent minimal, modal and
maximal value of fuzzy number.

Usage
fuzzyData(data, single.value = TRUE)

## S4 method for signature 'matrix'


fuzzyData(data, single.value = TRUE)

Arguments
data A matrix with 3 colums.
single.value An optional boolean parameter (default value TRUE) specifying if the data to
be turn into fuzzy data is single vector of fuzzy numbers (then it needs to have
3 colums) or if the whole matrix needs to be turn into fuzzy values.

Value
An object of class FuzzyData

See Also
FuzzyData
FuzzyData-class 13

FuzzyData-class Class "FuzzyData"

Description
An S4 class to represent fuzzy data.

Slots
fnMin A numeric vector of minimal values of fuzzy data.
fnModal A numeric vector of modal values of fuzzy data.
fnMax A numeric vector of maximal values of fuzzy data.

fuzzyPairwiseComparisonMatrix
Function that creates Fuzzy Pairwise Comparions Matrix

Description
This methods construct object FuzzyPairwiseComparisonMatrix based on provided PairwiseCom-
parisonMatrix and an optional fuzzy scale.

Usage
fuzzyPairwiseComparisonMatrix(pairwiseComparisonMatrix, fuzzyScale,
comparsionNotInScale, width)

## S4 method for signature 'PairwiseComparisonMatrix'


fuzzyPairwiseComparisonMatrix(
pairwiseComparisonMatrix,
fuzzyScale = getFuzzyScale(type = "full"),
comparsionNotInScale = FALSE,
width = 1
)

## S4 method for signature 'matrix'


fuzzyPairwiseComparisonMatrix(pairwiseComparisonMatrix)

Arguments
pairwiseComparisonMatrix
PairwiseComparisonMatrix or matrix.
fuzzyScale A numeric vector that definies fuzzy scale. Default scale is described in details.
Default value getFuzzyScale(type="full").
14 FuzzyPairwiseComparisonMatrix-class

comparsionNotInScale
A boolean variable. If TRUE the intensities not found in fuzzyScale are calcu-
lated with use of width parameter. Default value FALSE.
width A numeric parameter, specifying the width of calculated fuzzy intensity. If
comparsionNotInScale is FALSE then the parameter is not considered. Default
value 1.

Details

Parameter fuzzyScale is expected as a vector containing n*3 values that represent triangular fuzzy
numbers used as fuzzy intensity of importance (only the values equal or higher than 1, inverse values
are calculated automatically). The values need to be ordered by fuzzy values. Default value of this
parameter is as.double(c(1/2,1,2,1,2,3,2,3,4,3,4,5,4,5,6,5,6,7,6,7,8,7,8,9,8,9,9)).
Another possibility is eg. as.double(c(1/3,1,3,1,3,5,3,5,7,5,7,9,7,9,9))
If param pairwiseComparisonMatrix is matrix then it needs to be of character type. Each
element in the matrix must be specified as triplet "x;y;z", where x<=y<=z. From this matrix a
pairwise comparison is constructed from y values and x and z function as lower and upper limits of
y respectively. In this case the optional parameter fuzzyScale is not taken into account at all.

Value

Object of class FuzzyPairwiseComparisonMatrix

FuzzyPairwiseComparisonMatrix-class
Class "FuzzyPairwiseComparisonMatrix"

Description

An S4 class to represent a fuzzy pairwise comparison matrix.

Slots

fnMin A matrix of minimal values of fuzzy preferences.


fnModal A matrix of modal values of fuzzy preferences.
fnMax A matrix of maximal values of fuzzy preferences.
variableNames Names of variables in the pariwise comparison matrix obtained either as colnames
or rownames.
fuzzyPairwiseComparisonMatrix1 15

fuzzyPairwiseComparisonMatrix1
Function that creates Fuzzy Pairwise Comparions Matrix

Description

This methods construct object FuzzyPairwiseComparisonMatrix based on provided PairwiseCom-


parisonMatrix and two matrices that form lower an upper significant values of the PairwiseCompar-
isonMatrix that form middle significant value.

Usage

fuzzyPairwiseComparisonMatrix1(lowerValues, pairwiseComparisonMatrix, upperValues)

## S4 method for signature 'matrix,PairwiseComparisonMatrix,matrix'


fuzzyPairwiseComparisonMatrix1(
lowerValues,
pairwiseComparisonMatrix,
upperValues
)

Arguments

lowerValues A matrix of "double" that consists of lower significant values.


pairwiseComparisonMatrix
PairwiseComparisonMatrix that consists of middle significant values.
upperValues A matrix of "double" that consists of upper significant values.

Details

This function allows user to specify fuzzy pairwise comparison matrix that is not based on fuzzy
scale but rely more on user’s specification. The middle significant values have to be definied by
PairwiseComparisonMatrix to ensure some elementary properties. The significant values provided
to this function have to be correctly ordered and fuzzy numbers have to be reciprocal otherwise the
function fails.

Value

Object of class FuzzyPairwiseComparisonMatrix


16 getFuzzyNumber

FuzzyWeights-class Class "FuzzyWeights"

Description
An S4 class to represent fuzzy weights for fuzzy AHP calculation.

Slots
fnMin Object of class numeric containing minimal values of fuzzy weights.
fnModal Object of class numeric containing modal values of fuzzy weights.
fnMax Object of class numeric containing maximal values of fuzzy weights.

getFuzzyNumber Function to extract specific fuzzy numbers

Description
This methods helps with extracting fuzzy numbers from FuzzyData and FuzzyWeights.

Usage
getFuzzyNumber(object, index)

## S4 method for signature 'FuzzyData,integer'


getFuzzyNumber(object, index)

## S4 method for signature 'FuzzyWeights,integer'


getFuzzyNumber(object, index)

Arguments
object An object of class FuzzyData or FuzzyWeights
index An object of class integer that represents one or more indices to extract the
data from

Value
A matrix where rows are fuzzy numbers and columns are important values.
getFuzzyScale 17

getFuzzyScale Function to create Fuzzy Scale

Description
This methods creates fuzzy scale that are used while fuzzifying Piecewise comparison matrix.
Full scale is:

1/2 1 2
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
6 7 8
7 8 9
8 9 9

Basic scale is:

1/3 1 3
1 3 5
3 5 7
5 7 9
7 9 9

Usage

getFuzzyScale(type)

## S4 method for signature 'character'


getFuzzyScale(type)

Arguments

type An object of class character. Two values are possible "full" and "basic".

Value

A matrix representing the fuzzy scale.


18 insertInto

insertInto Function that inserts FuzzyData on specific column number in another


FuzzyData

Description

This methods construct object FuzzyData based on two FuzzyData and index. The functions
merges the sources into single output. It inserts data2 onto specific position (defined by index)
in data1.

Usage

insertInto(data1, data2, index)

## S4 method for signature 'FuzzyData,FuzzyData'


insertInto(data1, data2, index)

Arguments

data1 An object of FuzzyData - data to insert into.


data2 An object of FuzzyData - data that should be inserted.
index An integer specifying the column position on which data2 should be inserted.

Value

An object of class FuzzyData

Examples

values = (c(1,2,3,4,5,6,7,8,9))
values = matrix(values, nrow = 3, ncol = 3, byrow = TRUE)
fData = fuzzyData(values, single.value = FALSE)

v = (c(15,16,17))
v = matrix(v, nrow = 3, ncol = 1, byrow = TRUE)
fd = fuzzyData(v, single.value = FALSE)

fData = insertInto(fData, fd, 2)


pairwiseComparisonMatrix 19

pairwiseComparisonMatrix
Function that creates Pairwise Comparions Matrix

Description

This methods construct object PairwiseComparisonMatrix based on provided matrix. The matrix
needs to be square and reciprocal with the intensity of importance (comparisons). Since the version
0.6.9 the comparsions can be represented as either characters (e.g. "1", "9", "1/9") or numeric (e.g.
1, 9, 1/9) .

Usage

pairwiseComparisonMatrix(matrix)

## S4 method for signature 'matrix'


pairwiseComparisonMatrix(matrix)

Arguments

matrix A reciprocal square matrix with ones on the main diagonal.

Value

An object of class PairwiseComparisonMatrix

See Also

PairwiseComparisonMatrix

Examples

comparisonMatrixValues = c("1","9","5","1/9","1","1/3","1/5","3","1")
comparisonMatrix = matrix(comparisonMatrixValues, nrow = 3, ncol = 3, byrow = TRUE)
matrix = pairwiseComparisonMatrix(comparisonMatrix)

comparisonMatrixValues = c(1,9,5,1/9,1,1/3,1/5,3,1)
comparisonMatrix = matrix(comparisonMatrixValues, nrow = 3, ncol = 3, byrow = TRUE)
matrix = pairwiseComparisonMatrix(comparisonMatrix)
20 strictConsistency

PairwiseComparisonMatrix-class
Class "PairwiseComparisonMatrix"

Description
An S4 class to represent a pairwise comparison matrix.

Slots
valuesChar A pairwise comparison matrix based on Saaty’s method as characters.
values A pairwise comparison matrix based on Saaty’s method as numeric.
variableNames Names of variables in the pariwise comparison matrix obtained either as colnames
or rownames.

strictConsistency Function to assess strict consistency of Comparison Matrix

Description
Check if
aik = aij × ajk
applies for all i, j, k = 1, 2, . . . , n, where n is size of a.

Usage
strictConsistency(PairwiseComparisonMatrix, print.report = TRUE)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix'


strictConsistency(PairwiseComparisonMatrix, print.report = TRUE)

## S4 method for signature 'PairwiseComparisonMatrix'


strictConsistency(PairwiseComparisonMatrix, print.report = TRUE)

Arguments
PairwiseComparisonMatrix
A FuzzyPairwiseComparisonMatrix or PairwiseComparisonMatrix.
print.report Optional boolean parameter stating if short report should be printed along with
determination of Weak Consistency. Default value is TRUE.

Value
Boolean value indicating if Comparison Matrix passed the weak consistency test and a warning
message listing the problematic triplets if the matrix is not consisten.
textRepresentation 21

textRepresentation Function to create text representation of (Fuzzy) Pairwise comparison


matrix

Description
This methods creates text representation of Pairwise comparison matrices.

Usage
textRepresentation(x, whole = TRUE)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix'


textRepresentation(x, whole = TRUE)

## S4 method for signature 'PairwiseComparisonMatrix'


textRepresentation(x, whole = TRUE)

Arguments
x An object of class FuzzyPairwiseComparisonMatrix or PairwiseComparisonMatrix
whole A boolean object specifying if the whole matrix should be created or only its
upper half should be filled.

Value
A dataframe of character type.

weakConsistency Function to assess Weak Consistency of Comparison Matrix

Description
Check if for aij > 1, ajk > 1 applies that
aik >= max(aij , ajk )
for all i, j, k = 1, 2, . . . , n, where n is size of a.

Usage
weakConsistency(PairwiseComparisonMatrix, print.report = TRUE)

## S4 method for signature 'FuzzyPairwiseComparisonMatrix'


weakConsistency(PairwiseComparisonMatrix, print.report = TRUE)

## S4 method for signature 'PairwiseComparisonMatrix'


weakConsistency(PairwiseComparisonMatrix, print.report = TRUE)
22 Weights-class

Arguments
PairwiseComparisonMatrix
A FuzzyPairwiseComparisonMatrix or PairwiseComparisonMatrix.
print.report Optional boolean parameter stating if short report should be printed along with
determination of Weak Consistency. Default value is TRUE.

Value
Boolean value indicating if Comparison Matrix passed the weak consistency test and a warning
message listing the problematic triplets if the matrix is not consisten.

Weights-class Class "Weights"

Description
An S4 class representing weights for AHP calculation. Each value in numeric vector represents
one weight.

Slots
weights Object of class numeric containing weights.
Index

bindColums, 3 (calculateWeights_old_methods),
bindColums,FuzzyData,FuzzyData-method 7
(bindColums), 3 character-method
buildFuzzyPairwiseComparisonMatrix, 4 (calculateWeights_old_methods),
buildFuzzyPairwiseComparisonMatrix,list-method 7
(buildFuzzyPairwiseComparisonMatrix), compareFuzzyNumbers, 8
4 compareFuzzyNumbers,FuzzyData,character-method
buildPairwiseComparisonMatrix, 4 (compareFuzzyNumbers), 8
buildPairwiseComparisonMatrix,list-method compareResults, 9
(buildPairwiseComparisonMatrix), compareResults,FuzzyData,character-method
4 (compareResults), 9
compareResults,matrix-method
calculate_weighting_vector, 7, 8 (compareResults), 9
calculate_weighting_vector, consistencyIndex, 10
(calculate_weighting_vector), 8 consistencyIndex,FuzzyPairwiseComparisonMatrix-method
calculate_weighting_vector,FuzzyWeights-method (consistencyIndex), 10
(calculate_weighting_vector), 8 consistencyIndex,PairwiseComparisonMatrix-method
calculateAHP, 5 (consistencyIndex), 10
calculateAHP,FuzzyPairwiseComparisonMatrix,FuzzyData-method
consistencyRatio, 10
(calculateAHP), 5 consistencyRatio,FuzzyPairwiseComparisonMatrix-method
calculateAHP,FuzzyPairwiseComparisonMatrix,matrix-method
(consistencyRatio), 10
(calculateAHP), 5 consistencyRatio,PairwiseComparisonMatrix-method
calculateAHP,FuzzyWeights,FuzzyData-method (consistencyRatio), 10
(calculateAHP), 5
calculateAHP,FuzzyWeights,matrix-method defuzziffy, 11
(calculateAHP), 5 defuzziffy,FuzzyData,character-method
calculateAHP,PairwiseComparisonMatrix,matrix-method (defuzziffy), 11
(calculateAHP), 5 defuzziffy,FuzzyData-method
calculateAHP,Weights,matrix-method (defuzziffy), 11
(calculateAHP), 5
calculateWeights, 6 FuzzyAHP-package, 2
FuzzyData, 3–6, 8, 9, 11, 12, 16, 18
calculateWeights,FuzzyPairwiseComparisonMatrix-method
(calculateWeights), 6 fuzzyData, 12
fuzzyData,matrix-method (fuzzyData), 12
calculateWeights,PairwiseComparisonMatrix-method
(calculateWeights), 6 FuzzyData-class, 13
calculateWeights_old_methods, 7 FuzzyPairwiseComparisonMatrix, 4, 6, 7,
calculateWeights_old_methods, 13–15, 20–22
(calculateWeights_old_methods), fuzzyPairwiseComparisonMatrix, 13
7 fuzzyPairwiseComparisonMatrix,matrix-method
calculateWeights_old_methods,FuzzyPairwiseComparisonMatrix-method
(fuzzyPairwiseComparisonMatrix),

23
24 INDEX

13 strictConsistency, 20
strictConsistency,FuzzyPairwiseComparisonMatrix-method
fuzzyPairwiseComparisonMatrix,PairwiseComparisonMatrix
(fuzzyPairwiseComparisonMatrix), (strictConsistency), 20
13 strictConsistency,PairwiseComparisonMatrix-method
fuzzyPairwiseComparisonMatrix,PairwiseComparisonMatrix,fuzzyScale-method
(strictConsistency), 20
(fuzzyPairwiseComparisonMatrix),
13 textRepresentation, 21
textRepresentation,FuzzyPairwiseComparisonMatrix,logical-m
fuzzyPairwiseComparisonMatrix,PairwiseComparisonMatrix-method
(fuzzyPairwiseComparisonMatrix), (textRepresentation), 21
13 textRepresentation,FuzzyPairwiseComparisonMatrix-method
FuzzyPairwiseComparisonMatrix-class, (textRepresentation), 21
14 textRepresentation,PairwiseComparisonMatrix-method
FuzzyPairwiseComparisonMatrix-method, (textRepresentation), 21
(calculateWeights_old_methods),
7 weakConsistency, 21
fuzzyPairwiseComparisonMatrix1, 15 weakConsistency,FuzzyPairwiseComparisonMatrix-method
(weakConsistency), 21
fuzzyPairwiseComparisonMatrix1,matrix,PairwiseComparisonMatrix,matrix-method
(fuzzyPairwiseComparisonMatrix1), weakConsistency,PairwiseComparisonMatrix-method
15 (weakConsistency), 21
FuzzyWeights, 5–8, 16 Weights, 5, 6
FuzzyWeights-class, 16 Weights-class, 22
FuzzyWeights-method
(calculate_weighting_vector), 8

getFuzzyNumber, 16
getFuzzyNumber,FuzzyData,integer-method
(getFuzzyNumber), 16
getFuzzyNumber,FuzzyWeights,integer-method
(getFuzzyNumber), 16
getFuzzyScale, 17
getFuzzyScale,character-method
(getFuzzyScale), 17

insertInto, 18
insertInto,FuzzyData,FuzzyData,integer-method
(insertInto), 18
insertInto,FuzzyData,FuzzyData-method
(insertInto), 18

list, 4, 5

PairwiseComparisonMatrix, 5, 6, 10, 11, 13,


15, 19–22
pairwiseComparisonMatrix, 19
PairwiseComparisonMatrix,logical-method
(textRepresentation), 21
pairwiseComparisonMatrix,matrix-method
(pairwiseComparisonMatrix), 19
PairwiseComparisonMatrix-class, 6, 20

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy