Estimating Unknown Population Sizes Using the Hypergeometric Distribution

Liam Hodgson, Danilo Bzdok

The Challenge of Hidden Populations

In many scientific fields, the data we observe is merely a small sample drawn from a larger, finite "urn." For instance, a single-cell sequencing experiment captures only a fraction of the mRNA molecules present in a cell, and a short text passage utilizes only a subset of a writer's total vocabulary.

The core challenge lies in estimating the total population size ($N$) and the sizes of individual categories ($N_i$) within that population when both are unknown. Standard statistical tools often have significant blind spots for this task:

  • Multinomial distributions assume sampling with replacement. This ignores the reality that once a specific molecule or word is "picked," it cannot be picked again, leading to a loss of information about the absolute scale.
  • Poisson distributions treat categories as independent, failing to capture the inherent correlation between counts (e.g., in a finite capacity system, more of one category implies less of another).
  • Capture-Recapture methods require the ability to "tag" and "resample" the exact same population, which is physically impossible in many experimental setups like destructive RNA sequencing.

To address this, researchers have developed a novel method to estimate these hidden population sizes using the hypergeometric distribution, even under conditions of severe under-sampling.

A Tractable Hypergeometric Likelihood

The hypergeometric distribution naturally models sampling without replacement, making it ideal for these scenarios. However, it relies on factorials and binomial coefficients, which are discrete and "jagged." This makes traditional gradient descent optimization impossible.

To solve this, the authors introduced two key technical innovations:

  1. Continuous Relaxation: They replaced the discrete factorials with the continuous Gamma function, creating a differentiable version of the log-likelihood that can be optimized.
  2. Constraint Handling: To prevent the model from estimating a category size smaller than the number of items actually observed, they implemented a violation penalty and a thresholding function.
Hypergeometric negative log-likelihood landscape showing a clear empirical minimum that aligns with the true value.

This continuous likelihood is then embedded into a Variational Autoencoder (VAE). Instead of assuming every sample comes from the exact same population, the VAE learns a latent space representing the underlying factors (like cell type or document topic) that dictate the specific population being sampled.

Key Insights and Results

The authors evaluated their method across simulated data, natural language processing (NLP), and single-cell genomics, revealing several critical insights:

  • Inference is Tractable: Contrary to previous assumptions, estimating $N$ and $N_i$ simultaneously is mathematically stable. The hypergeometric likelihood captures the dependence between counts, allowing it to infer the total "pool" size much more accurately than models assuming independence.
  • Superior Accuracy in Simulations: In controlled environments, the Hypergeometric (HG) model achieved a Median Percentage Error (MPE) of ~2.8%, drastically outperforming the Poisson model, which lagged at ~26.1%.
  • Readability Proxy in NLP: Using the CLEAR dataset (~5,000 text excerpts), the model estimated the "latent vocabulary size" of the authors. This inferred vocabulary size showed a remarkably strong Pearson correlation with established human-rated readability indices (like Flesch-Kincaid and SMOG), significantly outperforming baseline token counts.
Pearson correlation of estimated latent vocabulary size with various readability indices, comparing the original baseline to the proposed hypergeometric method.
  • Genomics Recovery: On the SPIKE dataset (single-cell genomics with known synthetic RNA "spike-ins"), the model successfully estimated the total synthetic RNA per observation at ~30,000—aligning perfectly with experimental estimates. It also recovered the true count of specific spike-ins even when raw measurements were highly noisy, effectively addressing the "dropout" problem.

Limitations and Future Directions

While powerful, the method has limitations. Computational complexity remains a hurdle; for the genomics application, analysis was limited to the top 10,000 genes to maintain efficiency. Scaling to the full human genome or massive vocabularies will require further optimization. Additionally, the model assumes a fixed, finite population, which may not perfectly fit "infinite" generative processes.

Looking ahead, this continuous hypergeometric approach could be a game-changer for differential abundance analysis in microbiome research and for improving collaborative filtering in recommender systems, where users effectively "sample" items from a finite catalog.

Summary updated

BibTeX
@inproceedings{hodgson2024estimating,
  author = {Liam Hodgson and Danilo Bzdok},
  title = {{Estimating Unknown Population Sizes Using the Hypergeometric Distribution}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=qE4nkfyMYl},
}
Figure