BayesMallows: An R Package for the Bayesian Mallows Model

BayesMallows is an R package for analyzing preference data in the form of rankings with the Mallows rank model, and its finite mixture extension, in a Bayesian framework. The model is grounded on the idea that the probability density of an observed ranking decreases exponentially with the distance to the location parameter. It is the first Bayesian implementation that allows wide choices of distances, and it works well with a large amount of items to be ranked. BayesMallows handles non-standard data: partial rankings and pairwise comparisons, even in cases including non-transitive preference patterns. The Bayesian paradigm allows coherent quantification of posterior uncertainties of estimates of any quantity of interest. These posteriors are fully available to the user, and the package comes with convienient tools for summarizing and visualizing the posterior distributions.

Øystein Sørensen , Marta Crispino , Qinghua Liu , Valeria Vitelli

Supplementary materials

Supplementary materials are available in addition to this article. It can be downloaded at

CRAN packages used

BayesMallows, PerMallows, pmr, rankdist, microbenchmark, dplyr, parallel, tidyr, label.switching

CRAN Task Views implied by cited packages

Databases, ModelDeployment


Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Sørensen, et al., "The R Journal: BayesMallows: An R Package for the Bayesian Mallows Model", The R Journal, 2020

BibTeX citation

  author = {Sørensen, Øystein and Crispino, Marta and Liu, Qinghua and Vitelli, Valeria},
  title = {The R Journal: BayesMallows: An R Package for the Bayesian Mallows Model},
  journal = {The R Journal},
  year = {2020},
  note = {},
  doi = {10.32614/RJ-2020-026},
  volume = {12},
  issue = {1},
  issn = {2073-4859},
  pages = {324-342}