rank_freq_distr: Frequency distribution of the ranking sequences

View source: R/rank_freq_distr.R

rank_freq_distrR Documentation

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.

See Also

Other rank functions: expected_dist(), get_mallows_loglik(), rank_conversion, rank_distance(), sample_mallows()

Examples

# 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)

BayesMallows documentation built on Nov. 25, 2023, 5:09 p.m.