I have this vector data and I am trying to find distribution that this data fits.

G2 <- c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,12,6,3,4,3,1,0,0,4,0,0,0,0,0,0,0,

Some descriptive statistics:

Mean    0,934246575
Standard Error  0,147548126
Median  0
Mode    0
Standard Deviation  2,818902989
Sample Variance 7,94621406
Kurtosis    24,09203722
Skewness    4,346481511
Range   26, Minimum 0, Maximum  26, Sum 341, Count  365

Target distribution is a zero inflated negative binomial distribution. I used:

fit_g = fitdist(G2,'nbinom', start = list(mu = 0.94, size = 0.8)) 

for fitting distribution.


enter image description here

If I understand correctly this is related to nbinom (negative binomial distribution)?

Ff I use:

gf2 <- goodfit(G2,type="nbinomial", method = "MinChisq")

and then


enter image description here

Is this proof that my distribution is a zero - inflated negative binomial distribution? If not, what should I do next?


2 Answers 2


You can just try fitting a number of different count distributions and compare their fit, the Poisson (P) and zero-inflated Poisson (ZIP) should definitely also be on your list.

You can test for zero-inflation (between P and ZIP and between negative binomial (NB) and zero-inflated negative binomial (ZINB) with a Wald test or likelihood ratio test (LRT)).

You can test for overdispersion (P vs. NB and ZIP vs. ZINB) with a LRT (remember the test statistic is distributed as $0.5*0 + 0.5* \chi_{(1)}^2$).

The NB and ZIP are non-nested, you can compare them using the AIC or Vuong's test.

Since your variance is much larger than the mean you will need at least overdispersion or zero-inflation to provide an accurate fit.

Do not trust Pearson residuals based methods though since your mean is really small.

  • $\begingroup$ I'm not sure that the test statistic is distributed w/a point mass at 0 and a chi-squared as you state. That result is for test statistic on the boundary of the parameter space. The zero-inflation probability; call is $\phi$ can be a negative number too. While there are limits, i.e. the support of $\phi$ is compact, the support set is not $[0, 1]$ but something larger $[a, 1]$ w/$a<0$ and the value of $a$ depends on if the non-zero inflated part of the distribution is Poissonian or Negative Binomial. $\endgroup$ Sep 11, 2018 at 23:02
  • $\begingroup$ @LucasRoberts I only mention the mixture distribution for the test for overdispersion, for zero-inflation there is indeed no boundary effect. $\endgroup$
    – Knarpie
    Sep 12, 2018 at 8:25
  • $\begingroup$ ah, I missed the overdispersion part. I'm not clear why to test for overdispersion directly. You get overdispersion with the ZIP model for all zero-modified probabilities that are strictly less than 1. Did I miss something? $\endgroup$ Sep 12, 2018 at 14:31

The zero-inflated binomial distribution and the negative binomial distributions are not the same thing. While I am not familiar with the zero-inflated binomial distribution, "zero-inflated" just means that there are more zeros that would normally be expected. The binomial distribution has a fixed maximum, whereas the negative binomial is unbounded at the top. They are different distributions used for different problems.

You can't prove that your distribution is anything. Once you work out what distribution you are trying to fit, your next step is to find the p-value where the null hypothesis is that you have your hypothesised distribution. If that p-value is above 0.05, and there is a good reason to believe that the distribution is applicable, then you are in good shape.

However, looking at the distribution, it does not look like an amazingly good fit, so unless you have strong theory for applying your chosen distirbution, I would suggest investigating other counts distributions as well.

  • 1
    $\begingroup$ I'm glad you are pointing out that hypothesis tests do not prove anything, common misconception with statistical applications. The may give an indication but are by no means proof. $\endgroup$ Sep 11, 2018 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.