MLE of the zero inflated and zero truncated Poisson:
MLE of the zero inflated and zero truncated Poisson
Description
MLE of the zero inflated and zero truncated Poisson.
Usage
zip.mle(x, tol = 1e-09)
ztp.mle(x, tol = 1e-09)
Arguments
x
A vector with discrete valued data.
tol
The tolerance level up to which the maximisation stops set to 1e-09 by default.
Value
A list including:
A list including:
Details
Instead of maximising the log-likelihood via a numerical optimiser we used a Newton-Raphson algorithm which is faster.
See wikipedia for the equation to be solved in the case of the zero inflated distribution. https://en.wikipedia.org/wiki/Zero-inflated_model.
In order to avoid negative values we have used link functions, log for the $lambda$ and logit for the $\pi$ as suggested by Lambert (1992).
As for the zero truncated Poisson see https://en.wikipedia.org/wiki/Zero-truncated_Poisson_distribution.
References
Lambert Diane (1992). Zero-Inflated Poisson Regression, with an Application to Defects in
Manufacturing. Technometrics. 34 (1): 1-14
Johnson Norman L., Kotz Samuel and Kemp Adrienne W. (1992). Univariate Discrete
Distributions (2nd ed.). Wiley
x <- rpois(100, 2)
zip.mle(x)
## small difference in the two log-likelihoods as expected.x <- rpois(1000, 10)
x[x == 0 ] <- 1ztp.mle(x)
## significant difference in the two log-likelihoods.