I think this is a poorly chosen data set for exploring the advantages of zero inflated models, because, as you note, there isn't that much zero inflation.
plot(fitted(fm_pois), fitted(fm_zinb))
shows that the predicted values are almost identical.
In data sets with more zero-inflation, the ZI models give different (and usually better fitting) results than Poisson.
Another way to compare the fit of the models is to compare the size of residuals:
boxplot(abs(resid(fm_pois) - resid(fm_zinb)))
shows that, even here, the residuals from the Poisson are smaller than those from the ZINB. If you have some idea of a magnitude of the residual that is really problematic, you can see what proportion of the residuals in each model are above that. E.g. if being off by more than 1 was unacceptable
sum(abs(resid(fm_pois) > 1))
sum(abs(resid(fm_zinb) > 1))
shows the latter is a bit better - 20 fewer large residuals.
Then the question is whether the added complexity of the models is worth it to you.
This works:
fit <- fitdist(vect, "ZIP", start=list(mu=2.4, sigma=0.1),
lower=c(-Inf, 0.001), upper=c(Inf, 1), optim.method="L-BFGS-B")
which gives a likelihood of -7853.122
So @Ben Bolker is correct.
It doesn't work even if I specify lower to be 0, as it would try to evaluate at sigma = 0, which is not supported for ZIP
.
Best Answer
You can get the probability of zero-inflation by
and the mean of the count distribution by
See Appendix C of
vignette("countreg", package = "pscl")
for a few more details.To simulate the distribution, you can either do it manually with
or you can use
rzipois()
from theVGAM
packagewhich essentially also does an
ifelse()
as above but adds a few sanity checks etc.