Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_rank_distance

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 (Grimonprez and Jacques 2016).

Value

A scalar.

References

Grimonprez Q, Jacques J (2016). Rankcluster: Model-Based Clustering for Multivariate Partial Ranking Data. R package version 0.94, https://CRAN.R-project.org/package=Rankcluster.


BayesMallows

Bayesian Preference Learning with the Mallows Rank Model

v1.0.1
GPL-3
Authors
Oystein Sorensen [aut, cre] (<https://orcid.org/0000-0003-0724-3542>), Valeria Vitelli [aut] (<https://orcid.org/0000-0002-6746-0453>), Marta Crispino [aut], Qinghua Liu [aut], Cristina Mollica [aut], Luca Tardella [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.