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
To install the current development version use devtools:
devtools::install_github("dirkschumacher/votingpower.r")
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
create_weighted_voting_game
Create a weighted voting game.create_equal_weight_voting_game
Creates a weighted voting game with weights = 1 for all voters.compute_bz_score
For a voting game this function computes the Bz score; i.e. the number of times a voter is critical. compute_bz_index
Bz index is the Bz score normalised by the sum of the Bz scores.compute_bz_power
The Bz power is the Bz score divided by 2^(n-1) where n is the number of voters. It corresponds to the probability a voter is critical.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.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.