# 负二项模型

负二项模型是一种统计模型，它使用负二项分布来分析方差超过均值的计数数据，是广义计数回归和RNA测序中差异表达标准检验的基础。服从泊松分布的计数数据的方差等于均值；真实的计数数据通常比这变化更大，这种性质称为过度离散。在此类数据上假设泊松变异的检验“不能控制第一类错误”，因为它“预测的变异小于数据中所见的变异”。<sup>[1](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)</sup> 负二项模型增加了一个离散参数，使方差随均值增长，从而恢复有效的推断。在基因组学中，它是edgeR、DESeq和DESeq2的误差模型；在一般统计学中，它用于过度离散的计数结果。<sup>[2](https://onlinelibrary.wiley.com/doi/10.1002/0470011815.b2a10039)</sup>

| 关键事实 | 详情 |
|---|---|
| 均值–方差关系 | NB2形式下 \( \mathrm{Var}(Y) = \mu + \phi \cdot \mu^{2} \)；\( \phi \) 为离散参数<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> |
| 推导 | 泊松–伽马混合：伽马分布的速率具有 \( \mathrm{Var}(\upsilon) = \phi \cdot \mu^{2} \)，在泊松分布上混合即得NB<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> |
| 极限情形 | 当离散度 \( \alpha \to 0 \) 时，NB回归退化为泊松回归<sup>[4](https://onlinelibrary.wiley.com/doi/10.2307/3314912)</sup> |
| RNA-seq误差模型 | 早期edgeR分析假设 \( \sigma^{2} = \mu + \alpha \cdot \mu^{2} \) 中只有一个共同的 \( \alpha \)，而当前edgeR方法支持共同、趋势和基因特异的离散度；DESeq通过局部回归将方差与均值关联<sup>[1](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)</sup> |
| 拟合 | 通过迭代重加权最小二乘法（Fisher得分法）进行最大似然估计<sup>[5](https://diystat.r-universe.dev/NBPSeq/doc/manual.html)</sup> |
| 设计指导 | 超过约2000万条读段后，增加生物学重复比增加测序深度更能提高功效<sup>[6](https://rnajournal.cshlp.org/content/20/11/1684)</sup> |
| 已知失效 | 在许多公开的RNA-seq和16S微生物组数据集中，NB假设被违反<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192467/)</sup> |

## 工作原理

该分布可以通过两种方式推导：作为二值数据中一定成功次数的等待时间分布，或作为混合分布。<sup>[2](https://onlinelibrary.wiley.com/doi/10.1002/0470011815.b2a10039)</sup> 假设 \( \upsilon \) 是一个伽马分布的随机变量，\( \mathrm{E}(\upsilon) = \mu \)，\( \mathrm{Var}(\upsilon) = \phi\mu^{2} \)，且 \( Y \mid \upsilon \sim \mathrm{Poisson}(\upsilon) \)；则 \( Y \) 的边缘分布为负二项分布，均值为 \( \mu \)，方差为 \( \mu + \phi \cdot \mu^{2} \)。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup>

回归形式是带对数链接的广义线性模型：\( \log(\mu) = X' \cdot \beta \)，离散度为 \( \phi \)。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> 在Lawless的记号中，\( \mathrm{E}(Y \mid x) = \mu(x) \)，\( \mathrm{Var}(Y \mid x) = \mu(x) + \alpha \cdot \mu(x)^{2} \)，当 \( \alpha \) 趋于0时，模型退化为泊松回归模型。<sup>[4](https://onlinelibrary.wiley.com/doi/10.2307/3314912)</sup> 对于测序数据，均值按文库大小缩放，\( \mu_{ij} = s_{j} \cdot \pi_{ij} \)，其中 \( s_{j} \) 为文库大小，可选的归一化因子 \( R_{j} \) 作为偏移量进入。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup>

不同软件在离散度如何进入方差方面存在差异。一般形式称为NBP，假设伽马方差为 \( \phi \cdot \mu^{\alpha} \)，给出 \( \mathrm{Var}(Y) = \mu + \phi \cdot \mu^{\alpha} \)；这包括NB1（\( \alpha = 1 \)，方差与均值线性相关）和NB2（\( \alpha = 2 \)）作为特例。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> NB2形式即上述泊松–伽马混合。离散度本身可以建模为均值的函数：NBQ模型设定 \( \log(\phi_{ij}) = \alpha_{0} + \alpha_{1}\log(\pi_{ij}) + \alpha_{2}[\log(\pi_{ij})]^{2} \)，这是一个三参数的离散度–均值关系。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> NBPSeq实现了NB2、NBP和NBQ模型，其中NBQ为默认。<sup>[5](https://diystat.r-universe.dev/NBPSeq/doc/manual.html)</sup>

## 实现方法

NBPSeq使用迭代重加权最小二乘算法估计回归系数，等价于Fisher得分法，基于`glm.fit`构建，均值 \( \mu = s \cdot \exp(x' \cdot \beta) \)。<sup>[5](https://diystat.r-universe.dev/NBPSeq/doc/manual.html)</sup> 实践者的工作流程是：将计数归一化到大小因子，指定设计矩阵，估计离散度（共同的、趋势的或逐基因的），对每个基因拟合GLM，用Wald检验或似然比检验检验系数，并对跨基因的P值进行校正。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup><sup>[8](https://www.degruyter.com/document/doi/10.1515/sagmb-2018-0021/html)</sup>

由于数千个基因共享一个模型，离散度估计是RNA-seq方法差异最大的地方。edgeR实现了逐基因、共同、非参数、标签级共同和标签级趋势方法，标签级版本是经验贝叶斯加权平均值，将每个基因的估计向趋势收缩。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> DESeq则通过局部回归拟合平滑的均值依赖趋势。<sup>[1](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)</sup> 动机是经验性的：在许多RNA-seq数据集中，离散度 \( \phi_{i} \) 随均值 \( \mu_{i} \) 变化，这就是NBQ等参数化离散度–均值模型存在的原因。<sup>[5](https://diystat.r-universe.dev/NBPSeq/doc/manual.html)</sup>

从NB回归模型下的双侧Wald检验导出的样本量公式允许在实验前直接计算功效，纳入共同离散度和作为对数链接偏移量的大小因子。<sup>[8](https://www.degruyter.com/document/doi/10.1515/sagmb-2018-0021/html)</sup> 增加样本量比增加测序深度更能有效提高功效，尤其是当深度达到2000万条读段后；配对样本RNA-seq显著增强功效。<sup>[6](https://rnajournal.cshlp.org/content/20/11/1684)</sup> 功效还通过方差直接依赖于离散度：对于约100以下的计数，散粒噪声占主导，因此只有非常高的倍数变化才被判定为显著；更深的测序有助于弱表达基因，但在较高计数下只有更多生物学重复才有帮助。<sup>[1](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)</sup>

## 起源

Jerald F. Lawless于1987年在《加拿大统计学期刊》上发表了“负二项与混合泊松回归”，研究了过度离散计数数据的负二项回归模型、基于此的推断的效率和稳健性，以及与拟似然的比较。<sup>[4](https://onlinelibrary.wiley.com/doi/10.2307/3314912)</sup> 分布本身早于此，既可推导为二值数据中成功次数的等待时间分布，也可作为混合分布推导。<sup>[2](https://onlinelibrary.wiley.com/doi/10.1002/0470011815.b2a10039)</sup>

在基因组学中，edgeR——由Mark D. Robinson、Davis J. McCarthy和Gordon K. Smyth开发的Bioconductor包（《生物信息学》，2009年）——将负二项模型应用于数字基因表达数据。<sup>[9](https://doi.org/10.1093/bioinformatics/btp616)</sup> Robinson和Smyth假设均值与方差通过 \( \sigma^{2} = \mu + \alpha \cdot \mu^{2} \) 关联，整个实验共享一个比例常数 \( \alpha \)。<sup>[1](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)</sup> DESeq由Simon Anders和Wolfgang Huber开发（《基因组生物学》，2010年），“其基本思想归功于edgeR，但在几个方面有所不同”，主要通过均值依赖的局部回归而非一个共享常数将方差与均值关联。<sup>[1](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)</sup> 后来在NBP参数化基础上构建了差异检验，扩展了Robinson和Smyth（2007，2008）提出的精确检验。<sup>[10](https://www.degruyterbrill.com/document/doi/10.2202/1544-6115.1637/html)</sup>

## 变体

**偏移量与混合模型。** 文库大小作为偏移量进入对数链接。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> 对于多受试者单细胞数据，NEBULA（2021）是负二项混合模型的快速算法，通过随机效应将过度离散分解为受试者水平和细胞水平分量，方差为 \( \mu + \mu^{2}/\phi \)。<sup>[11](https://doi.org/10.1038/s42003-021-02146-6)</sup> NEBULA-LN使用基于大数定律的大样本近似为对数正态随机效应模型推导近似似然；NEBULA-HL则使用分层似然方法。<sup>[11](https://doi.org/10.1038/s42003-021-02146-6)</sup>

**零膨胀与障碍模型。** SCDE用NB模型和泊松模型的混合处理零膨胀，而MAST使用障碍模型，非零分量用高斯分布建模。<sup>[12](https://pmc.ncbi.nlm.nih.gov/articles/PMC5984373/)</sup> ZINB-WaVE在零膨胀NB表示下从单细胞数据中提取信号。<sup>[13](https://doi.org/10.1101/125112)</sup> 然而，多项近期研究表明，对于基于UMI的单细胞数据，零膨胀模型可能是冗余的。<sup>[11](https://doi.org/10.1038/s42003-021-02146-6)</sup>

**条件特异性离散度与扩展。** NBID通过允许每个生物学条件中有独立的离散参数来扩展基于NB的模型，类似于不等方差t检验。<sup>[12](https://pmc.ncbi.nlm.nih.gov/articles/PMC5984373/)</sup> 贝叶斯分层伽马-负二项模型（hGNB）和嵌入深度学习的ZINB框架（ZILLNB）进一步扩展了该家族。<sup>[14](https://doi.org/10.1186/s12864-020-06938-8)</sup><sup>[15](https://doi.org/10.1186/s12859-025-06296-w)</sup> 2024年《基因组研究》的一篇论文推导了两个负二项分布之差（DOTNB）以处理不等离散度，并在此基础上构建了DEGage，一种从原始计数检测两个scRNA-seq数据集之间差异表达基因的方法。<sup>[16](https://genome.cshlp.org/content/genome/early/2024/10/10/gr.278843.123.full.pdf)</sup>

## 应用

主要应用是群体和单细胞RNA-seq计数的差异表达分析，其中NB模型是edgeR、DESeq、DESeq2及其衍生方法的误差模型。<sup>[1](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)</sup> 在六个公开数据集上的模拟中，以功效、ROC/AUC、MCC和F度量衡量，DESeq2和edgeR在DESeq、edgeR、DESeq2、sSeq和EBSeq中倾向于给出最佳的差异表达性能。<sup>[6](https://rnajournal.cshlp.org/content/20/11/1684)</sup> 特别对于基于UMI的单细胞计数，在泊松、NB和ZINB模型间的后向选择表明，负二项即使在异质群体中也是良好的近似，零膨胀NB没有额外增益；NBID在此类数据上实现了适当的FDR控制，功效优于Monocle2、SCDE、ROTS、MAST和Seurat。<sup>[12](https://pmc.ncbi.nlm.nih.gov/articles/PMC5984373/)</sup>

在测序之外，一项关于医院住院时长的模拟和案例研究发现，泊松和零膨胀泊松模型在过度离散数据上表现不佳，而NB模型提供了最佳拟合，并在结合零膨胀和过度离散的许多场景中优于ZINB，无论样本量如何。<sup>[17](https://link.springer.com/article/10.1186/s12874-022-01685-8)</sup> 对过度离散数据拟合错误模型导致回归系数估计有偏，并夸大了某些预测变量的显著性。<sup>[17](https://link.springer.com/article/10.1186/s12874-022-01685-8)</sup>

## 局限与替代方案

**NB假设本身可能失效。** 一项专门的拟合优度检验表明，在许多公开可用的RNA-seq和16S rRNA微生物组数据集中，NB假设被违反，而零膨胀NB分布并未给出显著更好的拟合。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192467/)</sup> 在NB假设被违反的特征上，基于NB的差异检验表现更差，这解释了已发表评估中FDR控制不佳的原因；作者得出结论，非参数检验应优先于参数方法。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192467/)</sup> 他们还指出，edgeR和DESeq2的评估经常使用由相同NB分布生成的合成数据，这有利于被测试的方法。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192467/)</sup>

**诊断。** 基于模拟的拟合优度检验和诊断图形，包括通过Fisher方法组合的Pearson残差QQ图，可以检测NB均值–方差关系的错误设定；第一类错误率在小样本时偏保守，随着样本量增加与名义0.05水平匹配。<sup>[3](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)</sup> 要在拟泊松和NB之间选择，将残差 \( (Y_{i} - \mu_{i}) \) 对拟合均值作图：拟泊松方差与均值线性相关（\( \mathrm{Var} = \phi \cdot \lambda \)），而NB方差是二次的（\( \mathrm{Var} = \lambda + \theta \cdot \lambda^{2} \)），因此过度离散因子 \( 1 + \theta \cdot \lambda \) 依赖于均值。<sup>[18](https://utstat.utoronto.ca/reid/sta2201s/QUASI-POISSON.pdf)</sup>

**收敛性。** 当错误地用于建模等离散数据时，NB和ZINB回归模型面临严重的收敛问题。<sup>[17](https://link.springer.com/article/10.1186/s12874-022-01685-8)</sup> 替代方案包括仅由前两阶矩表征的拟泊松，以及拟合优度失败时的非参数检验。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192467/)</sup><sup>[18](https://utstat.utoronto.ca/reid/sta2201s/QUASI-POISSON.pdf)</sup>

## References

1. [Differential expression analysis for sequence count data (Anders & Huber, DESeq)](https://link.springer.com/article/10.1186/gb-2010-11-10-r106)
2. [Negative binomial distribution (Encyclopedia of Biostatistics)](https://onlinelibrary.wiley.com/doi/10.1002/0470011815.b2a10039)
3. [Goodness-of-Fit Tests and Model Diagnostics for Negative Binomial Regression of RNA Sequencing Data (Di et al., PLOS One)](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0119254)
4. [Negative binomial and mixed Poisson regression (Lawless)](https://onlinelibrary.wiley.com/doi/10.2307/3314912)
5. [Package 'NBPSeq' reference manual](https://diystat.r-universe.dev/NBPSeq/doc/manual.html)
6. [Power analysis and sample size estimation for RNA-Seq differential expression (Ching, Huang & Garmire, RNA 2014)](https://rnajournal.cshlp.org/content/20/11/1684)
7. [Sequence count data are poorly fit by the negative binomial distribution (PLOS One, 2020)](https://pmc.ncbi.nlm.nih.gov/articles/PMC7192467/)
8. [Sample size calculations for the differential expression analysis of RNA-seq data using a negative binomial regression model](https://www.degruyter.com/document/doi/10.1515/sagmb-2018-0021/html)
9. [Mark D. Robinson, Davis J. McCarthy, Gordon K. Smyth (2009). edgeR : a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics.](https://doi.org/10.1093/bioinformatics/btp616)
10. [The NBP Negative Binomial Model for Assessing Differential Expression (Di et al.)](https://www.degruyterbrill.com/document/doi/10.2202/1544-6115.1637/html)
11. [Liang He and colleagues (2021). NEBULA is a fast negative binomial mixed model for differential or co-expression analysis of large-scale multi-subject single-cell data. Communications Biology.](https://doi.org/10.1038/s42003-021-02146-6)
12. [UMI-count modeling and differential expression analysis for single-cell RNA sequencing (NBID)](https://pmc.ncbi.nlm.nih.gov/articles/PMC5984373/)
13. [Davide Risso and colleagues (2017). ZINB-WaVE: A general and flexible method for signal extraction from single-cell RNA-seq data. bioRxiv (Cold Spring Harbor Laboratory).](https://doi.org/10.1101/125112)
14. [Siamak Zamani Dadaneh and colleagues (2020). Bayesian gamma-negative binomial modeling of single-cell RNA sequencing data. BMC Genomics.](https://doi.org/10.1186/s12864-020-06938-8)
15. [Qinhuan Luo, Yongzhen Yu, Tianying Wang (2025). Denoising single-cell RNA-seq data with a deep learning-embedded statistical framework. BMC Bioinformatics.](https://doi.org/10.1186/s12859-025-06296-w)
16. [Theoretical framework for the difference of two negative binomial distributions and its application in comparative analysis of sequencing data (DEGage)](https://genome.cshlp.org/content/genome/early/2024/10/10/gr.278843.123.full.pdf)
17. [A comparison of statistical methods for modeling count data with an application to hospital length of stay (BMC Medical Research Methodology, 2022)](https://link.springer.com/article/10.1186/s12874-022-01685-8)
18. [Quasi-Poisson vs. Negative Binomial Regression: How Should We Model Overdispersed Count Data?](https://utstat.utoronto.ca/reid/sta2201s/QUASI-POISSON.pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Regression analysis

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/negative-binomial-model

English original: https://www.edgepedia.org/negative-binomial-model
