Poisson-Binomial {poisbinom}R Documentation

The Poisson Binomial Distribution

Description

Probability mass, distribution, quantile and function, and random number generator for the Poisson-Binomial distribution with parameter vector pp (the probability parameter of the component Binomial random variables).

Usage

dpoisbinom(x, pp, log_d = FALSE)
ppoisbinom(q, pp, lower_tail = TRUE, log_p = FALSE)
qpoisbinom(p, pp, lower_tail = TRUE, log_p = FALSE)
rpoisbinom(n,pp)

Arguments

x, q

vector of quantiles.

p, pp

vector of probabilities.

n

number of random deviates.

log_d, log_p

logical; if TRUE, probabilities are given in the log scale.

lower_tail

logical; if TRUE (default), probabilities are Pr(X \leq x), otherwise, Pr(X > x).

Details

The Poisson-Binomial distribution is the distribution of a sum of n independent and not identically distributed Binomial random variables. It is parameterized by the vector of n possibly distinct probability parameters of these Binomial distributions, and is computed using a discrete Fourier transform. See Hong (2013) for details.

Value

dpoisbinom gives the mass, ppoisbinom gives the distribution function, qpoisbinom gives the quantile function and rpoisbinom generates random deviates.

If pp contains values outside of [0,1], an error is returned.

The length of the result is determined by n in rpoisbinom, and is the length of the first argument for all other functions.

Author(s)

Shiraito, Y. and Olivella, S. (2017).

References

Hong, Y. (2013) “On computing the distribution function for the Poisson binomial distribution”. Computational Statistics and Data Analysis, 59, 41–51.

Examples

## Binomial probabilities
pp <- runif(500)

## PMF
dpoisbinom(36, pp)

## CDF
ppoisbinom(36, pp)

## Quantile function
qpoisbinom(0.3, pp)

## Random deviates
rpoisbinom(5, pp)

[Package poisbinom version 1.0.1 Index]