| pick | R Documentation |
A consistent suite of functions that give likelihood functions for a
single pairwise trial between specified sets of competitors;
supercedes trial().
pick(winners, allplayers)
pass(losers, allplayers)
beats(winners, losers)
loses(losers, winners)
trial(winners, players, val=1)
winners |
Players on the winning team |
losers |
Players on the losing team |
allplayers |
All players, winning and losing |
players, val |
Inputs to (soon to be deprecated) function
|
Consider a competition between two disjoint sets of players,
A=\left\lbrace a_1,\ldots, a_n\right\rbrace and
B=\left\lbrace b_1,\ldots, b_m\right\rbrace.
If A wins the likelihood function will be
\frac{a_1+\cdots+a_n}{a_1+\ldots+a_n+b_1+\ldots+b_m} and if
B wins the likelihood function will be
\frac{b_1+\cdots+b_m}{a_1+\ldots+a_n+b_1+\ldots+b_m}.
We can represent a win for A with either pick(A, c(A,B)) or
beats(A,B); or pass(B, c(A,B)) or loses(B,A)
Function trial() will be deprecated soon. It is an inefficient
synonym for pick().
The trial() function is used in inst/kka.Rmd (but will
shortly be changed).
Robin K. S. Hankin
pick(letters[1:2], letters[1:5]) # field abcde; ab beats cde
pass(letters[1:2], letters[1:5]) # field abcde; ab loses to cde
beats(letters[1:2], letters[3:5]) # field abcde; ab beats cde
loses(letters[1:2], letters[3:5]) # field abcde; ab loses to cde
monster <- "home"
players <- letters[1:4]
H <- hyper2()
H <- H + pick(c("a", "b", monster), c(players, monster))
H <- H + pick(c("a", "d", monster), c(players, monster))
H <- H + pick(c("a", monster), c(players, monster))
H <- H + pass(c("c", "d", monster), c(players, monster))
## above see how pick() / pass() is better.
monster <- "cheating"
## Now new players e and f join the chat:
H <- H + beats(c("a", "e"), c("b", "c"))
H <- H + beats(c("a", "c", monster), c("b", "d"))
H <- H + beats(c("e", "f"), c("a", "b", monster))
H <- H + loses(c("a", "f", monster), c("d", "e"))
## above, see beats/loses are more convenient than pick/pass
H
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.