dissimilarity {relations} | R Documentation |
Dissimilarity Between Relations
Description
Compute the dissimilarity between (ensembles of)
relations.
Usage
relation_dissimilarity(x, y = NULL, method = "symdiff", ...)
Arguments
x |
an ensemble of relations, or something which can be coerced
to such (see relation_ensemble ). |
y |
NULL (default), or as for x . |
method |
a character string specifying one of the built-in
methods for computing dissimilarity, or a function to be taken as
a user-defined method. 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. |
... |
further arguments to be passed to methods. |
Details
Available built-in methods are as follows. Apart from the symmetric
difference distance, these are applicable to endorelations only.
"symdiff"
- symmetric difference distance.
This computes the cardinality of the symmetric difference of two
relations, i.e., the number of tuples contained in exactly one of
two relations. For preference relations, this coincides with the
Kemeny-Snell metric (Kemeny and Snell, 1962). For linear
orders, it gives Kendall's tau metric (Diaconis, 1988).
Can also be referred to as "manhattan"
.
"euclidean"
- the Euclidean distance between the
incidences.
"CS"
- Cook-Seiford distance, a generalization of the
distance function of Cook and Seiford (1978). Let the generalized
ranks of an object a in the (first) domain of an
endorelation R be defined as the number of objects b
dominating a (i.e., for which a R b and not b R
a), plus half the number of objects b equivalent to a
(i.e., for which a R b and b R a). For preference
relations, this gives the usual Kendall ranks arranged according
to decreasing preference (and averaged for ties). Then the
generalized Cook-Seiford distance is defined as the l_1
distance between the generalized ranks. For linear orders, this
gives Spearman's footrule metric (Diaconis, 1988).
"CKS"
- Cook-Kress-Seiford distance, a generalization of
the distance function of Cook, Kress and Seiford (1986). For each
pair of objects a and b in an endorelation R, we
can have a R b and not b R a or vice versa (cases of
“strict preference”, a R b and b R a (the case
of “indifference”), or neither a R b nor b R a
(the case of “incomparability”). (Only the last two are
possible if a = b.) The distance by Cook, Kress and Seiford
puts indifference as the metric centroid between both preference
cases and incomparability (i.e., indifference is at distance one
from the other three, and each of the other three is at distance
two from the others). The generalized Cook-Kress-Seiford distance
is the paired comparison distance (i.e., a metric) based on these
distances between the four paired comparison cases. (Formula 3 in
the reference must be slightly modified for the generalization
from partial rankings to arbitrary endorelations.)
"score"
- score-based distance. This computes
Delta(s(x), s(y)) for suitable score and distance functions
s and Delta, respectively. These can be specified by
additional arguments
score
and Delta
. If
score
is a character string, it is taken as the method for
relation_scores
. Otherwise, if given it must be a
function giving the score function itself. If Delta
is a
number p >= 1, the usual l_p distance is used.
Otherwise, it must be a function given the distance function.
The defaults correspond to using the default relation scores and
p = 1, which for linear orders gives Spearman's footrule
distance.
Value
If y
is NULL
, an object of class dist
containing the dissimilarities between all pairs of elements of
x
. Otherwise, a matrix with the dissimilarities between the
elements of x
and the elements of y
.
References
W. D. Cook, M. Kress and L. M. Seiford (1986),
Information and preference in partial orders: a bimatrix
representation.
Psychometrika 51/2, 197–207.
W. D. Cook and L. M. Seiford (1978),
Priority ranking and consensus formation.
Management Science, 24/16, 1721–1732.
P. Diaconis (1988),
Group Representations in Probability and Statistics.
Institute of Mathematical Statistics: Hayward, CA.
J. G. Kemeny and J. L. Snell (1962),
Mathematical Models in the Social Sciences,
chapter “Preference Rankings: An Axiomatic Approach”.
MIT Press: Cambridge.
[Package
relations version 0.5-1
Index]