View source: R/biproportional-lower.R
lower_apportionment | R Documentation |
In the second biproportional apportionment step, party and district divisors are calculated such that the row and column sums of the resulting seats matrix satisfy the constraints given by the upper apportionment.
lower_apportionment(votes_matrix, seats_cols, seats_rows, method = "round")
votes_matrix |
matrix with votes by party in rows and votes by district in columns. |
seats_cols |
number of seats per column (districts/regions), predetermined or
calculated with |
seats_rows |
number of seats per row (parties/lists), calculated with
|
method |
Apportion method that defines how seats are assigned. The following methods are supported:
|
The result is obtained by an iterative process ('Alternate Scaling Algorithm', see Reference). Initially, for each district a divisor is chosen using the highest averages method for the votes allocated to each regional party list in this region. For each party a party divisor is initialized with 1.
Effectively, the objective of the iterative process is to modify the regional divisors and party divisors so that the number of seats in each regional party list equals the number of their votes divided by both the regional and the party divisors.
The following two correction steps are executed until this objective is satisfied:
modify the party divisors such that the apportionment within each party is correct with the chosen rounding method,
modify the regional divisors such that the apportionment within the region is correct with the chosen rounding method.
A seat matrix with district (columns) and party (rows) divisors stored in attributes.
If the maximum number of optimization iterations is reached, an error is thrown since
no solution can be found. You can overwrite the default (1000) with
options(proporz_max_iterations = ...)
but it is very likely that the result is undefined
given the structure of the input parameters.
Oelbermann, K. F. (2016): Alternate scaling algorithm for biproportional divisor methods. Mathematical Social Sciences, 80, 25-32.
biproporz()
, upper_apportionment()
, district_winner_matrix()
votes_matrix = matrix(c(123,912,312,45,714,255,815,414,215), nrow = 3)
district_seats = c(7,5,8)
party_seats = c(5,11,4)
lower_apportionment(votes_matrix, district_seats, party_seats)
# using "winner take one"
vm = matrix(c(200,100,10,11), 2,
dimnames = list(c("Party A", "Party B"), c("I", "II")))
district_seats = setNames(c(2,1), colnames(vm))
ua = upper_apportionment(vm, district_seats)
lower_apportionment(vm, ua$district, ua$party, method = "wto")
# compare to standard method
lower_apportionment(vm, ua$district, ua$party, method = "round")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.