How this calculation works
Fit a two-component model for counts: a logit component for a structural-zero state and a Poisson component that can itself produce zeros. The result separates structural-zero probability, Poisson intensity, overall expected count and total zero probability at query rows. This distinction is useful when an excess-zero mechanism is substantively plausible and adequately identified by the sample.
π_i=logistic(z_iγ), λ_i=exp(x_iβ); P(Y_i=0)=π_i+(1−π_i)e^(−λ_i); P(Y_i=k>0)=(1−π_i)e^(−λ_i)λ_i^k/k!; E[Y_i]=(1−π_i)λ_i.A worked example
Thirty intercept-only records contain fifteen zeros and three repetitions of 1,2,3,4,5. The fit gives Poisson mean 2.821439, structural-zero probability 0.468356 and overall count mean 1.5. Total zero probability is 0.5. For a recorded zero, its model-based posterior structural-zero probability is about 0.936713; this is not an observed label.
Good to know
30–200 nonnegative integer counts ≤100,000 with both zeros and positive observations. Each component has 1–3 explicit full-rank columns including any intercept; ≤2 predictors with intercept. Design values within ±1,000; ≤50 matched query rows. Three-start finite local fit; coefficients within ±20; search-boundary and nonpositive-curvature results rejected. No exposure offset, coefficient intervals, random effects, hurdle model or certainty about row-level zero causes.
Reference: Method reference (opens in a new tab) ↗
Two routes lead to an observed zero
A site may be unable to receive events during some observation periods, while an operational site can still happen to receive none. The first route is represented by the structural-zero state; the second is an ordinary zero from the Poisson component.
The data contain observed counts, not state labels. The fitted mixture describes probabilities of these hidden routes under a particular model. It cannot determine with certainty which process produced an individual zero.
Compare this with the Poisson distribution calculator. An ordinary Poisson probability calculation has no zero-mixture inference.
Separate predictor stories for each component
The count matrix controls intensity conditional on the Poisson state. The zero matrix controls the probability of the structural-zero state. A variable may belong in both matrices, but its coefficient has a different meaning in each.
Include explicit intercept columns when wanted and keep the same observation ordering in both designs. Predictors that perfectly isolate zero records can drive inflation coefficients outward, producing a boundary or weakly identified fit rather than a meaningful very large effect.
How the mixture likelihood is assembled
For a positive count, only the Poisson state contributes, so the mass is multiplied by one minus the inflation probability. For zero, the two state contributions must be added before taking the logarithm.
Computing those terms with log-sum-exp avoids discarding a small contribution when one route dominates. Treating every zero as structural changes the likelihood and biases both components; that shortcut fits a different latent classification scheme.
The supplied thirty-record example
Half the records are zero, but the estimated structural-zero proportion is about 0.4684 rather than 0.5. The Poisson state has intensity about 2.8214, so it contributes a small additional zero probability. Together they reproduce an overall zero probability of 0.5.
The overall expected count is 1.5, equal to the sample mean in this intercept-only example. Reporting 2.8214 as the unconditional mean would overstate it because that number applies only to the Poisson state.
Interpreting the zero-component coefficient
A positive inflation coefficient increases the odds of being in the structural-zero state. A positive count coefficient increases the Poisson-state mean. If a predictor enters both components, these changes can work in opposite directions for the overall mean.
Compare query predictions for π, λ and (1−π)λ together. Exponentiating a count coefficient alone does not give the unconditional rate ratio when the same change also alters inflation probability.
Why too many zeros is not a diagnosis
Overdispersion, unobserved heterogeneity, dependence and a misspecified trend can all produce more zeros than a simple Poisson regression expects. A two-state explanation should have a defensible meaning for the measured process.
Likelihood improvement on the fitted data does not establish that meaning. The page does not run a model-selection test or provide coefficient confidence intervals. Evaluate held-out predictions and zero frequencies across relevant subgroups before using the model operationally.
Unidentified and boundary cases
If almost all counts are zero, many combinations of low intensity and high inflation fit similarly. If zeros are adequately explained by the Poisson component, the inflation probability can approach zero and the logit intercept can diverge.
The bounded routine requires a resolved finite interior candidate and positive local likelihood curvature. Failure is informative: the entered sample does not support the particular finite estimate this page promises. Adding decimal precision to the output would not resolve the ambiguity.
A few questions, answered
Is every zero classified as structural?
No. Zeros have two possible sources. The posterior probability conditional on zero is a model-based probability, not a known class.
Can the two designs use different predictors?
Yes. They must have aligned rows, and query rows must match each component’s fitted columns.
Is this a hurdle regression?
No. The Poisson component retains its own zero probability. A hurdle model treats positive counts through a zero-truncated component.
Does a fit prove zero inflation exists?
No. A stable numerical fit is not a test of the scientific two-process explanation.