ShiftConvolvePoibin {ShiftConvolvePoibin}R Documentation

ShiftConvolve Poisson Binomial

Description

Density, distribution function, quantile function and random generation for the Poisson binomial distribution with the option of using the ShiftConvolvePoibin method.

Usage

dpoisbin(x, probs, method = "ShiftConvolve", log.p = FALSE)

ppoisbin(x, probs, method = "ShiftConvolve", lower.tail = TRUE, log.p = FALSE)

qpoisbin(p, probs, method = "ShiftConvolve", lower.tail = TRUE, log.p = FALSE)

rpoisbin(n, probs)

Arguments

x

Either a vector of observed numbers of successes (or vector of quantiles as dbinom/pbinom refers to) or NULL. If NULL, probabilities of all possible observations are returned.

probs

Vector of probabilities of success of each Bernoulli trial.

method

Character string that specifies the method of computation and must be either "ShiftConvolve" or "DC"

log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

Logical value indicating if results are P[X \le x] (if TRUE; default) or P[X > x] (if FALSE).

p

Vector of probabilities for computation of quantiles.

n

Number of observations. If length(n) > 1, the length is taken to be the number required.

Details

Computing the Poisson Binomial Distribution using ShiftConvolve

A package which uses exponential shifting and Fast Fourier Transformations with the minFFT library to compute the distribution of the Poisson Binomial Distribution

Value

dpoisbin gives the density, ppoisbin computes the distribution function, qpoisbin gives the quantile function and rpoisbin generates random deviates.

References

Peres, N., Lee, A., and Keich, U. (2020). Exactly computing the tail of the Poisson-Binomial Distribution. arXiv:2004.07429

Author(s)

Andrew Ray Lee, Noah Peres and Uri Keich

Examples

set.seed(18)
n=1000
probs <- runif(n)
x <- c(200, 500, 800)
p <- seq(0, 1, 0.01)
dpoisbin(x,probs,method="ShiftConvolve",log.p=FALSE)
ppoisbin(x,probs,method="ShiftConvolve",lower.tail=FALSE,log.p=TRUE)
qpoisbin(p,probs,method="ShiftConvolve",lower.tail=TRUE,log.p=FALSE)
rpoisbin(n,probs)

[Package ShiftConvolvePoibin version 1.0.0 Index]