I have 1000 binned data points I would like to fit a poisson distribution to. I define $N_{i}$ to be the number of times I measure $i$ counts in a fixed time period. I calculate the mean $\hat{\mu} = \frac{1}{N_{\mathrm{tot}}} \Sigma_{i} i N_{i}$, and use this to define my fitted distribution.
I would now like to perform a $\chi^{2}$ test to test the goodness of fit. I calculate
$\chi^{2} = \Sigma^{\infty}_{i = 0} \frac{(N_{i} - <N_{i}>)^{2}}{<N_{i}>}$.
Where $i$ is the observed number of counts in some time period, $N_{i}$ is the observed frequency, and $<N_{i}>$ is the frequency predicted by my distribution. I appreciate that this does not account for the non-gaussian error on the counts in each bin.
There is only data in the first 7 bins i.e. $i = 0$ to $6$. However, it is implied that all bins $i \ge 7$ contain zero counts. I therefore get
$\chi^{2} = \Sigma^{6}_{i = 0} \frac{(N_{i} - <N_{i}>)^{2}}{<N_{i}>} + \Sigma^{\infty}_{i = 7} <N_{i}>$.
Which I can calculate, and the last term is only a small contribution.
My question is therefore this: when I go to calculate my confidence levels and things from this chi-squared value, how many degrees of freedom do I have? I have 7 bins with data in, but there are also infinitely many empty bins! Should these be counted? Indeed, is $\chi^{2}$ even the correct test for this data?