Expected value of order statistics from a beta distribution
Get the expected value of order statistics, E(p(i)), from a beta distribution by specifying an average probability and shape parameters for the beta distribution.
beta.dist(p = 0.05, alpha = 1, beta = NULL, grp.sz = 10, simul = FALSE, plot = FALSE, rel.tol = ifelse(a >= 1, .Machine$double.eps^0.25, .Machine$double.eps^0.1))
p |
average probability, \frac{α}{α + β}. |
alpha |
the alpha parameter for the beta distribution. The details of the specification of alpha are given under 'Details'. |
beta |
the beta parameter for the beta distribution, which is calculated from the average probability, p, if it is not specified. The details of the specification of beta are given under 'Details'. |
grp.sz |
the number of individuals in the group. |
simul |
a logical value indicating whether to use simulation. If simulation is used, the vector of probabilities is found by simulating 10,000 values from a beta distribution with the specified shape parameters. If simulation is not used, the vector of individual probabilities is found using integration. |
plot |
a logical value indicating whether to plot the distribution with p(i) marked. |
rel.tol |
relative tolerance used for integration. |
If alpha = 0, this function uses an extreme value distribution based on a Bernoulli(p) distribution to find the individual probabilities, p_i. If alpha is infinite, this function uses p_i=p for all i.
If beta is not specified, it is calculated from the average probability p as b=a*\frac{1}{p-1}. If beta is specified, this function ignores p unless alpha is infinite.
Depending on the specified probability, alpha level, and overall group size, simulation may be necessary in order to generate the vector of individual probabilities. In this case, the user should specify simul=TRUE and set a seed in order to reproduce results. See Black et al. (2015) for additional details.
A vector of ordered probabilities, p_i.
This function was originally written by Michael S. Black for Black et al. (2015). The function was obtained from http://chrisbilder.com/grouptesting.
Black, M., Bilder, C., Tebbs, J. (2015). “Optimal retesting configurations for hierarchical group testing.” Journal of the Royal Statistical Society. Series C: Applied Statistics, 64(4), 693–710. ISSN 14679876, doi: 10.1111/rssc.12097.
p.vec.func
for generating a vector of individual
risk probabilities for informative group testing (after checking
whether simulation is needed) and Informative.array.prob
for arranging a vector of individual risk probabilities in a matrix
for informative array testing without master pooling.
Other Individual risk probability functions: Informative.array.prob
,
p.vec.func
# This example takes less than 1 second to run. # Estimated running time was calculated using a # computer with 16 GB of RAM and one core of an # Intel i7-6500U processor. set.seed(8791) beta.dist(p=0.05, alpha=1, grp.sz=30) # This example takes less than 1 second to run. # Estimated running time was calculated using a # computer with 16 GB of RAM and one core of an # Intel i7-6500U processor. set.seed(1002) beta.dist(p=0.02, alpha=2, grp.sz=50, simul=TRUE) # This example takes less than 1 second to run. # Estimated running time was calculated using a # computer with 16 GB of RAM and one core of an # Intel i7-6500U processor. set.seed(5732) beta.dist(alpha=2, beta=5, grp.sz=15, plot=TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.