ztpois-extensions | R Documentation |
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).
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. |
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 |
parameter |
character. Should the derivative with respect to
|
drop |
logical. Should the result be a matrix ( |
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.
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.
dztpois
, ztpoisson
, dpois
, zerotrunc
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.