pick: Individual pairwise trials, teams or individuals

pickR Documentation

Individual pairwise trials, teams or individuals

Description

A consistent suite of functions that give likelihood functions for a single pairwise trial between specified sets of competitors; supercedes trial().

Usage

pick(winners, allplayers)
pass(losers,  allplayers)
beats(winners, losers)
loses(losers, winners)
trial(winners, players, val=1)

Arguments

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 trial()

Details

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).

Author(s)

Robin K. S. Hankin

Examples


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

hyper2 documentation built on June 23, 2026, 5:07 p.m.