Package 'powerindexR'

Title: Measuring the Power in Voting Systems
Description: This R package allows the determination of some distributions of the voters' power when passing laws in weighted voting situations.
Authors: Livino M. Armijos-Toro [aut, cre], Jose M. Alonso-Meijide [aut], Manuel A. Mosquera [aut], Alejandro Saavedra-Nieves [aut]
Maintainer: Livino M. Armijos-Toro <[email protected]>
License: GPL-2
Version: 1.6
Built: 2024-11-27 06:47:27 UTC
Source: CRAN

Help Index


Measuring the Power in Voting Systems

Description

This R package allows the determination of some distributions of the voters' power when passing laws in weighted voting situations.

Details

The DESCRIPTION file:

Package: powerindexR
Type: Package
Title: Measuring the Power in Voting Systems
Version: 1.6
Date: 2024-05-30
Authors@R: c(person("Livino M.", "Armijos-Toro", role = c("aut", "cre"),email="[email protected]"), person("Jose M.", "Alonso-Meijide", role = c("aut")), person("Manuel A.", "Mosquera", role = c("aut")), person("Alejandro", "Saavedra-Nieves", role = c("aut")))
Depends: R(>= 3.0.0)
Description: This R package allows the determination of some distributions of the voters' power when passing laws in weighted voting situations.
License: GPL-2
LazyLoad: yes
Packaged: 2024-05-30 14:57:11 UTC; alexs
Repository: CRAN
NeedsCompilation: no
Author: Livino M. Armijos-Toro [aut, cre], Jose M. Alonso-Meijide [aut], Manuel A. Mosquera [aut], Alejandro Saavedra-Nieves [aut]
Maintainer: Livino M. Armijos-Toro <[email protected]>
RoxygenNote: 7.0.2
Date/Publication: 2024-05-30 15:10:03 UTC

Index of help topics:

MWC                     Obtain the minimal winning coalitions
QMWC                    Obtain the quasi-minimal winning coalitions
pi.banzhaf              Power based on the Banzhaf index.
pi.colomermartinez      Power based on the Colomer-Martinez index.
pi.johnston             Power based on the Johnston index.
pi.johnstoncolomermartinez
                        Power based on the Jonhston-Colomer-Martinez
                        index.
pi.shapley              Power based on the Shapley-Shubik index.
powerindex              Obtain several measures of power
powerindexR-package     Measuring the Power in Voting Systems

This R package allows the determination of some distributions of the voters' power when passing laws in weighted voting situations.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

References

Alonso-Meijide, J. M., & Bowles, C. (2005). Generating functions for coalitional power indices: An application to the IMF. Annals of Operations Research, 137, 21-44. <https://doi.org/10.1007/s10479-005-2242-y>.

Brams, S. J., & Affuso, P. J. (1976). Power and size: A new paradox. Theory and Decision, 7(1-2), 29-56. <https://doi.org/10.1007/BF00141101>.

Colomer, J. M., & Martinez, F. (1995). The paradox of coalition trading. Journal of Theoretical Politics, 7(1), 41-63. <https://doi.org/10.1177/0951692895007001003>.

Johnston, R. J. (1978). On the measurement of power: Some reactions to Laver. Environment and Planning A, 10(8), 907-914. <https://doi.org/10.1068/a100907>.

Lucas, W. F. (1983). Measuring power in weighted voting systems (pp. 183-238). Springer New York. <https://doi.org/10.1007/978-1-4612-5430-0_9>


Obtain the minimal winning coalitions

Description

This function determines the minimal winning coalitions in a weighted majority game.

Usage

MWC(quota, weights)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

Value

Number of Minimal Winning Coalitions

Total amount of Minimal Winning Coalitions.

Minimal Winning Coalitions

Each row indicates a binary representation of each Minimal Winning Coalition.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

Examples

weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
MWC(quota,weights)

Power based on the Banzhaf index.

Description

This function determines the distribution of the power based on the Banzhaf index and the Banzaf-Owen value.

Usage

pi.banzhaf(quota, weights, partition = NULL, normalized = FALSE, swing = FALSE)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

partition

Numerical vector that indicates the partition of voters. Each component indicates the element of the partition to which such voter belongs. If it is not NULL, it provides the distribution of the power based on the Banzhaf-Owen value.

normalized

Logical option to obtain the normalized Banzhaf values.

swing

Logical option to obtain the number of swings of each voter.

Value

Banzhaf value

The Banzhaf value, if partition=NULL.

Banzhaf-Owen value

The Banzhaf-Owen value, if partition!=NULL.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

References

Alonso-Meijide, J. M., & Bowles, C. (2005). Generating functions for coalitional power indices: An application to the IMF. Annals of Operations Research, 137, 21-44.

Brams, S. J., & Affuso, P. J. (1976). Power and size: A new paradox. Theory and Decision, 7(1-2), 29-56.

Examples

# Example Banzhaf value
weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
pi.banzhaf(quota,weights)
pi.banzhaf(quota,weights,normalized=TRUE)

# Example Banzhaf-Owen value
quota<-30
weights<-c(28, 16, 5, 4, 3, 3)
# Partition={{1},{2,4,6},{3,5}}
pi.banzhaf(quota,weights,partition=c(1,2,3,2,3,2))

Power based on the Colomer-Martinez index.

Description

This function determines the distribution of the power based on the Colomer-Martinez index.

Usage

pi.colomermartinez(quota, weights, minimal = FALSE)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

minimal

Logical option to obtain the Minimal Winning Coalitions.

Value

Colomer-Martinez

The Colomer-Martinez index.

Number of Minimal Winning Coalitions

Total amount of Minimal Winning Coalitions.

Minimal Winning Coalitions

Each row indicates a binary representation of each Minimal Winning Coalition.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

References

Colomer, J. M., & Martinez, F. (1995). The paradox of coalition trading. Journal of Theoretical Politics, 7(1), 41-63.

Examples

weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
pi.colomermartinez(176,weights,minimal=TRUE)

Power based on the Johnston index.

Description

This function determines the distribution of the power based on the Johnston index.

Usage

pi.johnston(quota, weights, quasiminimal = FALSE)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

quasiminimal

Logical option to obtain the Quasi-Minimal Winning Coalitions.

Value

Johnston

The Jonhston index.

Number of Quasi-Minimal Winning Coalitions

Total amount of Quasi-Minimal Winning Coalitions.

Quasi-Minimal Winning Coalitions

Each row indicates a binary representation of each Quasi-Minimal Winning Coalition.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

References

Johnston, R. J. (1978). On the measurement of power: Some reactions to Laver. Environment and Planning A, 10(8), 907-914.

Examples

weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
pi.johnston(176,weights,quasiminimal=TRUE)

Power based on the Jonhston-Colomer-Martinez index.

Description

This function determines the distribution of the power based on the Jonhston-Colomer-Martinez index.

Usage

pi.johnstoncolomermartinez(quota, weights)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

Value

Jonhston-Colomer-Martinez

The Jonhston-Colomer-Martinez index.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

References

Colomer, J. M., & Martinez, F. (1995). The paradox of coalition trading. Journal of Theoretical Politics, 7(1), 41-63.

Johnston, R. J. (1978). On the measurement of power: Some reactions to Laver. Environment and Planning A, 10(8), 907-914.

Examples

weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
pi.johnstoncolomermartinez(176,weights)

Power based on the Shapley-Shubik index.

Description

This function determines the distribution of the power based on the Shapley-Shubik index and the Owen value.

Usage

pi.shapley(quota, weights, partition = NULL)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

partition

Numerical vector that indicates the partition of voters. Each component indicates the element of the partition to which such voter belongs. If it is not NULL, it provides the distribution of the power based on the Owen value.

Value

Shapley value

The Shapley value, if partition=NULL.

Owen value

The Owen value, if partition!=NULL.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

References

Alonso-Meijide, J. M., & Bowles, C. (2005). Generating functions for coalitional power indices: An application to the IMF. Annals of Operations Research, 137, 21-44.

Lucas, W. F. (1983). Measuring power in weighted voting systems (pp. 183-238). Springer New York.

Examples

# Example Shapley value
weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
pi.shapley(quota,weights)

# Example Owen value
quota<-30
weights<-c(28, 16, 5, 4, 3, 3)
# Partition={{1},{2,4,6},{3,5}}
pi.shapley(quota,weights,partition=c(1,2,3,2,3,2))

Obtain several measures of power

Description

This general function allows the determination of several distributions of the power under different approaches in a weighted voting situation.

Usage

powerindex(quota, weights, index = c("S", "B", "J", "CM", "JCM"), 
partition = NULL, quasiminimal = FALSE, minimal = FALSE, normalized = FALSE, 
swing = FALSE)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

index

Character that indicates the used approach. S and B denote the Shapley-Shubik index and the Banzhaf index, and the Owen index and the Banzhaf-Owen index if partition exist. J is used for obtaining the Jonhston index, CM determines the Colomer-Martinez index and JCM is used for obtaining the Jonhston-Colomer-Martinez index.

partition

Numerical vector that indicates the partition of voters. Each component indicates the element of the partition to which such voter belongs.

quasiminimal

Logical option to obtain the Quasi-Minimal Winning Coalitions.

minimal

Logical option to obtain the Minimal Winning Coalitions.

normalized

Logical option to obtain the normalized Banzhaf values.

swing

Logical option to obtain the number of swings of each voter.

Value

See the values of the respective functions.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

References

Alonso-Meijide, J. M., & Bowles, C. (2005). Generating functions for coalitional power indices: An application to the IMF. Annals of Operations Research, 137, 21-44.

Brams, S. J., & Affuso, P. J. (1976). Power and size: A new paradox. Theory and Decision, 7(1-2), 29-56.

Colomer, J. M., & Martinez, F. (1995). The paradox of coalition trading. Journal of Theoretical Politics, 7(1), 41-63.

Johnston, R. J. (1978). On the measurement of power: Some reactions to Laver. Environment and Planning A, 10(8), 907-914.

Lucas, W. F. (1983). Measuring power in weighted voting systems (pp. 183-238). Springer New York.

Examples

weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
powerindex(quota,weights,index="S")
powerindex(quota,weights,index="B",swing=TRUE)
powerindex(quota,weights,index="B",partition=c(1,1,2,2,3,3,4,4,4),swing=TRUE)
powerindex(quota,weights,index="J",quasiminimal=TRUE)

Obtain the quasi-minimal winning coalitions

Description

This function determines the quasi-minimal winning coalitions in a weighted majority game.

Usage

QMWC(quota, weights)

Arguments

quota

Numerical value that represents the majority in a given voting.

weights

Numerical vector of dimension nn that indicates the weights of nn agents in a given voting.

Value

Number of Quasi-Minimal Winning Coalitions

Total amount of Quasi-Minimal Winning Coalitions.

Quasi-Minimal Winning Coalitions

Each row indicates a binary representation of each Quasi-Minimal Winning Coalition.

Author(s)

Livino M. Armijos-Toro, Jose M. Alonso-Meijide, Manuel A. Mosquera, Alejandro Saavedra-Nieves.

Examples

weights<-c(137,85,71,32,9,8,5,2,1) 
quota<-176
QMWC(quota,weights)