README.md

Measure voting power in R

Build Status Coverage Status

Have you ever asked yourself if weighted voting is fair? This package implements (or will implement) some of the most popular voting power measurement methods.

Imagine you are a representative of the country Luxembourg in the European Economic Community of 1958. At that time Germany, France and Italy had 4 votes each, Belgium and the Netherlands 2 and Luxembourg 1 vote. The necessary quota was 12 out of the 17 votes. The problem was however that there existed no situation where the vote of Luxembourg counted, i.e. would change the outcome of a "yes" to "no". Luxembourg was never critical.

This topic is a bit esoteric but quite interesting. A number of algorithms exists both for measuring power and for the inverse problem: designing weights such that a specific voting power is achieved. The currently implemented methods have an exponential running time. However there exist more advanced methods when dealing with larger voting bodies.

More can be found here or in the book of Felsenthal & Machover (1998). Below is a plot of the voting power of the EEC members in relation to the quota.

Current version: 0.1.0

Installation

To install the current development version use devtools:

devtools::install_github("dirkschumacher/votingpower.r")

Quick start

Let us recreate the example of the EEC from above.

library(votingpower)
eec <- create_weighted_voting_game(12, c(4, 4, 4, 2, 2, 1))

# the Banzhaf score counts the coalitions where a voter is critical.
score <- compute_bz_score(eec)
print(score) 
# > [1] 10 10 10 6 6 0

# The probability of a voter being critical is a good indicator for power - the Bz power measure.
power <- compute_bz_power(eec)
print(power) 
# > [1] 0.3125 0.3125 0.3125 0.1875 0.1875 0.0000

# Below is the power according to the weights
print(round(eec$weights / sum(eec$weights), 2))
# > [1] 0.24 0.24 0.24 0.12 0.12 0.06

Voting power in the EEC

API

Versioning

This package will Semantic Versioning 2.0 use once a first stable version is out. Indicated by a version number starting with 0. Until then breaking changes will increase the minor version number. The major version number will stay 0.

References

Werner Kirsch: Europa, nachgerechnet, Die Zeit, 9. Juni 2004

Felsenthal, Dan S; Machover, Moshé (1998), The measurement of voting power theory and practice, problems and paradoxes, Cheltenham: Edward Elgar



dirkschumacher/votingpower.r documentation built on May 15, 2019, 8:50 a.m.