Learn R Programming

socialranking (version 1.2.0)

cumulativeScores: Cumulative scores

Description

Calculate cumulative score vectors for each element.

Usage

cumulativeScores(powerRelation, elements = powerRelation$elements)

cumulativelyDominates(powerRelation, e1, e2, strictly = FALSE)

Value

Score function returns a list of type CumulativeScores and length of powerRelation$elements

(unless parameter elements is specified). Each index contains a vector of length powerRelation$eqs, cumulatively counting up the number of times the given element appears in each equivalence class.

cumulativelyDominates() returns TRUE if e1 cumulatively dominates e2, else FALSE.

Arguments

powerRelation

A PowerRelation object created by PowerRelation() or as.PowerRelation()

elements

Vector of elements of which to calculate their scores. By default, the scores of all elements in powerRelation$elements are considered.

e1, e2

Elements in powerRelation$elements

strictly

If TRUE, check if p1 strictly dominates p2

Dominance

\(i\) dominates \(j\) if, for each index \(x, \textrm{Score}(i)_x \geq \textrm{Score}(j)_x\).

\(i\) strictly dominates \(j\) if there exists an \(x\) such that \(\textrm{Score}(i)_x > \textrm{Score}(j)_x\).

Details

An element's cumulative score vector is calculated by cumulatively adding up the amount of times it appears in each equivalence class in the powerRelation. I.e., in a linear power relation with eight coalitions, if element 1 appears in coalitions placed at 1, 3, and 6, its score vector is [1, 1, 2, 2, 2, 3, 3, 3].

References

2015Cumulativesocialranking

2017axiomaticAndAlgorithmicPerspectivessocialranking

See Also

Other ranking solution functions: L1Scores(), L2Scores(), LPSScores(), LPScores(), copelandScores(), kramerSimpsonScores(), lexcelScores(), ordinalBanzhafScores()

Examples

Run this code
pr <- as.PowerRelation("12 > 1 > 2")

# `1`: c(1, 2, 2)
# `2`: c(1, 1, 2)
cumulativeScores(pr)

# calculate for selected number of elements
cumulativeScores(pr, c(2))

# TRUE
d1 <- cumulativelyDominates(pr, 1, 2)

# TRUE
d2 <- cumulativelyDominates(pr, 1, 1)

# FALSE
d3 <- cumulativelyDominates(pr, 1, 1, strictly = TRUE)

stopifnot(all(d1, d2, !d3))

Run the code above in your browser using DataLab