Expected value of metrics under a Mallows rank model
Source:R/expected_dist.R
compute_expected_distance.Rd
Compute the expectation of several metrics under the Mallows rank model.
Usage
compute_expected_distance(
alpha,
n_items,
metric = c("footrule", "spearman", "cayley", "hamming", "kendall", "ulam")
)
Value
A scalar providing the expected value of the metric
under the
Mallows rank model with distance specified by the metric
argument.
See also
Other rank functions:
compute_observation_frequency()
,
compute_rank_distance()
,
create_ranking()
,
get_mallows_loglik()
,
sample_mallows()
Examples
compute_expected_distance(1, 5, metric = "kendall")
#> [1] 4.177277
compute_expected_distance(2, 6, metric = "cayley")
#> [1] 3.212053
compute_expected_distance(1.5, 7, metric = "hamming")
#> [1] 5.761023
compute_expected_distance(5, 30, "ulam")
#> [1] 21.33016
compute_expected_distance(3.5, 45, "footrule")
#> [1] 377.5987
compute_expected_distance(4, 10, "spearman")
#> [1] 7.220669