I'm trying to fit the data with 0s with Poisson, Negative Binomial, Zero-inflated Poisson and Zero-inflated negative binomial and discuss which model is more desired. When I'm trying to calculate the zero proportion from the model, I found that ZIP models the zero proportion exact the same with the original zero proportion. So my questions are:
Is there a reason to explain this situation? I would assume ZIP is overfitting since the AIC is not the smallest but I'm not sure about it.
If ZIP is overfitting, is there a way I can prove it? I don't think I can use a test dataset since I only have the intercept.
library(MASS)
library(pscl)
arr = c(rep(0,2387), rep(1,273), rep(2,36), rep(3,3), rep(4,3))
po = glm(arr ~ 1, family = 'poisson')
mu_po = exp(coef(po))
nb = glm.nb(arr ~ 1)
mu_nb = exp(coef(nb))
alpha_nb = 1/nb$theta
zpo = zeroinfl(as.numeric(arr) ~ 1|1, dist = "poisson")
mu_zpo = exp(coef(zpo)[1])
pi_zpo = exp(coef(zpo)[2])/(1+exp(coef(zpo)[2]))
znb = zeroinfl(arr ~ 1|1, dist = "negbin")
mu_znb = exp(coef(znb)[1])
pi_znb = exp(coef(znb)[2])/(1+exp(coef(znb)[2]))
alpha_znb = 1/znb$theta
#zero proportion
data.frame(true = sum(arr==0)/length(arr),
poisson = exp(-mu_po),
NB = (1+alpha_nb*mu_nb)^(-1/alpha_nb),
ZIP = pi_zpo+(1-pi_zpo)*exp(-mu_zpo) ,
ZINB = pi_znb+(1-pi_znb)*
(1+alpha_znb*mu_znb)^(-1/alpha_znb))
#AIC
data.frame(poisson = AIC(po), NB = AIC(nb), ZIP = AIC(zpo),
ZINB = AIC(znb))