Calculate cumulative score vectors for each element.

## Usage

cumulativeScores(powerRelation, elements = NULL)

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

## Arguments

powerRelation

A PowerRelation object created by newPowerRelation()

elements

vector of elements of which to calculate their scores. If elements == NULL, create vectors for all elements in pr$elements e1, e2 Elements in powerRelation$elements

strictly

If TRUE, check if p1 strictly dominates p2

## 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$equivalenceClasses, cumulatively counting up the number of times the given element appears in each equivalence class.

cumulativelyDominates() returns TRUE if e1 cumulatively dominates e2.

## 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. E.g. 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].

## Dominance

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

$$i$$ strictly dominates $$j$$, if additionally $$\textrm{Score}(i) \neq \textrm{Score}(j)$$.

## References

Moretti S (2015). “An axiomatic approach to social ranking under coalitional power relations.” Homo Oeconomicus, 32(2), 183--208.

Moretti S, Öztürk M (2017). “Some axiomatic and algorithmic perspectives on the social ranking problem.” In International Conference on Algorithmic Decision Theory, 166--181. Springer.

Other score vector functions: copelandScores(), kramerSimpsonScores(), lexcelScores(), ordinalBanzhafScores()

## Examples

pr <- newPowerRelationFromString("12 > 1 > 2", asWhat = as.numeric)

# 1: c(1, 2, 2)
# 2: c(1, 1, 2)
cumulativeScores(pr)
#> $1 #> [1] 1 2 2 #> #>$2
#> [1] 1 1 2
#>
#> attr(,"class")
#> [1] "CumulativeScores"

# calculate for selected number of elements
cumulativeScores(pr, c(2))
#> \$2
#> [1] 1 1 2
#>
#> attr(,"class")
#> [1] "CumulativeScores"

# 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))