(Dis)proportionality Measures¶
The proportion module contains functions for measuring
disproportionality in electoral systems.
-
voting.proportion.adjusted_loosemore_hanby(votes, seats, parties='votes')[source]¶ Calculate the adjusted Loosemore-Hanby index of disproportionality.
\[N \sum_{i=1}^n |v_i - s_i|\]where N is \(\sum_{i=1}^n v_i\) if
parties == 'votes'or \(\sum_{i=1}^n s_i\) ifparties == 'seats'.- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
parties (str) –
votesorseatsto use to calculate the effective number of parties
-
voting.proportion.dhondt(votes, seats)[source]¶ Calculate the D’Hondt index of disproportionality.
\[\max \frac{s_i}{v_i}\]- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
-
voting.proportion.gallagher(votes, seats)[source]¶ Calculate the Gallagher index of disproportionality.
\[\sqrt{\frac{1}{2} \sum_{i=1}^n (v_i - s_i)^2}\]- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
-
voting.proportion.grofman(votes, seats, parties='votes')[source]¶ Calculate the Grofman index of disproportionality.
\[N \sum_{i=1}^n |v_i - s_i|\]where N is \(\sum_{i=1}^n v_i^2\) if
parties == 'votes'or \(\sum_{i=1}^n s_i^2\) ifparties == 'seats'.- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
parties (str) –
votesorseatsto use to calculate the effective number of parties
-
voting.proportion.least_square(votes, seats)[source]¶ Calculate the least squares index of disproportionality.
\[\sqrt{\sum_{i=1}^n (v_i - s_i)^2}\]- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
-
voting.proportion.lijphart(votes, seats)[source]¶ Calculate the Lijphart index of disproportionality.
\[\max | v_i - s_i |\]- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
-
voting.proportion.loosemore_hanby(votes, seats)[source]¶ Calculate Loosemore-Hanby index of disproportionality.
\[\frac{1}{2} \sum_{i=1}^n |v_i - s_i|\]- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
-
voting.proportion.rae(votes, seats)[source]¶ Calculate Rae’s index of disproportionality.
\[\frac{1}{n} \sum_{i=1}^n |v_i - s_i|\]- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts
-
voting.proportion.regression(votes, seats)[source]¶ Calculate the regression index of disproportionality.
\[\frac{\sum_{i=1}^n v_i s_i}{\sum_{i=1}^n v_i^2}\]- Parameters
votes (list) – a list of vote counts
seats (list) – a list of seat counts