These functions are designed to return likelihood functions, in the
form of lists of hyper2()
objects, for typical order statistics
such as the results of rowing heats or MasterChef tournaments.
Function ggrl()
is an easily-typed alias for
general_grouped_rank_likelihood()
.
Function goodbad()
is a convenience function for ggrl()
in which a bunch of contestants is judged. It returns a likelihood
function for the observation that the members of one subset were
better than those of another. Thus
goodbad(letters[1:3],letters[4:5])
corresponds to the
observation that d
and e
were put into an elimination
trial (and abc
were not).
Function elimination()
gives a likelihood function for situations
where the weakest player is identified at each stage and
subsequently eliminated from the competition. It is intended for
situations like the Great British Bake-off and Masterchef in which the
observation is which player was chosen to leave the show. In this
function, argument all_players
is sensitive to order, unlike
choose_winners()
and choose_losers()
(an integer
n
is interpreted as letters[seq_len(n)]
). Element
i
of all_players
is the \(i^\mathrm{th}\) player
to be eliminated. Thus the first element of all_players
is the
first player to be eliminated (and would be expected to have the
lowest strength). The final element of all_players
is the last
player to be eliminated (or alternatively the only player not to be
eliminated).
Function rank_likelihood()
takes a matrix M
with rows
corresponding to a judge (or race); column names are interpreted as
competitor names. A named vector is coerced to a one-row matrix.
Each row of M
is an order statistic: thus c(3,4,2,1)
means that person 3 came first, person 4 came second, person 2 came
third and person 1 came last. Note that in data frames like
F1_table_2017
, each column is a race.
Function rankvec_likelihood()
takes a character vector of
competitors with the order of elements corresponding to the finishing
order; a Plackett-Luce likelihood function is returned. Thus
v=c("d","b","c","a")
corresponds to d
coming first,
b
second, c
third, and a
fourth. Function
race()
is an arguably more memorable synonym.
An example of race()
is given in inst/rowing.Rmd
, and
examples of ggrl()
are given in inst/loser.Rmd
and
inst/masterchef.Rmd
.