Tools for aggregating ordinal preference data into a group
consensus. The package implements DIVA (Divide and Conquer for
Preference-Approvals), a distance-based aggregation method for
preference-approvals, that is, preference data in which voters express
both a (weak) ranking and an approval of the alternatives. The consensus
is the preference-approval minimising the average distance to the set of
voters, measured through the family of distances of Erdamar, Garcia-Lapresta,
Perez-Roman and Sanver (2014)
TheOrdinals provides aggregation and consensus methods for ordinal preference
data. The first release implements DIVA (Divide and Conquer for
Preference-Approvals), a distance-based aggregation method introduced in:
Albano, A. and Romano, M. (2026). A distance-based aggregation method for finding consensus in preference-approvals. Advances in Data Analysis and Classification. https://doi.org/10.1007/s11634-025-00663-4
The package is designed to grow: further methods for ordinal preference data can be added in future releases.
A preference-approval is a pair (ranking, approval): a (weak) ranking of n
alternatives together with the subset of approved alternatives, subject to a
consistency condition that links the two components. A set of m
preference-approvals is stored as a numeric matrix with 2n columns: the first
n columns hold the ranking (positions, ties allowed) and the last n columns
hold the approval indicators (1 approved, 0 not approved).
# install.packages("ConsRank")
# from a local clone of the package directory:
# install.packages("TheOrdinals", repos = NULL, type = "source")
library(TheOrdinals)
# four voters over four alternatives
x <- rbind(
c(1, 2, 3, 4, 1, 1, 0, 0),
c(2, 1, 3, 4, 1, 0, 0, 0),
c(1, 2, 4, 3, 1, 1, 0, 0),
c(1, 3, 2, 4, 1, 1, 1, 0)
)
# DIVA consensus
res <- diva(x, algorithm = "quick")
res
res$d_lambda # achieved average distance
# sensitivity to the ranking/approval weight
diva_sensitivity(x)$d_lambda
# distance between preference-approvals
pref_dist(x, lambda = 0.5)
| Function | Purpose |
|---|---|
diva() |
DIVA consensus preference-approval |
diva_sensitivity() |
Average consensus distance over a grid of lambda |
pref_dist() |
Distance between preference-approvals (Erdamar et al., 2014) |
find_approval() |
Admissible approvals of a ranking |
pa_universe() |
Universe of preference-approvals on n alternatives |
is_consistent() |
Check the preference-approval consistency condition |
french_election_2002 — preference-approvals on 15 candidates (2002 French
presidential election).formula1_1950 — rankings of 81 drivers across 7 Grands Prix, top-5 approved
(1950 Formula 1 World Championship).pa_small — small synthetic universe (n = 4) for quick examples.GPL-3.