pb: Poisson binomial distribution function

View source: R/pb.R

pbR Documentation

Poisson binomial distribution function

Description

pb computes the poisson binomial distribution function using the refined normal approximation.

Usage

pb(k, p, lowertail = TRUE)

Arguments

k

numeric: value where the pdf should be evaluated

p

vector: vector of success probabilities

lowertail

boolean: If TRUE return both upper & lower tail probabilities, if FALSE return only upper tail probability

Details

The Refined Normal Approximation (RNA) offers a close approximation when length(p) is large (Hong, 2013). This function is based on ppoibin() from the poibin package.

Value

vector, length 2: The first value (if lower = TRUE) is the lower tail probability, the probability of observing k or fewer successes when each trial has probability p of success. The second value is the upper tail probability, the probability of observing k or more successes when each trial has probability p of success.

References

Hong, Y. (2013). On computing the distribution function for the Poisson binomial distribution. Computational Statistics and Data Analysis, 59, 41-51. doi: 10.1016/j.csda.2012.10.006

Examples

pb(50,runif(100))

backbone documentation built on Oct. 19, 2022, 1:09 a.m.