Inferensys

Glossary

Negative Binomial Distribution

A discrete probability distribution commonly used to model RNA-seq count data because it accounts for overdispersion, where the variance of the counts exceeds the mean due to biological and technical variability.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
PROBABILITY THEORY

What is Negative Binomial Distribution?

A discrete probability distribution that models the number of successes in a sequence of independent Bernoulli trials before a specified number of failures occurs, widely used in genomics to model overdispersed count data.

The Negative Binomial Distribution is a discrete probability distribution that models the number of successes occurring in a sequence of independent and identically distributed Bernoulli trials before a specified number of failures is reached. Unlike the Poisson distribution, which assumes the variance equals the mean, the negative binomial introduces a dispersion parameter that allows the variance to exceed the mean, making it the standard framework for modeling overdispersed count data in RNA-seq differential expression analysis.

In bioinformatics, tools like DESeq2 and edgeR rely on the negative binomial distribution to model raw read counts per gene, where biological replicates and technical variability cause the variance to be greater than the mean. The distribution is parameterized by a mean and a dispersion term; the dispersion is estimated using empirical Bayes shrinkage to stabilize estimates for genes with low counts, ensuring robust statistical inference when testing for differential expression between experimental conditions.

Statistical Foundations

Key Properties of the Negative Binomial Distribution

The negative binomial distribution is the workhorse of RNA-seq differential expression analysis, chosen specifically because it captures the mean-variance relationship inherent in biological count data.

01

Overdispersion Modeling

The defining feature that makes the negative binomial essential for genomics. Unlike the Poisson distribution, which assumes the variance equals the mean, the negative binomial introduces a dispersion parameter that allows the variance to exceed the mean.

  • Biological reality: Gene expression varies between replicate samples due to natural biological fluctuations, not just sampling noise
  • Technical reality: Library preparation and sequencing introduce additional variability
  • Consequence: Using Poisson models on RNA-seq data produces dramatically inflated false positive rates because the model underestimates the true variability
02

Probability Mass Function

The negative binomial distribution models the probability of observing a specific count given a mean expression level and a dispersion parameter.

For RNA-seq, the parameterization used by tools like DESeq2 and edgeR is:

  • Mean (μ): The expected normalized count for a gene in a given condition
  • Dispersion (α): Controls how much the variance exceeds the mean
  • Variance function: Var = μ + α·μ²

When α → 0, the distribution converges to Poisson. Larger α values indicate stronger overdispersion, which is typical for genes with high biological variability.

03

Relationship to Poisson Distribution

The negative binomial can be understood as a gamma-Poisson mixture — a Poisson distribution where the rate parameter itself follows a gamma distribution.

  • Poisson: Assumes a fixed, constant expression level across all replicates
  • Negative Binomial: Acknowledges that the true expression level varies from sample to sample according to a gamma distribution
  • Practical implication: This hierarchical structure naturally produces heavier tails than Poisson, accommodating the occasional outlier counts observed in real RNA-seq experiments without flagging them as differentially expressed
04

Dispersion Estimation Strategies

Accurate dispersion estimation is the critical computational challenge. Individual gene dispersion estimates are unstable for low-count genes, so modern tools employ shrinkage:

  • DESeq2: Uses empirical Bayes shrinkage, assuming dispersion follows a log-normal prior distribution across genes of similar expression strength
  • edgeR: Estimates a common dispersion across all genes, then a trended dispersion as a function of expression level, and finally a tagwise dispersion with empirical Bayes moderation
  • Benefit: Information is borrowed across genes, producing more stable estimates and better Type I error control, especially for genes with low read counts
05

Mean-Variance Relationship

A fundamental property of RNA-seq count data is that the variance grows quadratically with the mean. The negative binomial captures this through its variance function.

  • Low-count genes: Variance is dominated by Poisson-like sampling noise (Var ≈ μ)
  • High-count genes: Biological variability dominates (Var ≈ α·μ²)
  • Diagnostic use: Mean-dispersion plots are standard quality control tools to verify that the chosen model appropriately captures the data's variance structure

This relationship is why simple log-transformations of count data are insufficient — they fail to properly stabilize variance across the full dynamic range of expression.

06

Generalized Linear Model Framework

The negative binomial distribution is embedded within a generalized linear model (GLM) framework in modern differential expression tools.

  • Link function: A log link connects the linear predictor to the expected count: log(μ) = Xβ
  • Design matrix (X): Encodes experimental conditions, batch effects, and covariates
  • Coefficients (β): Represent log2 fold changes between conditions
  • Hypothesis testing: Wald tests or likelihood ratio tests assess whether coefficients differ significantly from zero

This GLM structure enables complex experimental designs with multiple factors, continuous covariates, and interaction terms — far beyond simple two-group comparisons.

NEGATIVE BINOMIAL DISTRIBUTION IN GENOMICS

Frequently Asked Questions

Clear answers to common questions about the negative binomial distribution, the foundational statistical model powering modern differential gene expression analysis tools like DESeq2 and edgeR.

The negative binomial distribution is a discrete probability distribution that models the number of failures before a specified number of successes occurs in a sequence of independent Bernoulli trials. In RNA-seq analysis, it is used because gene expression count data exhibits overdispersion—the variance of the counts is greater than the mean. The Poisson distribution, which assumes the mean equals the variance, is inadequate for biological count data where technical and biological variability inflate the variance. The negative binomial introduces a dispersion parameter that allows the variance to be modeled as variance = mean + dispersion * mean², accurately capturing the extra-Poisson variability inherent in high-throughput sequencing experiments. This makes it the core distributional assumption in tools like DESeq2 and edgeR.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.