Description Usage Arguments Details Value Author(s) References See Also Examples
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.
1 2 3 |
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.
Black2015binGroup
http://chrisbilder.com/grouptesting
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.