Exact, narrow and fast: Use the Gaffke confidence interval for the mean of a discrete bounded variable
Louis Abraham
Key points
From the paper's conclusion- So the interval is exact, narrow and fast, and we recommend it.
Abstract
Survey ratings, test scores and many other data take a few known values, and we often want a confidence interval for their mean. For small samples, or for means close to the smallest or largest value, the usual intervals cover the true mean much less often than they claim. The interval of Gaffke generalizes the Clopper-Pearson interval to any finite set of values, and a recent proof of Gaffke's conjecture shows that its coverage is at least the nominal level for every sample size and every distribution. Its endpoints, however, are quantiles of a weighted sum of Dirichlet variables, with no closed form. This note makes three contributions. First, a fast and accurate algorithm for the endpoints: a Fourier inversion integral on a line through the saddle point gives tail probabilities with a small relative error, a Gauss-Legendre rule on geometric panels converges at the same rate wherever the singularities are, and a Newton iteration needs 2.6 evaluations per endpoint on average. The cost is $O(kN)$ operations for $k$ values and $N$ quadrature nodes, and $N$ does not grow with the sample size, so an interval takes less than a millisecond for any $n$. Second, an experimental comparison with the published intervals: for $n \le 30$, the Gaffke interval is the shortest of the intervals that keep the level, 17 to 20% shorter than the betting interval of Waudby-Smith and Ramdas and 19 to 37% shorter than Anderson's, while the shorter intervals (Wald, Student, profile likelihood, Bayesian) cover the mean less than 50% of the time for some distributions. Third, tested Python and R packages and a web page, with endpoints accurate to $10^{-12}$ of the range of the values. So the interval is exact, narrow and fast, and we recommend it.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- A level is not a rank: an empirical audit of quantile-to-index conversion in 10 released conformal-prediction librariesarXiv · 2026
- FRCI: An R Package for fuzzy and randomized confidence intervalsarXiv · 2026
- Statistical Views on F beta and other Performance Metrics for Data MiningACM Transactions on Knowledge Discovery from Data · 2026
- Gaussian-efficient testing by betting on the mean of bounded dataarXiv · 2026
- A finite-sample inferential framework for the weighted kappa coefficient (FWKC) in binary diagnostic agreement studiesBMC Medical Research Methodology · 2026
- Smoothed Conformal Testing with Small Calibration SetsarXiv · 2026