Density, distribution function, quantile function, and random
generation for the zero-hurdle Poisson distribution with
parameters lambda
and pi
.
Usage
dhpois(x, lambda, pi, log = FALSE)
phpois(q, lambda, pi, lower.tail = TRUE, log.p = FALSE)
qhpois(p, lambda, pi, lower.tail = TRUE, log.p = FALSE)
rhpois(n, lambda, pi)
Arguments
- x
vector of (non-negative integer) quantiles.
- lambda
vector of (non-negative) Poisson parameters.
- pi
vector of zero-hurdle probabilities in the unit interval.
- log, log.p
logical indicating whether probabilities p are given as log(p).
- q
vector of quantiles.
- lower.tail
logical indicating whether probabilities are \(P[X \le x]\) (lower tail) or \(P[X > x]\) (upper tail).
- p
vector of probabilities.
- n
number of random values to return.
Details
All functions follow the usual conventions of d/p/q/r functions
in base R. In particular, all four hpois
functions for the
hurdle Poisson distribution call the corresponding pois
functions for the Poisson distribution from base R internally.
Note, however, that the precision of qhpois
for very large
probabilities (close to 1) is limited because the probabilities
are internally handled in levels and not in logs (even if log.p = TRUE
).