Confidence sequences for sampling without replacement

Ian Waudby-Smith, Aaditya Ramdas

Abstract

Many practical tasks involve sampling sequentially without replacement (WoR) from a finite population of size $N$, in an attempt to estimate some parameter $\theta^\star$. Accurately quantifying uncertainty throughout this process is a nontrivial task, but is necessary because it often determines when we stop collecting samples and confidently report a result. We present a suite of tools for designing confidence sequences (CS) for $\theta^\star$. A CS is a sequence of confidence sets $(C_n)_{n=1}^N$, that shrink in size, and all contain $\theta^\star$ simultaneously with high probability. We present a generic approach to constructing a frequentist CS using Bayesian tools, based on the fact that the ratio of a prior to the posterior at the ground truth is a martingale. We then present Hoeffding- and empirical-Bernstein-type time-uniform CSs and fixed-time confidence intervals for sampling WoR, which improve on previous bounds in the literature and explicitly quantify the benefit of WoR sampling.

Introduction

In classical statistics, data is often assumed to be sampled with replacement or from an infinite distribution. However, real-world tasks—such as auditing financial records, conducting opinion polls, or evaluating machine learning models—frequently involve sampling without replacement (WoR) from a finite population.

A major challenge in these settings is "peeking." If an analyst calculates a standard confidence interval and decides to continue sampling based on the current result, they risk inflating the false positive rate (p-hacking). To address this, we require Confidence Sequences (CS): sequences of sets that contain the true parameter simultaneously at all time steps with high probability. This paper introduces new CSs specifically optimized for the WoR setting, exploiting the fact that uncertainty should drop to zero as we approach the full population size.

Confidence sequences for an urn containing 1000 balls (650 green, 350 red). The sequences remain valid at all times, allowing for early stopping while maintaining the desired confidence level.

Methodology

The authors provide three primary methods for constructing these anytime-valid sequences:

1. The Prior-Posterior-Ratio (PPR) Martingale

This approach bridges Bayesian and frequentist inference. The authors prove that the ratio of a "working prior" to the "working posterior" (evaluated at the ground truth) is a nonnegative martingale. By applying Ville’s inequality, this ratio is transformed into a frequentist confidence sequence. This method is particularly effective for categorical data, such as binary survey responses.

The PPR approach allows for different working priors ($a, b$). While the choice of prior affects the initial width and shape of the sequence, all versions eventually converge to the true population total $N_1^*$.

2. Hoeffding and Empirical Bernstein WoR CS

For bounded real-valued data, the authors derive time-uniform versions of Hoeffding’s and Bernstein's inequalities. These bounds include a "WoR advantage" term that explicitly quantifies the reduction in uncertainty gained by not sampling the same items twice. The Empirical Bernstein version further adapts to the observed variance, providing tighter bounds for "easy" datasets with low variance.

Key Insights: The "WoR Advantage"

A central theme is that sampling without replacement is inherently more informative than sampling with replacement. The derived bounds include terms that grow as more of the population is sampled, eventually forcing the confidence interval width to zero when the entire population ($N$) is observed. Furthermore, any confidence sequence can be inverted to create an anytime-valid p-value, allowing researchers to stop an experiment the moment a significance threshold is reached without compromising Type I error guarantees.

Results and Applications

The methods were evaluated across several prototypical examples:

  • Opinion Surveys: In simulations of a 1,000-person poll, the PPR-based CS allowed for confident conclusions significantly earlier than fixed-size batch methods.
  • Permutation Tests: Calculating anytime-valid p-values for experiments like the "Lady Tasting Tea."
  • Machine Learning: Estimating Shapley values for feature importance by sampling permutations without replacement.

Conclusion

By explicitly accounting for the finite nature of populations and the dynamics of sequential sampling, these confidence sequences provide a robust framework for modern data analysis. They offer superior tightness over previous state-of-the-art bounds and provide a principled solution to the problem of sequential peeking in various scientific and industrial applications.

Summary updated

BibTeX
@inproceedings{waudbysmith2020confidence,
  author = {Ian Waudby-Smith and Aaditya Ramdas},
  title = {{Confidence sequences for sampling without replacement}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure