hjugement-1.0.0.20170804: Majority Judgment.

Hjugement.Majority

Synopsis

# Type Choices

type Choices prop = Set prop Source #

choices :: (Bounded prop, Enum prop, Ord prop) => Choices prop Source #

Return a set of Choices by enumerating the alternatives of its type. Useful on sum types.

# Type Scale

Constructors

 Scale FieldsscaleGrades :: Set gradeHow many grades should be used? A greater number of grades permits a finer distinction but demands a higher degree of expertise and discernment. The optimal number is the highest number of grades that constitutes a common language, that is, that allows judges to make absolute judgments. Too little grades may lead too often to ties.Note, however, that if the inputs or grades depend on the set of choices, i.e. if judges change their grades when choices are added or dropped, then the Arrow paradox cannot be avoided. To avoid this the scale must be fixed and absolute so that more or fewer choices does not change the inputs or messages of other choices.scaleDefault :: gradeFor instance, when a judge gives no grade or has “no opinion”, scaleDefault could mean that the judge chooses “To Reject” the choice: the rationale being that a judge having “no opinion” concerning a choice has not even taken the time to evaluate it and thus has implicitly rejected it.

Instances

Return a Scale by enumerating the alternatives of its type. Useful on sum types.

scaleOfList :: Eq a => [a] -> a -> Scale Int Source #

Return a Scale from a list of grades and a default grade. Useful with grades whose type has no Ord instance or a different one than the one wanted.

gradeOfScale :: [a] -> Int -> a Source #

# Type Jury

type Jury judge = Set judge Source #

jury :: (Bounded judge, Enum judge, Ord judge) => Jury judge Source #

Return a Jury by enumerating the alternatives of its type. Useful on sum types.

# Type Opinion

Profile of opinions of one single judge about some propositions.

opinion :: (Enum prop, Bounded prop, Ord prop) => judge -> [grade] -> (judge, Opinion prop grade) Source #

Construct the Opinion of a judge about some propositions implicit from their type.

## Type Opinions

newtype Opinions prop grade judge Source #

Profile of opinions of some judges about some propositions.

Constructors

 Opinions (Map judge (Opinion prop grade))

Instances

# Type Merit

Profile of merits about a choice.

Constructors

Instances

type Count = Int Source #

merit grad returns the Merit of a single choice by some judges.

## Type Merits

newtype Merits prop grade Source #

Profile of merits about some choices.

Constructors

Instances

merits :: (Ord grade, Ord prop) => Scale grade -> Choices prop -> Opinions prop grade judge -> Merits prop grade Source #

merit scal props opins returns the Merits of the Choices props as judged by the Opinions opins on the Scale scal.

# Type Value

A Value is a compressed list of grades, where each grade is associated with the Count by which it would be replicated in situ if decompressed.

Constructors

Instances

 Eq grade => Eq (Value grade) Source # Methods(==) :: Value grade -> Value grade -> Bool #(/=) :: Value grade -> Value grade -> Bool # Ord grade => Ord (Value grade) Source # compare lexicographically as if the Values were decompressed. Methodscompare :: Value grade -> Value grade -> Ordering #(<) :: Value grade -> Value grade -> Bool #(<=) :: Value grade -> Value grade -> Bool #(>) :: Value grade -> Value grade -> Bool #(>=) :: Value grade -> Value grade -> Bool #max :: Value grade -> Value grade -> Value grade #min :: Value grade -> Value grade -> Value grade # Show grade => Show (Value grade) Source # MethodsshowsPrec :: Int -> Value grade -> ShowS #show :: Value grade -> String #showList :: [Value grade] -> ShowS #

The majorityValue is the list of the majorityGrades of a choice, each one replicated their associated Count times, from the most consensual to the least, ie. by removing the grade of the previous majorityGrade to compute the next.

The majorityGrade is the lower middlemost (also known as median by experts) of the grades given to a choice by the judges.

It is the highest grade approved by an absolute majority of the judges: more than 50% of the judges give the choice at least a grade of majorityGrade, but every grade lower than majorityGrade is rejected by an absolute majority Thus the majorityGrade of a choice is the final grade wished by the majority.

The majorityGrade is necessarily a word that belongs to grades, and it has an absolute meaning.

When the number of judges is even, there is a middle-interval (which can, of course, be reduced to a single grade if the two middle grades are the same), then the majorityGrade is the lowest grade of the middle-interval (the “lower middlemost” when there are two in the middle), which is the only one which respects consensus: any other choice whose grades are all within this middle-interval, has a majorityGrade which is greater or equal to this lower middlemost.

# Type Ranking

type Ranking prop = [prop] Source #

majorityRanking :: Ord grade => Merits prop grade -> Ranking prop Source #

The majorityRanking ranks all the choices on the basis of their grades.

Choice A ranks higher than choice B in the majorityRanking if and only if A’s majorityValue is lexicographically above B’s. There can be no tie unless two choices have precisely the same majorityValues.