Zero-Truncated-Poisson {countreg} | R Documentation |
Density, distribution function, quantile function, random
generation, score function, hessian, mean, and variance
for the zero-truncated Poisson
distribution with parameter lambda
(= mean of the
untruncated distribution) or mean
(= of the truncated
distribution).
dztpois(x, lambda, mean, log = FALSE) pztpois(q, lambda, mean, lower.tail = TRUE, log.p = FALSE) qztpois(p, lambda, mean, lower.tail = TRUE, log.p = FALSE) rztpois(n, lambda, mean) sztpois(x, lambda, mean, parameter = "lambda", drop = TRUE) hztpois(x, lambda, mean, parameter = "lambda", drop = TRUE) mean_ztpois(lambda, mean, drop = TRUE) var_ztpois(lambda, mean, drop = TRUE)
x |
vector of (positive integer) quantiles. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of random values to return. |
lambda |
vector of (non-negative) means of the untruncated
Poisson distribution. Only one of |
mean |
vector of means (greater than 1) of the zero-truncated
Poisson distribution. Only one of |
log, log.p |
logical. If |
lower.tail |
logical. If |
parameter |
character. Should the derivative with respect to
|
drop |
logical. Should the result be a matrix ( |
The untruncted Poisson distribution has density
f(x) = λ^x exp(-λ)/x!
for x = 0, 1, 2, …. The zero-truncted density is then simply obtained as
g(x) = f(x)/(1 - f(0))
for x = 1, 2, ….
The zero-truncated distribution has expectation E(X) = μ = λ / (1 - \exp(-λ)) and variance Var(X) = μ \cdot (λ + 1 - μ), where λ is the expectation of the untruncated Poisson distribution.
Despite the simple form of the transformation μ(λ) the inverse λ(μ) has no closed-form solution and is computed numerically if needed.
dztpois
gives the (log) density,
pztpois
gives the (log) distribution function,
qztpois
gives the quantile function,
rztpois
generates random deviates, and
sztpois
gives the score function (= derivative of
the log-density with respect to lambda or mean).
hztpois
gives the hessian (= 2nd derivative of
the log-density with respect to lambda or mean).
mean_ztpois
and var_ztpois
give the mean
and the variance, respectively.