Learn R Programming

binGroup (version 2.2-1)

p.vec.func: Generate a vector of probabilities for informative group testing algorithms.

Description

Generate a vector of individual risk probabilities using an overall probability of disease (i.e., the expected value of order statistics from a beta distribution) for use with informative group testing algorithms.

Usage

p.vec.func(p, alpha, grp.sz)

Arguments

p

overall probability of disease that will be used to generate a vector of individual risk probabilities.

alpha

a shape parameter for the beta distribution that specifies the degree of heterogeneity for the generated probability vector.

grp.sz

the number of total individuals for which to generate risk probabilities.

Value

A vector of individual risk probabilities.

Details

This function uses Michael Black's beta.dist function to generate a vector of individual risk probabilities, ordered from least to greatest. Depending on the specified probability, alpha level, and overall group size, simulation may be necessary in order to generate the vector of individual probabilities. For this reason, the user should set a seed in order to reproduce results. The p.vec.func function augments the beta.dist function by checking whether simulation is needed before attempting to generate the vector of individual risk probabilities. See Black et al. (2015) for additional details on Michael Black's beta.dist function.

References

Black2015binGroup

See Also

Informative.array.prob for arranging a vector of individual risk probabilities in a matrix for informative array testing without master pooling and beta.dist for the function on which p.vec.func is based on.

http://chrisbilder.com/grouptesting

Other Individual risk probability functions: Informative.array.prob, beta.dist

Examples

Run this code
# NOT RUN {
# 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)
p.vec.func(p=0.03, alpha=0.5, grp.sz=100)

# 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(52613)
p.vec.func(p=0.005, alpha=2, grp.sz=40)
# }

Run the code above in your browser using DataLab