get_rank_distance: Compute the Distance between two rankings

View source: R/RcppExports.R

get_rank_distanceR Documentation

Compute the Distance between two rankings

Description

Compute the distance between two rankings according to several metrics.

Usage

get_rank_distance(r1, r2, metric)

Arguments

r1

A vector of ranks.

r2

A vector of ranks.

metric

A string. Available options are "footrule", "kendall", "cayley", "hamming", "spearman", and "ulam".

Details

Note that the Spearman distance is the squared L2 norm, whereas the footrule distance is the L1 norm.

The Ulam distance uses the SUBSET library developed by John Burkardt, available at http://people.sc.fsu.edu/~jburkardt/cpp_src/subset/subset.html.

The implementation of Cayley distance is based on a C++ translation of Rankcluster::distCayley \insertCiteGrimonprez2016BayesMallows.

Value

A scalar.

References

\insertAllCited

BayesMallows documentation built on Nov. 25, 2023, 5:09 p.m.