Math calculator

Zero-Inflated Calculator

Two kinds of zero.

Two kinds of zero

Insurance claims filed in a year against the policyholder’s age, for three hundred policies. A hundred and twenty-six filed nothing. A plain Poisson regression fitted to the same rows predicts 5.4 such policies — it is short by a factor of twenty-three, because no single rate can produce that many zeros alongside the claim counts that are there. The zero-inflated fit predicts 126.0. It also recovers the claim rate among policyholders who could file: its intercept is 2.4317 against the Poisson’s 2.1030, because the Poisson is averaging claimants with non-claimants and understating both.

300 rows · 126 zeros observed · mean 4.337 · variance 17.823

A plain Poisson predicts 5.4 zeros — 126 are there

That is a factor of 23.41, and no single rate can close it. Splitting the units into a group that could never have an event and a group that could puts 41.9% in the first, predicts 126.0 zeros, and raises the fitted rate among the rest — the count intercept moves from 2.1030 to 2.4317. The Vuong statistic is 15.233.

Zeros observed

126

42.0% of the sample

A Poisson predicts

5.4

a factor of 23.41 out

This model predicts

126.0

after splitting the two groups

Never-event share

41.9%

units that could not have an event

What the extra zeros do to the rate

Count coefficients under the plain Poisson and the zero-inflated fit
TermPlain PoissonIts errorZero-inflated count partIts error
Intercept2.10300.09252.43170.0889
Predictor 1-0.01560.0022-0.01040.0021

The damage is not confined to the zeros. A Poisson forced to account for 126 of them with a single rate drags that rate down for everybody, so it understates the expected count among the units that genuinely could have events. The zero-inflated count part describes those units only, and its expected count is 11.378 at the baseline.

Which model the data prefers

Model comparison statistics between the plain Poisson and the zero-inflated fit
QuantityValueReading
Poisson log-likelihood-1,101.582the simpler model
Zero-inflated log-likelihood-609.704one extra parameter
Vuong statistic15.233p = 2.123314e-52
Zeros the gap accounts for120.6observed minus Poisson-predicted
Mean and variance of the counts4.337 / 17.823overdispersed as well

Vuong compares two models that are not nested by testing whether their per-observation log-likelihoods differ systematically. Above about 1.96 it favours the zero-inflated fit and below −1.96 the plain one; in between it is not choosing. It is a useful summary rather than a verdict, and the predicted zero counts above are the more direct evidence.

On data with no inflation the mixing probability comes back at zero and the count coefficients become identical to the plain Poisson ones — the suite confirms they agree to 1e-8 with the predicted zero counts matching. The extra parameter collapses rather than distorting the fit, which is why it is safe to check for.

Excess zeros can also come from counts that are simply more variable than Poisson, with no separate population at all. A negative binomial fit often absorbs them without needing two groups, and comparing its predicted zeros with these is the way to tell which story the data supports.

Observed against predicted zeros Poisson beside it Rate among those at risk Vuong comparison A no-inflation preset

What this tool shows

The preset has 126 zeros. A plain Poisson regression on the same rows predicts 5.4 of them. A factor of twenty-three, and no single rate can close it — the same rate that produces the claim counts that are present cannot also produce that many policies with none. The damage reaches the rest of the fit too: forced to account for those zeros, the Poisson drags its intercept down to 2.1030 where the zero-inflated model recovers 2.4317. It understates the rate among the units that could have had events, because it is averaging them with units that never could.

  • The zeros a plain Poisson predicts against the zeros actually present, on every run
  • The mixing probability: the share of units that could never have had an event
  • The count rate among the units that could, which a plain Poisson understates
  • A Vuong comparison between the two non-nested models
  • A preset with no inflation where the model collapses onto the plain Poisson exactly
  • How to tell excess zeros from ordinary overdispersion
Observed vs predicted zeros Poisson beside it Rate among those at risk Vuong comparison

A zero can mean “none this year” or “never possible”. They are different data.

Updated 13 September 2026 · Works in any browser, no installation

A zero-inflated model splits the zeros into two kinds: units that could have had an event and happened not to, and units that could never have had one at all. A single count model has to explain every zero with one rate, and when a real population of never-events exists no rate fits — it is either too low to produce the counts that are there or too high to produce the zeros. The mixture handles both, and reports how large the never-event group is.

At a glance

Formula shown
The model is P(Y = 0) = π + (1 − π)·e^(−μ) and P(Y = k) = (1 − π)·e^(−μ)μᵏ/k! for k > 0, where π is the probability of belonging to the never-event group and μ is the Poisson rate among the rest. Setting π = 0 returns the plain Poisson exactly. Fitted here by expectation-maximisation: the E step assigns each zero a probability of being structural, the M step refits π as their average and μ as a weighted Poisson.
Scenario support
Insurance claims where many policies never claim, doctor visits where some people never attend, purchases where most visitors never buy, defects where some batches are inspected differently, and any count whose zeros include units that were never at risk.
Educational estimate
Planning support from the values you enter — not professional advice.

Where the zeros come from

Three hundred insurance policies, a hundred and twenty-six of which filed nothing all year. A plain Poisson regression fitted to those rows predicts 5.4 policies with no claims.

The arithmetic behind that gap is worth following. The policies that did claim filed several claims each, so the fitted rate has to be high enough to produce those counts. At that rate, the chance of any given policy filing nothing is small, and multiplying it across three hundred policies gives 5.4. The model is not making an error; it is doing the only thing a single-rate model can do with data that has two populations in it.

Splitting them resolves it. The zero-inflated fit puts 41.9% of policies in a group that could not file at all, models the rest with a Poisson, and predicts 126.0 zeros against 126 observed.

The part worth noticing is what happens to the rate. The Poisson intercept is 2.1030; the zero-inflated count intercept is 2.4317. The plain model was not just wrong about the zeros — it was understating the claim rate among policyholders who could claim, because it averaged them with policyholders who never could. Anyone using that fit to price risk for an active claimant would be using a number pulled down by a population that is not in the calculation at all.

Excess zeros, or just more spread

Not every pile of zeros needs two populations. Counts that are simply more variable than a Poisson allows also produce more zeros than a Poisson expects, and the fix there is a different variance function rather than a mixture.

The distinction is substantive before it is statistical. It asks what a zero means. If every unit could in principle have had an event and some had none, the population is one and the rates vary — that is overdispersion, and a negative binomial fit is the right shape. If some units were never at risk — policies without that cover, patients not eligible, visitors who came to read rather than buy — the population is two and a mixture is the right shape.

The empirical check is to fit both and compare predicted zeros against observed. A negative binomial that matches the zero count has explained them with spread alone and needs no second group. One that still falls well short is evidence of a separate source.

Both can be true at once, which is what a zero-inflated negative binomial is for. The mixture here uses a Poisson count part, so if the counts among the at-risk units are themselves overdispersed this model handles the zeros and not the spread. The mean and variance of the counts are printed for that reason.

Comparing models that are not nested

The zero-inflated model contains the Poisson as the case π = 0, which looks like a nested comparison and is not quite one, because that value sits on the boundary of the parameter space. A likelihood ratio test against the ordinary chi-square distribution is therefore the wrong test.

Vuong’s statistic sidesteps that by comparing the two models observation by observation: compute each one’s log-likelihood contribution for every row, take the differences, and test whether their mean is distinguishable from zero. Above about 1.96 it favours the zero-inflated fit; below −1.96 it favours the plain one; in between it is declining to choose.

It should be read as a summary rather than a verdict. Its behaviour in exactly this comparison has been criticised, and the more direct evidence is sitting in the table above it — observed zeros against predicted zeros, where a factor of twenty-three needs no test to interpret. The statistic is reported because it is what readers will expect, not because it is doing the work.

What it does when there is nothing to find

The second preset is the same design at a lower rate, where every zero is an ordinary quiet year. Fifty-three zeros observed, and a plain Poisson predicts 58.6 — slightly more than are there, which is sampling variation and nothing else.

The mixing probability comes back at exactly 0.0000 and the count coefficients become identical to the Poisson ones to every digit displayed. The suite confirms the same behaviour across generated datasets: mixing below 0.05, coefficients agreeing to 0.03, predicted zero counts within 1.5 of each other.

That matters because it makes the check cheap. An extra parameter that collapses to zero when it is unnecessary costs nothing but a line of output, so there is no reason not to look. The Vuong statistic of −1.44 on that preset correctly prefers the simpler model, which is the behaviour you want from a comparison statistic on data with nothing to report.

Reporting it

Report observed zeros against predicted zeros under both models. It is the clearest evidence for or against the mixture and needs no statistical vocabulary to read: 126 against 5.4 makes the case on its own.

Say which population the count coefficients describe. They are the rate among units that could have had events, not the rate overall, and a reader who takes them as the population rate will overstate it. If the marginal expected count is what matters, it is (1 − π) times the count rate, and that product is the number to give.

Describe the never-event group substantively if you can. A mixing probability of 41.9% is a claim that roughly two in five units were never at risk, and if that is not plausible on the ground, the model is fitting excess zeros that have some other cause — overdispersion, a missing predictor, or a measurement problem — and the mixture is a curve fit rather than a description.

Sources and methodology

References for the mixture model and the comparison statistic.

Method. The mixture is fitted by expectation-maximisation: the E step assigns each zero a posterior probability of being structural, and the M step updates the mixing probability as their mean and the count coefficients by a weighted Poisson fit. Predicted zero counts are computed from the fitted model rather than tallied, so the comparison with the observed count is a genuine out-of-sample-style check on the shape. The suite confirms the model collapses onto the plain Poisson when there is no inflation — mixing below 0.05, coefficients agreeing to 0.03 and predicted zeros within 1.5 — and that the zero-inflated fit always lands at least as close to the observed zero count as the Poisson does. That engine is verified on every change against 490 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Negative Binomial RegressionFit a negative binomial model to overdispersed counts, with the Poisson fit beside it and the ratio between their standard errors per coefficient.
Poisson RegressionPoisson regression with rate ratios, the Pearson dispersion check, and quasi-Poisson standard errors printed beside the Poisson ones for every coefficient.
Poisson DistributionPoisson probabilities with a dispersion test against your own variance — because a Poisson forces variance to equal the mean, and real count data usually does not, which is exactly where the tail goes wrong.
Negative BinomialShows both conventions at once — failures before the rth success and total trials differ by exactly r, so the same k gives two answers 32% apart and nobody says which they meant.
Goodness of FitChi-square with per-cell contributions and standardised residuals, plus a measured answer to the “expected at least 5” rule — below the floor the test is CONSERVATIVE (3.27% at 2 per cell), not liberal.
Logistic RegressionLogistic regression with odds ratios converted to risk ratios at your own event rate, a likelihood ratio test, AUC, and separation reported rather than hidden.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. The count part here is Poisson, so counts that are also overdispersed among at-risk units need a zero-inflated negative binomial rather than this model. The Vuong statistic has known limitations for exactly this comparison and is reported as a summary rather than a decision rule. A fitted mixing probability is only meaningful if a never-event group plausibly exists in the data.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Published a zero-inflated Poisson fit by expectation-maximisation.
  2. Printed the zeros a plain Poisson would predict against the zeros actually present, 5.4 against 126.
  3. Showed the count rate the plain Poisson understates by averaging two populations together.
  4. Added a Vuong comparison and stated its known limitations for this exact comparison.
  5. Shipped a preset with no inflation where the model collapses onto the plain Poisson exactly.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.