Zero-Truncated-Poisson {countreg}R Documentation

The Zero-Truncated Poisson Distribution

Description

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

Usage

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)

Arguments

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

log, log.p

logical. If TRUE, probabilities p are given as log(p).

lower.tail

logical. If TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].

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

Value

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.

See Also

ztpoisson, dpois, zerotrunc


[Package countreg version 0.2-1 Index]