Gaffke confidence interval

For the mean of a variable that takes a few known values: ratings, scores, counts. Exact (coverage at least 1 − α for every sample size), narrow and fast. Runs in your browser; no data leaves this page.

What it is. Each of n trials gives one of k known values vi with unknown probabilities pi. The interval for the mean μ = Σ vipi is [Qα/2(v·P−), Q1−α/2(v·P+)], where P− and P+ are Dirichlet with the counts as parameters and one more unit on the smallest or the largest value. For two values it is the Clopper–Pearson interval. Its coverage is at least 1 − α for every sample size and every distribution (Gaffke 2005; proof by Vlassis and Thomas 2026). The values that you list define the range: the interval assumes that no other value can occur.