1
$\begingroup$

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,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,6,0,
        0,0,0,0,0,14,3,3,4,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,0,0,0,0,0,0,0,0,0,4,7,
        3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,6,1,3,1,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,6,6,0,2,1,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,2,26,0,11,
        15,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,9,7,1,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,6,0,0,0,0,0,5,10,0,0,4,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,8,0,0,1,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,2,2,0,0,3,1,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.

plot(fit_g)

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

plot(gf2)

enter image description here

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

$\endgroup$
2
$\begingroup$

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.

$\endgroup$
  • $\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$ – Lucas Roberts Sep 11 '18 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 '18 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$ – Lucas Roberts Sep 12 '18 at 14:31
1
$\begingroup$

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.

$\endgroup$
  • $\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$ – Lucas Roberts Sep 11 '18 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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