| Type: | Package |
| Title: | Aggregation and Consensus Methods for Preference-Approvals |
| Version: | 0.1.0 |
| Description: | 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) <doi:10.1016/j.mathsocsci.2013.10.005>. Methods and applications are described in Albano and Romano (2026) <doi:10.1007/s11634-025-00663-4>. The package is designed to be extended with further methods for ordinal preference data. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Language: | en-GB |
| Depends: | R (≥ 3.5.0) |
| Imports: | ConsRank |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown |
| VignetteBuilder: | knitr |
| LazyData: | true |
| RoxygenNote: | 7.3.3 |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-07-05 09:28:12 UTC; 39346 |
| Author: | Maurizio Romano [aut, cre], Alessandro Albano [aut] |
| Maintainer: | Maurizio Romano <romano.maurizio@unica.it> |
| Repository: | CRAN |
| Date/Publication: | 2026-07-11 09:00:07 UTC |
TheOrdinals: Aggregation and Consensus Methods for Preference-Approvals
Description
Tools for aggregating ordinal preference data into a group consensus. The current release implements DIVA (Divide and Conquer for Preference-Approvals), a distance-based aggregation method for preference-approvals. The package is organised so that further methods for ordinal preference data can be added in future releases.
Preference-approvals
A preference-approval is a pair (\pi, A) where \pi is a (weak)
ranking of n alternatives and A is the subset of approved
alternatives, subject to a consistency condition linking the two components
(Definition 1 of Albano and Romano, 2026). Throughout the package a set of
m preference-approvals is stored as a numeric matrix with 2n
columns: the first n columns hold the ranking (positions, with ties
allowed) and the last n columns hold the approval indicators
(1 approved, 0 not approved).
Main functions
divaCompute the DIVA consensus preference-approval.
diva_sensitivityAverage consensus distance over a grid of the weighting parameter
lambda.pref_distDistance between preference-approvals.
find_approvalAdmissible approvals of a ranking.
pa_universeUniverse of preference-approvals on
nalternatives.is_consistentCheck the preference-approval consistency condition.
Author(s)
Maintainer: Maurizio Romano romano.maurizio@unica.it
Authors:
Alessandro Albano alessandro.albano@unipa.it
References
Albano, A. and Romano, M. (2026). A distance-based aggregation method for finding consensus in preference-approvals. Advances in Data Analysis and Classification. doi:10.1007/s11634-025-00663-4
Erdamar, B., Garcia-Lapresta, J. L., Perez-Roman, D. and Sanver, M. R. (2014). Measuring consensus in a preference-approval context. Mathematical Social Sciences, 39-46. doi:10.1016/j.mathsocsci.2013.10.005
DIVA consensus for preference-approvals
Description
Computes the DIVA (Divide and Conquer for Preference-Approvals) consensus of a
set of preference-approvals. The consensus is the preference-approval that
minimises the average distance pref_dist to the set of voters,
and it is guaranteed to be admissible (its ranking and approval components are
consistent).
Usage
diva(x, search = FALSE, algorithm = "quick", lambda = 0.5, verbose = FALSE)
Arguments
x |
A numeric matrix of preference-approvals with |
search |
Logical; if |
algorithm |
Branch-and-bound or heuristic algorithm used by
|
lambda |
Weight in |
verbose |
Logical; if |
Details
The algorithm first looks for a direct solution in which the consensus ranking
and the consensus approval are already compatible. If none exists, it explores
two branches: from the consensus ranking it derives admissible approvals
(find_approval), and from the consensus approval it derives
admissible rankings by solving the consensus separately within approved and
unapproved alternatives. The branch yielding the smaller average distance is
returned.
Value
An object of class "diva": a list with components
- consensus
Data frame with the consensus preference-approval(s); a ranking component followed by an approval component. More than one row is returned when several solutions are tied.
- d_lambda
The minimised average distance.
- elapsed
A
difftimewith the computing time.- lambda, algorithm, search
The arguments used.
References
Albano, A. and Romano, M. (2026). A distance-based aggregation method for finding consensus in preference-approvals. Advances in Data Analysis and Classification. doi:10.1007/s11634-025-00663-4
See Also
Examples
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)
)
res <- diva(x, algorithm = "quick")
res
res$d_lambda
Sensitivity of the DIVA consensus to the weighting parameter
Description
Computes the minimised average distance of the DIVA consensus over a grid of
values of the weighting parameter lambda, which is useful to assess how
the relative weight of the ranking and approval components affects the
consensus. Unlike diva, only the achieved distance is returned,
not the consensus preference-approval itself.
Usage
diva_sensitivity(
x,
search = FALSE,
algorithm = "quick",
lambda = seq(0, 1, by = 0.1),
verbose = FALSE
)
Arguments
x |
A numeric matrix of preference-approvals with |
search |
Logical; if |
algorithm |
Algorithm used by |
lambda |
Numeric vector of weights in |
verbose |
Logical; if |
Value
A list with components d_lambda (named numeric vector of the
minimised average distances, one per value of lambda) and
lambda (the grid used).
See Also
Examples
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)
)
s <- diva_sensitivity(x)
s$d_lambda
Admissible approvals of a ranking
Description
Given a (weak) ranking, enumerates the approval vectors that are consistent with it, i.e. the approval boundaries that can be placed between consecutive buckets of the ranking. The result combines the ranking with each admissible approval, so that every row is a valid preference-approval.
Usage
find_approval(ranking)
Arguments
ranking |
A numeric vector with the positions of the alternatives in the ranking (ties allowed). |
Value
A data frame with 2n columns and (buckets + 1) rows,
where buckets is the number of distinct positions in ranking.
The first n columns repeat the ranking and the last n columns
hold the admissible approval vectors (from "approve none" to "approve all").
See Also
Examples
find_approval(c(1, 2, 2, 3))
Formula 1 World Championship (1950) preference-approvals
Description
Preference-approval data built from the 1950 Formula 1 World Championship: the classification of each of the 7 Grands Prix is read as a ranking of the 81 drivers, and the top five finishers of each race are taken as approved. Used as a real-data application in Albano and Romano (2026).
Usage
formula1_1950
Format
A numeric matrix with 7 rows (Grands Prix) and 162 columns. The
first 81 columns are the ranking component and the last 81 columns the
approval component (1 approved, 0 not). Both blocks are named
after the drivers.
Source
PrefLib (https://preflib.github.io/PrefLib-Jekyll/); processed in the replication material of Albano and Romano (2026).
References
Albano, A. and Romano, M. (2026). A distance-based aggregation method for finding consensus in preference-approvals. Advances in Data Analysis and Classification. doi:10.1007/s11634-025-00663-4
Examples
data(formula1_1950)
dim(formula1_1950)
French Presidential Election (2002) preference-approvals
Description
Preference-approval data on the 15 candidates of the first round of the 2002 French presidential election, used as a real-data application in Albano and Romano (2026). Each voter provides a ranking of the candidates together with an approval of a subset of them. Only the admissible preference-approvals (those whose ranking and approval are concordant) are retained.
Usage
french_election_2002
Format
A numeric matrix with one row per voter and 30 columns. The
first 15 columns are the ranking component (positions, ties allowed) and the
last 15 columns the approval component (1 approved, 0 not).
Both blocks of columns are named after the candidates' surnames.
Source
Erdamar et al. (2014) and the replication material of Albano and
Romano (2026); original survey data file 00029-00000001.dat.
References
Albano, A. and Romano, M. (2026). A distance-based aggregation method for finding consensus in preference-approvals. Advances in Data Analysis and Classification. doi:10.1007/s11634-025-00663-4
Examples
data(french_election_2002)
dim(french_election_2002)
diva(french_election_2002, algorithm = "quick")
Preference-approval consistency check
Description
Checks whether a ranking and an approval vector form an admissible preference-approval, i.e. whether they satisfy the consistency condition of Definition 1 in Albano and Romano (2026): approved alternatives must be ranked above unapproved ones, and tied alternatives must share the same approval status.
Usage
is_consistent(ranking, approval)
Arguments
ranking |
A numeric vector with the positions of the alternatives in the ranking (ties allowed). |
approval |
A numeric (0/1) vector of the same length as |
Value
A single logical value: TRUE if the pair is a valid
preference-approval, FALSE otherwise.
References
Albano, A. and Romano, M. (2026). A distance-based aggregation method for finding consensus in preference-approvals. Advances in Data Analysis and Classification. doi:10.1007/s11634-025-00663-4
Examples
is_consistent(c(1, 2, 3, 4), c(1, 1, 0, 0))
is_consistent(c(1, 2, 3, 4), c(0, 1, 0, 0))
Small synthetic universe of preference-approvals (n = 4)
Description
The complete universe of preference-approvals on four alternatives, generated
with pa_universe. Provided as a small, fast example for the
documentation and the tests.
Usage
pa_small
Format
A numeric matrix with 8 columns. The first 4 columns are the
ranking component and the last 4 columns the approval component.
See Also
Examples
data(pa_small)
head(pa_small)
Universe of preference-approvals
Description
Generates the full set (universe) of preference-approvals on n
alternatives, by enumerating every weak order on n items (via
univranks) and, for each, all the admissible approval
boundaries (via find_approval).
Usage
pa_universe(n, verbose = FALSE)
Arguments
n |
Number of alternatives. The size of the universe grows very quickly
with |
verbose |
Logical; if |
Value
A data frame with 2n columns, one row per preference-approval.
The first n columns are the ranking component and the last n the
approval component.
See Also
Examples
u <- pa_universe(3)
head(u)
nrow(u)
Distance between preference-approvals
Description
Computes the family of distances d_\lambda for preference-approvals
introduced by Erdamar et al. (2014), a convex combination of the (normalised)
Kemeny distance on the ranking component and the (normalised) Hamming distance
on the approval component.
Usage
pref_dist(x, y = NULL, lambda = 0.5)
Arguments
x |
A numeric matrix (or vector) of preference-approvals with |
y |
An optional second set of preference-approvals in the same format.
If |
lambda |
Weight in |
Value
A numeric matrix of distances. When y is NULL it is the
nrow(x) by nrow(x) matrix of pairwise distances; otherwise it
is the nrow(x) by nrow(y) matrix of distances between the rows
of x and the rows of y.
References
Erdamar, B., Garcia-Lapresta, J. L., Perez-Roman, D. and Sanver, M. R. (2014). Measuring consensus in a preference-approval context. Mathematical Social Sciences, 39-46. doi:10.1016/j.mathsocsci.2013.10.005
See Also
Examples
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)
)
pref_dist(x)
pref_dist(x, lambda = 0.8)