Learn R Programming

BayesMallows (version 1.1.0)

rank_freq_distr: Frequency distribution of the ranking sequences

Description

Construct the frequency distribution of the distinct ranking sequences from the dataset of the individual rankings. This can be of interest in itself, but also used to speed up computation by providing the obs_freq argument to compute_mallows.

Usage

rank_freq_distr(rankings)

Arguments

rankings

A matrix with the individual rankings in each row.

Value

Numeric matrix with the distinct rankings in each row and the corresponding frequencies indicated in the last (n_items+1)-th column.

Examples

Run this code
# NOT RUN {
# Create example data. We set the burn-in and thinning very low
# for the sampling to go fast
data0 <- sample_mallows(rho0 = 1:5, alpha=10, n_samples = 1000,
                        burnin = 10, thinning = 1)
# Find the frequency distribution
rank_freq_distr(rankings=data0)
# }

Run the code above in your browser using DataLab