set.seed(101)
rho <- t(c(1, 2, 3, 4, 5, 6))
alpha <- 2
metric <- "footrule"
n_items <- 6
get_exponent_sum(
alpha = alpha, rho = rho, n_items = length(rho), rankings = rho,
metric = metric
)
# return 0 because you are comparing the consensus ranking with itself
# if you change alpha or metric, then the result shall remain as 0
rankings <- sample_mallows(
rho0 = rho, alpha0 = alpha, n_samples = 10, burnin = 1000, thinning = 500
)
# depending on your seed, you will get a different collection of rankings in R and C++
get_exponent_sum(
alpha = alpha, rho = rho, n_items = n_items, rankings = rankings ,
metric = metric
)
Run the code above in your browser using DataLab