# Kramer-Simpson-like method

`kramerSimpsonScores.Rd`

Calculate the Kramer-Simpson-like scores. Lower scores are better.

`kramerSimpsonRanking`

returns the corresponding ranking.

## Usage

```
kramerSimpsonScores(powerRelation, elements = NULL, compIvsI = FALSE)
kramerSimpsonRanking(powerRelation, compIvsI = 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`

- compIvsI
If

`TRUE`

, include CP-Majority comparison \(d_{ii}(\succeq)\), or, the CP-Majority comparison score of an element against itself, which is always 0.

## Value

Score function returns a list of type `KramerSimpsonScores`

and length of `powerRelation$elements`

(unless parameter `elements`

is specified). Lower scoring elements are ranked higher.

Ranking function returns corresponding `SocialRankingSolution`

object.

## Details

Inspired by the Kramer-Simpson method of social choice theory (Simpson 1969)
(Kramer 1975)
, the *Kramer-Simpson-like*
method compares each element against all other elements using the CP-Majority rule.

For a given element \(i\) calculate the `cpMajorityComparisonScore`

against all elements \(j\), \(d_{ji}(\succeq)\) (notice that \(i\) and
\(j\) are in reverse order).
\(\max_{j \in N \setminus \lbrace i \rbrace}(d_{ji}(\succeq))\) then
determines the final score, where lower scoring elements are ranked higher.

## Note

By default this function does not compare \(d_{ii}(\succeq)\). In other terms, the score of every element is the maximum CP-Majority comparison score against all other elements.

This is slightly different from definitions found in (Allouche et al. 2020) . Since by definition \(d_{ii}(\succeq) = 0\) always holds, the Kramer-Simpson scores in those cases will never be negative, possibly discarding valuable information.

For this reason `kramerSimpsonScores`

and `kramerSimpsonRanking`

includes a
`compIvsI`

parameter that can be set to `TRUE`

if one wishes for \(d_{ii}(\succeq) = 0\)
to be included in the comparisons. Put into mathematical terms, if:

`compIvsI` | Score definition |

`FALSE` | \(\max_{j \in N \setminus \lbrace i \rbrace}(d_{ji}(\succeq))\) |

`TRUE` | \(\max_{j \in N}(d_{ji}(\succeq))\) |

## References

Allouche T, Escoffier B, Moretti S, Öztürk M (2020).
“Social Ranking Manipulability for the CP-Majority, Banzhaf and Lexicographic Excellence Solutions.”
In Bessiere C (ed.), *Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20*, 17--23.
doi:10.24963/ijcai.2020/3
, Main track.

Simpson PB (1969).
“On defining areas of voter choice: Professor Tullock on stable voting.”
*The Quarterly Journal of Economics*, **83**(3), 478--490.

Kramer GH (1975).
“A dynamical model of political equilibrium.”
*Journal of Economic Theory*, **16**(2), 310--334.

## See also

Other CP-majority based functions:
`copelandScores()`

,
`cpMajorityComparison()`

Other score vector functions:
`copelandScores()`

,
`cumulativeScores()`

,
`lexcelScores()`

,
`ordinalBanzhafScores()`

## Examples

```
# 2 > (1 ~ 3) > 12 > (13 ~ 23) > {} > 123
pr <- newPowerRelation(
2,
">", 1,
"~", 3,
">", c(1,2),
">", c(1,3),
"~", c(2,3),
">", c(),
">", c(1,2,3)
)
# get scores for all elements
# cpMajorityComparisonScore(pr, 2, 1) = 1
# cpMajorityComparisonScore(pr, 3, 1) = -1
# therefore the Kramer-Simpson-Score for element
# `1` = 1
#
# Score analogous for the other elements
# `2` = -1
# `3` = 2
kramerSimpsonScores(pr)
#> $`1`
#> [1] 1
#>
#> $`2`
#> [1] -1
#>
#> $`3`
#> [1] 2
#>
#> attr(,"class")
#> [1] "KramerSimpsonScores"
# get scores for two elements
# `1` = 1
# `3` = 2
kramerSimpsonScores(pr, c(1,3))
#> $`1`
#> [1] 1
#>
#> $`3`
#> [1] 2
#>
#> attr(,"class")
#> [1] "KramerSimpsonScores"
# or single element
# result is still a list
kramerSimpsonScores(pr, 2)
#> $`2`
#> [1] -1
#>
#> attr(,"class")
#> [1] "KramerSimpsonScores"
# note how the previous result of element 2 is negative.
# If we compare element 2 against itself, its max score will be 0
kramerSimpsonScores(pr, 2, compIvsI = TRUE)
#> $`2`
#> [1] 0
#>
#> attr(,"class")
#> [1] "KramerSimpsonScores"
# 2 > 1 > 3
kramerSimpsonRanking(pr)
#> 2 > 1 > 3
```