Density, distribution function, quantile function and random
generation for the Poisson binomial distribution with parameters
size
and prob
.
This is conventionally interpreted as the number of successes in
size * length(prob)
trials with success probabilities prob
.
dpoisbinom(x, size = 1, prob, log = FALSE)ppoisbinom(q, size = 1, prob, lower.tail = TRUE, log.p = FALSE)
qpoisbinom(p, size = 1, prob, lower.tail = TRUE, log.p = FALSE)
rpoisbinom(n, size = 1, prob)
dpoisbinom
gives the density, ppoisbinom
gives the
distribution function, qpoisbinom
gives the quantile function
and rpoisbinom
generates random deviates.
The length of the result is determined by x
, q
, p
or n
.
Vector of quantiles.
The Poisson binomial distribution has size
times the
vector of probabilities prob
.
Vector with the probabilities of success on each trial.
Logical. If TRUE
, probabilities \(p\) are given as
\(\log(p)\).
Logical. If TRUE
(default), probabilities are
\(P(X \le x)\), otherwise, \(P(X > x)\).
Vector of probabilities.
Number of observations.
Jorge Castillo-Mateo
The Poisson binomial distribution with size = 1
and
prob
\(= (p_1,p_2,\ldots,p_n)\) has density
$$p(x) = \sum_{A \in F_x} \prod_{i \in A} p_i \prod_{j \in A^c} (1-p_j)$$
for \(x=0,1,\ldots,n\); where \(F_x\) is the set of all subsets of
\(x\) integers that can be selected from \(\{1,2,\ldots,n\}\).
\(p(x)\) is computed using Hong (2013) algorithm, see the reference below.
The quantile is defined as the smallest value \(x\) such that \(F(x) \ge p\), where \(F\) is the cumulative distribution function.
Hong Y (2013). “On Computing the Distribution Function for the Poisson Binomial Distribution.” Computational Statistics & Data Analysis, 59(1), 41-51. tools:::Rd_expr_doi("10.1016/j.csda.2012.10.006").