rhyper3 {hyper2} | R Documentation |
Random hyper3 objects
Description
Various random hyper3 objects, in the context of the race metaphor.
They return “get you going” examples of hyper3
objects.
The defaults correspond to simple but non-trivial with straightforward
interpretations.
The defaults are
pn: c(a=2, b=4, c=2, d=1 ) # numbers (two "a"s, four "b"s etc) ps: c(a=0.3, b=0.1, c=0.2, d=0.4) # strengths
Usage
rwinner3(pn=c(a=2,b=4,c=2,d=1),ps=c(a=0.3, b=0.1,c=0.2,d=0.4))
rpair3(n=5,s=3,lambda=1.3)
rrace3(pn=c(a=2,b=4,c=2,d=1),ps=c(a=0.3, b=0.1,c=0.2,d=0.4))
rracehyper3(n=4,size=9,ps=NULL,races=3)
rhyper3(n=5,s=4,type='race',...)
Arguments
pn |
A named integer vector showing numbers of each type of player |
ps |
A named vector showing strengths of each type of player |
n , size , races , s , type |
Arguments specifying the complexity
of the random |
lambda |
Parameter |
... |
Further arguments passed to |
Details
These functions return hyper3
objects, as indicated by the
3
in their names.
Function
rwinner3()
is a low-level helper function that takes a player number argumentpn
, and a player strength argumentps
. It performs an in silico race, and returns the (name of) the winner, chosen randomly from a field of runners with appropriate strengths. It is used repeatedly byrrace3()
to select a winner from the diminishing pool of still-running players.Function
rpair3()
returns ahyper3
object corresponding to repeated pairwise comparisons including a white-player advantage represented bylambda
.Function
rrace3()
returns a rank statistic corresponding to finishing order for a Plackett-Luce race. The output can be passed toordervec2supp3()
.Function
rracehyper3()
returns a more complicatedhyper3
object corresponding to repeated races.Function
rhyper3()
returns an even more complicatedhyper3
object corresponding to repeated races and pairwise comparisons.
Argument n
generally specifies the number of distinct types of
players. Files inst/mann_whitney_wilcoxon.Rmd
and
inst/javelin.Rmd
show some use-cases for these functions.
Note
In function rracehyper3()
[and by extension rhyper3()
],
if argument n
exceeds 26 and argument pn
takes its
default value of NULL
, then an error will be returned because
there are only 26 players, one for each letter a
-z
.
Author(s)
Robin K. S. Hankin
See Also
rrank
,ordertable2supp
,ordertrans
Examples
rracehyper3()
rrace3()
rwinner3()
rhyper3()
rpair3()
ordervec2supp3(rrace3())
table(replicate(100,which(rrace3(pn=c(a=1,b=10),ps=c(a=0.9,b=0.1))=='a')))