MajorityJudgment

class svvamp.MajorityJudgment(population, **kwargs)[source]

Majority Judgment.

Inherits functions and optional parameters from superclasses ElectionResult and Election.

Parameters:
Example:
>>> import svvamp
>>> pop = svvamp.PopulationSpheroid(V=100, C=5)
>>> election = svvamp.MajorityJudgment(pop, min_grade=0, max_grade=1, step_grade=0, rescale_grades=True)

Each voter attributes a grade to each candidate. By default, authorized grades are all numbers in the interval [min_grade, max_grade]. To use a discrete set of notes, modify attribute step_grade.

Note

Majority Judgement, as promoted by its authors, uses a discrete set of non-numerical grades. For our purpose, using a discrete set of numerical grades (step_grade > 0) is isomorphic to this voting system. In contrast, using a continuous set of grades (step_grade = 0) is a variant of this voting system, which has the advantage of being canonical, in the sense that there is no need to choose the number of authorized grades more or less arbitrarily.

The candidate with highest median grade wins. For the tie-breaking rule, see scores.

Default behavior of sincere voters: voter v applies an affine transformation to her utilities preferences_ut[v, :] to get her grades, such that her least-liked candidate receives min_grade and her most-liked candidate receives max_grade. To modify this behavior, use attribute rescale_grades. For more details about the behavior of sincere voters, see ballots.

not_IIA():

CM(), ICM(), IM(), TM(), UM(): Exact in polynomial time.

References:

Majority Judgment : Measuring, Ranking, and Electing. Michel Balinski and Rida Laraki, 2010.
ballots

2d array of integers. ballots[v, c] is the grade attributed by voter v to candidate c (when voting sincerely). The following process is used.

  1. Convert utilities into grades in interval [min_grade, max_grade].

  2. If step_grades > 0 (discrete set of grades), round each grade to the closest authorized grade.

max_grade

Number. Maximal grade allowed.

min_grade

Number. Minimal grade allowed.

rescale_grades

Boolean. Whether sincere voters rescale their utilities to produce grades.

If rescale_grades = True, then each sincere voter v applies an affine transformation to send her utilities into the interval [min_grade, max_grade].

If rescale_grades = False, then each sincere voter v clips her utilities into the interval [min_grade, max_grade].

See ballots for more details.

scores

2d array of integers.

scores[0, c] is the median grade of candidate c.

Let us note p (resp. q) the number of voter who attribute to c a grade higher (resp. lower) than the median. If p > q, then scores[1, c] = p. Otherwise, scores[1, c] = -q.

step_grade

Number. Interval between two consecutive allowed grades.

If step_grade = 0, all grades in the interval [min_grade, max_grade] are allowed (‘continuous’ set of grades).

If step_grade > 0, authorized grades are the multiples of step_grade lying in the interval [min_grade, max_grade]. In addition, the grades min_grade and max_grade are always authorized, even if they are not multiples of step_grade.

w

Integer (winning candidate).

Candidates are sorted lexicographically by their median (scores[0, c]) then their p or -q (scores[1, c]). If there is still a tie, the tied candidate with lower index is declared the winner.