Description Usage Arguments Value References Examples
View source: R/cdc_kemenyyoung.R
Kemeny-Young method first lists all the permutations of candidates, that is, all possible orders, or possible ordered links. Then, it computes the sums of strength of these links. The top link is the one with the highest strength score, and the winner is the first one in this link. Currently, the maximum candidate number is 8 for speed and memory reasons.
1 2 | cdc_kemenyyoung(x, allow_dup = TRUE, min_valid = 1, margin = FALSE,
keep_all_link = FALSE)
|
x |
it accepts the following types of input:
1st, it can be an object of class |
allow_dup |
whether ballots with duplicated score values are taken into account. Default is TRUE. |
min_valid |
default is 1. If the number of valid entries of a ballot is less than this value, it will not be used. |
margin |
if it is FALSE (default), the values in Condorcet matrix are used, that is: if A vs. B is 30, B vs. A is 18, then 30 and 18 are used to calculate link strength; if it is TRUE, then 30 - 18 = 12 and -12 are used. |
keep_all_link |
if TRUE, the result will store all the links and their strength. However, it is quite memory-costing, so the default is FALSE. |
a condorcet object, which is essentially
a list.
(1) call the function call.
(2) method the counting method.
(3) candidate candidate names.
(4) candidate_num number of candidate.
(5) ballot_num number of ballots in x. When
x is not a vote object, it may be NULL.
(6) valid_ballot_num number of ballots that are
actually used to compute the result. When
x is not a vote object, it may be NULL.
(7) winner the winner.
(8) input_object the class of x.
(9) cdc the Condorcet matrix which is actually used.
(10) dif the score difference matrix. When
x is not a vote object, it may be NULL.
(11) binary win and loss recorded with 1 (win),
0 (equal) and -1 (loss).
(12) summary_m times of win (1), equal (0)
and loss (-1).
(13) other_info a list with 3 elements. win_link
is the link with the highest strength. Note: it is a matrix, maybe with 2
or more rows. win_link_value is the strength of the link.
all_link is NULL when keep_all_link is FALSE. if TRUE,
it stores all the links and scores sorted by scores in decreasing order (this
costs much memory on your computer).
Young, H. & Levenglick, A. 1978. A consistent extension of Condorcet's election principle. Society for Industrial and Applied Mathematics, 35(2), 285-300.
1 2 3 4 |
CREATING CDC MATRIX
------USE INPUT MATRIX
EXTRACTING INFO
SELECTING
COLLECTING RESULT
DONE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.