consensus {relations} | R Documentation |
Compute the consensus relation of a relation ensemble.
relation_consensus(x, method = NULL, weights = 1, control = list(), ...)
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 against the
lower-cased names of the available built-in methods using
pmatch . See Details for available built-in
methods and defaults. |
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 ). |
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) ^ p, where d is a suitable
dissimilarity measure (see relation_dissimilarity
),
w_b is the case weight given to element R_b of the
ensemble, and p >= 1. Such consensus relations are called
“central relations” in Régnier (1965). For p = 1, we
obtain (generalized) medians; p = 2 gives (generalized) means
(least squares consensus relations).
Available built-in methods are as follows. Apart from Condorcet's and the unrestricted Manhattan and Euclidean consensus methods, these are applicable to ensembles of endorelations only.
"Borda"
"Copeland"
"Condorcet"
all
to TRUE
."CS"
all
to
TRUE
."SD/F"
G
A
C
E
L
M
O
S
T
W
preorder
transitive
Consensus relations are determined by reformulating the consensus
problem as a binary program (for the relation incidences), see
Hornik and Meyer (2007) for details. The solver employed can be
specified via the control argument solver
, with currently
possible values "lpsolve"
, "glpk"
, "symphony"
or "cplex"
or a unique abbreviation thereof, specifying to
use the solvers from packages lpSolve (default),
Rglpk, Rsymphony, or Rcplex, respectively.
Unless control option sparse
is false, a sparse formulation
of the integer program is used, which is typically more efficient.
For fitting equivalences and weak orders (cases E
and
W
) it is possible to specify the number of classes k
using the control parameter k
. For fitting weak orders,
one can also specify the number of elements in the classes via
control parameter l
.
Additional constraints on the incidences of the consensus solution
can be given via the control parameter constraints
, in the
form of a 3-column matrix whose rows give row and column indices
i and j and the corresponding incidence I_{ij}.
(I.e., incidences can be constrained to be zero or one on an
object by object basis.)
One can obtain a relation ensemble with all consensus
relations by setting the control parameter all
to
TRUE
. (See the examples.)
"manhattan"
"euclidean"
"euclidean/F"
"SD/F"
.
"majority"
p
. By default, p = 1/2 is
used.
"CKS/F"
"SD/F"
.
The consensus relation(s).
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.
W. D. Cook and L. M. Seiford (1978), Priority ranking and consensus formation. Management Science, 24/16, 1721–1732.
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.
## 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), nrow = 5, byrow = TRUE, dimnames = list(letters[1:5], letters[1:5])) ## Note that this is a Cook and Kress "preference matrix" where entry ## (i,j) is one iff object i is preferred to object j (i > j). ## Set up the corresponding '<' relation: R <- as.relation(t(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: c is once first and once last.) ## Closest weak order relation with at most 3 indifference classes: W3 <- relation_consensus(R, "SD/W", control = list(k = 3)) relation_incidence(W3)