rBT: Sampler for Bradley-Terry Model

Description Usage Arguments Details Value References Examples

View source: R/rBT.R

Description

Given a vector of scores, sample a full ranking from the Bradley-Terry model. The length of the ranking is the same as the length of the score vector.

Usage

1
rBT(S)

Arguments

S

vector of scores

Details

Given two items i and j with scores s_i and s_j respectively, according to Bradley Terry model (Bradley and Terry, 1952), the probability of i ranked higher than j is: e^{s_i} / (e^{s_i} + e^{s_j}). Assuming independence among all pairwise comparisons gives rise to the sampler.

Value

Return a list with two components:

ranks

a vector where the i-th element is the rank assigned to the i-th item.

ranking

a vector where the i-th element is the item ranked in the i-th place

References

Bradley, Ralph Allan, and Milton E. Terry. "Rank analysis of incomplete block designs: I. The method of paired comparisons." Biometrika 39.3/4 (1952): 324-345.

Examples

1
2
3
4
5
6
#random scores with length 10
S = runif(10, 1, 10)
res = rBT(S)

res$ranks
res$ranking

shuxiaoc/agRank documentation built on May 29, 2019, 9:27 p.m.