election_list_functions | R Documentation |
An election list represents an election
in a minimal way: it contains the electorate size, the ballot
format, and a list of "election events", i.e. situations in which
a single ballot can affect the outcome in a given way.
It also contains a label for the voting system, e.g. "positional".
An election list is passed to the
election_event_probs()
function to compute the probability of each election event given
a model of voting outcomes.
plurality_election(n = 1000, k = 4, max_pivot_event_degree = 1)
pr_election(n = 1000, M = 3)
positional_election(n = 1000, s = 0.5)
irv_election(n = 1000, s = 0)
kemeny_young_election(n = 1000)
n |
The size of the electorate. This (slightly) affects the
conditions for election events in the election list
(e.g. the region in which one
candidate is more than one vote ahead of another).
|
k |
The number of candidates in plurality. |
max_pivot_event_degree |
If 1, we consider two-way (near) ties in plurality. If 2, we also consider three-way (near) ties. |
s |
The value of a second-ranking in a three-candidate positional election, where a top ranking is worth 1 and a bottom ranking is worth 0. |
An election list contains the electorate size n
,
an ordinal
flag indicating whether this is an ordinal or single-ballot
voting
system, and a list of election events
. For each event,
the election list indicates
conditions under which the event takes place, and
which candidate wins given that this event takes place as a function of which additional ballot is submitted.
These functions produce plain lists, so functions can be written for further election methods.
The election methods provided are:
plurality_election()
, where each voter votes for
one of k>=3
candidates and the candidate with the most votes wins.
positional_election()
, where each voter ranks the
three candidates and the candidate with the highest score wins, with
each top ranking worth 1 point, each bottom ranking worth 0 points,
and each middle ranking worth s
points.
For now we can only handle 3 candidates.
(I have written code to handle more, but the QHull
functions seem to have trouble with the geometry.)
irv_election()
(instant-runoff), where each voter
ranks the three candidates and the winner is determined by a process
of elimination. The ballots are initially tallied using a
positional method; the most commonly used option is plurality,
i.e. s=0
.) The lowest-scoring candidate is eliminated.
Given three candidates, the winner is then determined according
to which of the remaining candidates is ranked higher on more
ballots.
kemeny_young_election()
(maximin), where any
candidate who defeats all others in a pairwise comparison (i.e. is ranked higher on more ballots)
is the winner and, if there is no such candidate, the winner is the
candidate who is defeated by the smallest margin.
plurality_election(k = 3)
positional_election(s = .5) # borda count
irv_election()
kemeny_young_election()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.