Dirichlet-Multinomial Model¶
This page presents the key theoretical results underlying the NBDM model. For complete derivations with all algebraic steps, see the accompanying paper.
Model Setup¶
Single-cell RNA-seq data is represented as a \(G \times C\) count matrix \(\underline{\underline{U}}\), where each entry \(u_g\) records the number of UMI counts for gene \(g\) in a given cell. The model proceeds from two distributional assumptions about how these counts arise.
True transcript counts¶
From biophysical first principles (the two-state promoter model at steady state), the number of mRNA molecules produced by gene \(g\) follows a negative binomial distribution:
where \(r_g\) is a gene-specific dispersion parameter. The key modeling assumption is that all genes share the same success probability \(p\). As discussed below, this assumption is less restrictive than it appears due to the parameter degeneracy of the negative binomial.
From mRNA to observed UMI counts¶
Each mRNA molecule is captured with probability \(\nu\), so the observed UMI count for gene \(g\), conditioned on the true transcript count \(m_g\), follows a binomial distribution:
Since \(m_g\) is unobserved, we marginalize over it to obtain the distribution of the observed count:
Key Result 1: NB–Binomial Composition¶
The marginal distribution of UMI counts after integrating out unobserved mRNA counts is again a negative binomial:
with a rescaled success probability
This can be shown via probability generating functions: the PGF of a negative binomial composed with a binomial reduces to the PGF of a negative binomial with the transformed parameter \(\hat{p}\). The shape parameter \(r_g\) is unchanged.
Why this matters
The capture process does not change the distributional family — it only rescales \(p\). This means we can work directly with UMI counts under the same negative binomial framework, absorbing the unknown capture efficiency into \(\hat{p}\).
Key Result 2: NB–Dirichlet-Multinomial Factorization¶
Assuming genes are independent and share \(\hat{p}\), the joint distribution of all UMI counts in a cell is
This product of independent negative binomials can be factorized as:
where \(u_T = \sum_{g=1}^G u_g\) is the total UMI count and \(r_T = \sum_{g=1}^G r_g\).
How the factorization works¶
The proof proceeds through two intermediate decompositions that exploit the Poisson-Gamma representation of the negative binomial.
Step 1 — Poisson-Gamma representation. Each negative binomial can be written as a compound distribution:
where \(\theta = \hat{p}/(1-\hat{p})\). This is equivalent to saying: sample a Poisson rate from a Gamma distribution, then draw the count from that Poisson.
Step 2 — Product of Poissons. The joint distribution of \(G\) independent Poisson random variables can be decomposed as:
where \(\lambda_T = \sum_g \lambda_g\) and \(\rho_g = \lambda_g / \lambda_T\) are the fractional rates.
Step 3 — Product of Gammas. When all Gamma distributions share the same rate parameter \(\theta\), the joint distribution decomposes as:
This step uses a change of variables from the individual \(\lambda_g\) to the total \(\lambda_T\) and the proportions \(\underline{\rho}\), with a Jacobian determinant of \(\Lambda^{G-1}\).
Combining everything. Substituting Steps 2 and 3 into the integral over \(\underline{\lambda}\) and performing the integrations:
- The Poisson × Gamma integral over \(\lambda_T\) yields the negative binomial \(\text{NB}(u_T \mid r_T, \hat{p})\).
- The Multinomial × Dirichlet integral over \(\underline{\rho}\) yields the Dirichlet-Multinomial \(\pi(\underline{u} \mid u_T, \underline{r})\).
The Dirichlet-Multinomial probability mass function takes the explicit form:
Bayesian Inference¶
Given the factorized likelihood, we perform Bayesian inference over the model parameters \(\underline{r}\) and \(\hat{p}\).
Prior distributions¶
The priors are chosen to respect the parameter domains:
Full posterior¶
For \(C\) independent cells, the posterior takes the form:
Separation of concerns
The factorized form reveals a clean separation: \(\hat{p}\) only appears in the negative binomial term for total counts, while the compositional term (Dirichlet-Multinomial) depends only on \(\underline{r}\). This means the composition of the transcriptome is governed entirely by the gene-specific dispersion parameters \(r_g\), independently of \(\hat{p}\).
Interpretation¶
The factorization has two important implications for single-cell RNA-seq analysis.
Natural normalization¶
In the construction of the model, the \(\underline{\rho}\) parameters emerge as the fractional abundances of each gene, lying on the unit simplex (\(\rho_g \geq 0\), \(\sum_g \rho_g = 1\)). These are the natural "normalized" quantities: rather than dividing raw counts by library size, the model places a Dirichlet distribution over these fractions and learns their parameters from data.
Distributions over fractions, not point estimates¶
Unlike standard normalization pipelines that produce a single point estimate of gene fractions, the NBDM model yields a full posterior distribution over \(\underline{\rho}\) via the Dirichlet. This preserves the uncertainty inherent in overdispersed count data — arguably the key motivation for performing single-cell experiments in the first place.
When a point estimate is needed, the posterior mean of the Dirichlet provides a natural choice. But for downstream analyses such as differential expression, working with the full distribution enables principled uncertainty quantification.
Next steps
- See the Model Selection guide for practical usage and choosing the right model variant.
- See the Hierarchical Gene-Specific \(p\) page for what happens when the shared-\(p\) assumption is relaxed.
- See Bayesian Denoising to learn how the NB generative model here enables closed-form posterior recovery of true transcript counts from observed UMIs.
- See Differential Expression for how the Dirichlet compositions derived here serve as the direct input to the compositional DE framework.