ztpois: Extension of the Zero-Truncated Poisson Distribution

ztpois-extensionsR Documentation

Extension of the Zero-Truncated Poisson Distribution

Description

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).

Usage

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)

Arguments

x

vector of (positive integer) quantiles.

lambda

vector of (non-negative) means of the untruncated Poisson distribution. Only one of lambda or mean should be specified.

mean

vector of means (greater than 1) of the zero-truncated Poisson distribution. Only one of lambda or mean should be specified.

parameter

character. Should the derivative with respect to "lambda" or "mean" be computed?

drop

logical. Should the result be a matrix (drop = FALSE) or should the dimension be dropped (drop = TRUE, the default)?

Details

The untruncated Poisson distribution has density

f(x) = \frac{\lambda^x e^{-\lambda}}{x!}

for x = 0, 1, 2, \ldots. The zero-truncated density is then simply obtained as

g(x) = \frac{f(x)}{1 - f(0)}

for x = 1, 2, \ldots.

The zero-truncated distribution has expectation E(X) = \mu = \lambda / (1 - \exp(-\lambda)) and variance Var(X) = \mu \cdot (\lambda + 1 - \mu), where \lambda is the expectation of the untruncated Poisson distribution.

Despite the simple form of the transformation \mu(\lambda) the inverse \lambda(\mu) has no closed-form solution and is computed numerically if needed.

Value

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.

See Also

dztpois, ztpoisson, dpois, zerotrunc


countreg documentation built on Dec. 4, 2023, 3:09 a.m.