Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ZeroModifiedPoisson

The Zero-Modified Poisson Distribution


Description

Density function, distribution function, quantile function, random generation for the Zero-Modified Poisson distribution with parameter lambda and arbitrary probability at zero p0.

Usage

dzmpois(x, lambda, p0, log = FALSE)
pzmpois(q, lambda, p0, lower.tail = TRUE, log.p = FALSE)
qzmpois(p, lambda, p0, lower.tail = TRUE, log.p = FALSE)
rzmpois(n, lambda, p0)

Arguments

x

vector of (strictly positive integer) quantiles.

q

vector of quantiles.

p

vector of probabilities.

n

number of values to return.

lambda

vector of (non negative) means.

p0

probability mass at zero. 0 <= p0 <= 1.

log, log.p

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

lower.tail

logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].

Details

The zero-modified Poisson distribution is a discrete mixture between a degenerate distribution at zero and a (standard) Poisson. The probability mass function is p(0) = p0 and

p(x) = (1-p0)/(1-exp(-lambda)) f(x)

for x = 1, 2, ..., λ > 0 and 0 ≤ p0 ≤ 1, where f(x) is the probability mass function of the Poisson. The cumulative distribution function is

P(x) = p0 + (1 - p0) [F(x) - F(0)]/[1 - F(0)].

The mean is (1-p0)m and the variance is (1-p0)v + p0(1-p0)m^2, where m and v are the mean and variance of the zero-truncated Poisson.

In the terminology of Klugman et al. (2012), the zero-modified Poisson is a member of the (a, b, 1) class of distributions with a = 0 and b = λ.

The special case p0 == 0 is the zero-truncated Poisson.

If an element of x is not integer, the result of dzmpois is zero, with a warning.

The quantile is defined as the smallest value x such that P(x) ≥ p, where P is the distribution function.

Value

dzmpois gives the (log) probability mass function, pzmpois gives the (log) distribution function, qzmpois gives the quantile function, and rzmpois generates random deviates.

Invalid lambda or p0 will result in return value NaN, with a warning.

The length of the result is determined by n for rzmpois, and is the maximum of the lengths of the numerical arguments for the other functions.

Note

Functions {d,p,q}zmpois use {d,p,q}pois for all but the trivial input values and p(0).

Author(s)

References

Klugman, S. A., Panjer, H. H. and Willmot, G. E. (2012), Loss Models, From Data to Decisions, Fourth Edition, Wiley.

See Also

dpois for the standard Poisson distribution.

dztpois for the zero-truncated Poisson distribution.

Examples

dzmpois(0:5, lambda = 1, p0 = 0.2)
(1-0.2) * dpois(0:5, lambda = 1)/ppois(0, 1, lower = FALSE) # same

## simple relation between survival functions
pzmpois(0:5, 1, p0 = 0.2, lower = FALSE)
(1-0.2) * ppois(0:5, 1, lower = FALSE) /
    ppois(0, 1, lower = FALSE) # same

qzmpois(pzmpois(0:10, 1, p0 = 0.7), 1, p0 = 0.7)

actuar

Actuarial Functions and Heavy Tailed Distributions

v3.1-2
GPL (>= 2)
Authors
Vincent Goulet [cre, aut], Sébastien Auclair [ctb], Christophe Dutang [aut], Nicholas Langevin [ctb], Xavier Milhaud [ctb], Tommy Ouellet [ctb], Alexandre Parent [ctb], Mathieu Pigeon [aut], Louis-Philippe Pouliot [ctb], Jeffrey A. Ryan [aut] (Package API), Robert Gentleman [aut] (Parts of the R to C interface), Ross Ihaka [aut] (Parts of the R to C interface), R Core Team [aut] (Parts of the R to C interface), R Foundation [aut] (Parts of the R to C interface)
Initial release
2021-03-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.