Description Usage Arguments Value References Examples
This function calculates the probability for at least one collision in a set of n individuals sampled iid. from a vector of length N with occurrence probabilities as given by the vector p. This is an instance of the birthday problem with unequal occurrence probabilities.
1 | pbirthday_up(n, prob, method = c("R", "Rcpp", "mase1992"))
|
n |
Size of the set |
prob |
Vector containing the occurrence probabilities. The length of |
method |
A string describing which computational method to use. |
A list containing the following elements:
prob
(numeric) The probability for at least one collision
tList
A matrix containing all compositions of singletons, dubletons, each row has the property sum(row * 1:n) == n.
Mase, S. 1992. “Approximations to the Birthday Problem with Unequal Occurrence Probabilities and Their Application to the Surname Problem in Japan.” Ann. Inst. Stat. Math. 44 (3): 479–99. http://www.ism.ac.jp/editsec/aism/pdf/044_3_0479.pdf.
Höhle, M., Happy pbirthday class of 2016, http://staff.math.su.se/hoehle/blog/2017/02/13/bday.html.
Höhle, M., US Babyname Collisions 1880-2014, http://staff.math.su.se/hoehle/blog/2017/03/01/morebabynames.html.
1 2 3 | pbirthday(n=26, classes=365, coincident=2)
pbirthday_up(n=26L, prob=rep(1/365,365), method="R")$prob
pbirthday_up(n=26L, prob=rep(1/365,365), method="Rcpp")$prob
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.