Learn R Programming

relations (version 0.2-0)

consensus: Consensus Relations

Description

Compute the consensus relation of a relation ensemble.

Usage

relation_consensus(x, method = NULL, weights = 1, control = list(), ...)

Arguments

x
an ensemble of relations, or something which can be coerced to such (see relation_ensemble).
method
a character string specifying one of the built-in methods for computing consensus relations, or a function to be taken as a user-defined method, or NULL (default value). If a character string, its lower-cased version is matched a
weights
a numeric vector with non-negative case weights. Recycled to the number of elements in the ensemble given by x if necessary.
control
a list of control parameters. See Details.
...
a list of control parameters (overruling those specified in control).

Value

  • The consensus relation(s).

encoding

UTF-8

Details

Consensus relations synthesize the information in the elements of a relation ensemble into a single relation, often by minimizing a criterion function measuring how dissimilar consensus candidates are from the (elements of) the ensemble (the so-called optimization approach), typically of the form $L(R) = \sum w_b d(R_b, R)$, where $d$ is a suitable dissimilarity measure (see relation_dissimilarity) and $w_b$ is the case weight given to element $R_b$ of the ensemble (such consensus relations are called central relations in Régnier (1965)).

Available built-in methods are as follows. Apart from Condorcet's, these are applicable to ensembles of endorelations only.

[object Object],[object Object],[object Object],[object Object]

References

J. C. Borda (1781), Mémoire sur les élections au scrutin. Histoire de l'Académie Royale des Sciences. W. D. Cook and M. Kress (1992), Ordinal information and preference structures: decision models and applications. Prentice-Hall: New York. ISBN: 0-13-630120-7.

M. J. A. de Condorcet (1785), Essai sur l'application de l'analyse à la probabilité des décisions rendues à la pluralité des voix. Paris.

A. H. Copeland (1951), A Reasonable Social Welfare Function. mimeo, University of Michigan. K. Hornik and D. Meyer (2007), Deriving consensus rankings from benchmarking experiments. In R. Decker and H.-J. Lenz, Advances in Data Analysis. Studies in Classification, Data Analysis, and Knowledge Organization. Springer-Verlag: Heidelberg, 163--170. F. Marcotorchino and P. Michaud (1982). Agrégation de similarités en classification automatique. Revue de Statistique Appliquée, 30(2):21--44. http://www.numdam.org/item?id=RSA_1982__30_2_21_0. S. Régnier (1965), Sur quelques aspects mathématiques des problèmes de classification automatique. ICC Bulletin, 4:175--191.

Examples

Run this code
## Consensus equivalence.
## (I.e., in fact, consensus partition.)
## Classification of 30 felines, see Marcotorchino and Michaud (1982).
data("Felines")
## Consider each variable an equivalence relation on the objects.
relations <- as.relation_ensemble(Felines)
## This gives a relation ensemble of length 14 (number of variables in
## the data set).
## Now fit an equivalence relation to this:
E <- relation_consensus(relations, "SD/E")
## And look at the equivalence classes:
ids <- relation_class_ids(E)
## Or, more nicely:
split(rownames(Felines), ids)
## Which is the same as in the paper ...

## Consensus linear order.
## Example from Cook and Kress, pages 48ff.
## Relation from paired comparisons.
pm <- matrix(c(0, 1, 0, 1, 1,
               0, 0, 0, 1, 1,
               1, 1, 0, 0, 0,
               0, 0, 1, 0, 0,
               0, 0, 1, 1, 0),
             nr = 5,
             byrow = TRUE,
             dimnames = list(letters[1:5], letters[1:5]))
## Note that this is a Cook and Kress "preference" matrix.
R <- as.relation(1 - pm)
relation_incidence(R)
relation_is_tournament(R)
## Closest linear order:
L <- relation_consensus(R, "SD/L")
relation_incidence(L)
## Visualize provided that Rgraphviz is available.
if(require("Rgraphviz")) plot(L)
## But note that this linear order is not unique.
L <- relation_consensus(R, "SD/L", control = list(all = TRUE))
print(L)
if(require("Rgraphviz")) plot(L)
## (Oh no.)
## Closest preference relation with at most 3 indifference classes:
P3 <- relation_consensus(R, "SD/P", control = list(k = 3))
relation_incidence(P3)

Run the code above in your browser using DataLab