Poisson goodness-of-fit test: are your defect counts Poisson?
The goodness-of-fit test for Poisson checks whether a set of counts, such as flaws per roll, defects per board or calls per hour, behaves like a Poisson distribution. It estimates the mean count from the data, works out how many units should show 0, 1, 2, … events if the counts were Poisson, and compares those expected numbers with the observed ones in a chi-square test. A small p-value says the counts are not Poisson, usually because events cluster.
When to use it
- Before using a C chart or U chart, whose limits assume Poisson counts.
- Before a Poisson rate test or a Poisson capability analysis.
- When you suspect that defects come in clusters (one bad spot produces several) or that some units are much more defect-prone than others.
- To check a reliability or arrival-count model before using it for planning.
How it works
The Poisson distribution describes counts of independent events that occur at a constant average rate. Its variance equals its mean, which is the property most often violated in practice.
- H₀: the counts follow a Poisson distribution.
- H₁: they do not.
Steps:
- Estimate the mean count: λ̂ = total events / number of units.
- For each count value k, compute the Poisson probability and the expected number of units:
Eₖ = n · e^(−λ̂) λ̂ᵏ / k!- Put all counts from some value upward into a final "k or more" category, using 1 minus the cumulative probability.
- Combine adjacent categories until every expected count is at least 5 (a common rule; some sources accept a few cells between 1 and 5).
- Compute the chi-square statistic over the m categories:
χ² = Σ (Oₖ − Eₖ)² / Eₖ, df = m − 1 − 1One degree of freedom is lost because the expected counts must add up to n, and one more because λ was estimated from the data.
A quick companion check is the dispersion index, the variance of the counts divided by their mean. It is near 1 for Poisson data, well above 1 when events cluster (overdispersion), and below 1 when they are more regular than random.
Example
A weaving mill inspects every 50 m roll of a technical fabric for flaws. Before setting up a C chart, the quality engineer checks whether flaw counts are Poisson. Over 100 rolls the counts were:
| Flaws per roll | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Number of rolls | 24 | 25 | 27 | 17 | 5 | 2 |
The total is 160 flaws on 100 rolls, so λ̂ = 1.60. The expected numbers of rolls with 4 and with 5 or more flaws are 5.51 and 2.37, so they are combined into one "4 or more" category with an expected count of 7.88:
| Flaws | 0 | 1 | 2 | 3 | 4 or more |
|---|---|---|---|---|---|
| Observed | 24 | 25 | 27 | 17 | 7 |
| Expected | 20.19 | 32.30 | 25.84 | 13.78 | 7.88 |
| (O − E)²/E | 0.719 | 1.651 | 0.052 | 0.751 | 0.099 |
- χ² = 0.719 + 1.651 + 0.052 + 0.751 + 0.099 = 3.27.
- df = 5 categories − 1 − 1 = 3.
- p-value = P(χ²₃ ≥ 3.27) = 0.35.
- Dispersion index: variance 1.616 / mean 1.60 = 1.01.
How to read the results
- The p-value of 0.35 gives no evidence against the Poisson model. The dispersion index of 1.01 agrees: the counts vary about as much as Poisson counts should.
- The largest contribution comes from rolls with exactly 1 flaw (25 observed, 32.3 expected). That is the kind of difference chance produces in 100 rolls, not a pattern.
- In practice, the engineer can use a C chart with limits 1.60 ± 3√1.60, that is a center line of 1.60 and an upper limit of 5.39 flaws per roll (the lower limit is 0).
- If the test had failed with a dispersion index well above 1, the C chart limits would be too tight and produce false alarms. Look for the cause of clustering (a loom that produces flaws in bursts, a bad yarn lot), and consider a Laney U′ chart if overdispersion is a stable feature of the process.
Common mistakes
- Leaving cells with tiny expected counts. A cell with an expected count of 0.5 and one observed unit adds 0.5 to χ², and a few such cells can make a good fit look bad. Combine the tail.
- Forgetting the degree of freedom for λ. With λ estimated from the data, df is the number of categories minus 2, not minus 1. Using the wrong df makes the test too lenient.
- Testing counts from units of different size. Rolls of 50 m and 100 m have different means. Use units of equal size, or work with rates and a U chart.
- Treating a pass as proof. With few units, the test cannot detect moderate overdispersion. The dispersion index and knowledge of the process are part of the answer.
Frequently asked questions
Why combine categories?
The chi-square approximation to the distribution of the statistic is poor when expected counts are small. Combining the sparse tail categories keeps it reliable. The rule of thumb used here is an expected count of at least 5 in every category.
What does overdispersion mean?
That the counts vary more than a Poisson distribution with the same mean would. It usually means events cluster, or that the rate differs from unit to unit. Control limits and tests based on the Poisson model are then too narrow.
Can I test against a known mean instead of the sample mean?
Yes. If λ is given in advance (for example, from a specification or a long history), use it to compute the expected counts and do not subtract the extra degree of freedom: df = m − 1. This is the general chi-square goodness-of-fit test.
How many units do I need?
Enough that several categories have expected counts of 5 or more. With a mean around 1 to 3, about 50 to 100 units is a practical minimum.