# 边际分布

**边际分布**是随机变量子集的概率分布，由更大变量集的联合分布对不在该子集中的变量求和（离散变量）或积分（连续变量）而得到。<sup>[1](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)</sup> 产生它的运算称为边缘化，通俗地说就是“把不要的变量加掉”。<sup>[1](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)</sup><sup> • </sup><sup>[2](https://inst.eecs.berkeley.edu/~cs188/textbook/bayes-nets/probability.html)</sup> 严格说来，“边际”一词本身是多余的：X 的边际分布就是 X 的分布，这个术语的存在只是为了把它与 X 和其他变量的联合分布区分开来。<sup>[3](https://www.stat.umn.edu/geyer/3701/notes/mcmc-bayes.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 随机向量的某个分量或分量子集的分布，完全由整个向量的分布决定；是联合分布在所选坐标上的投影<sup>[4](https://encyclopediaofmath.org/wiki/Marginal_distribution)</sup> |
| 连续情形 | \( f_X(x) = \int_{-\infty}^{\infty} f(x, y) \, dy \)；边际累积分布函数为 \( F_X(t) = F_{XY}(t, \infty) \)<sup>[3](https://www.stat.umn.edu/geyer/3701/notes/mcmc-bayes.html)</sup><sup> • </sup><sup>[4](https://encyclopediaofmath.org/wiki/Marginal_distribution)</sup> |
| 离散情形 | \( P(X = t_i) = \sum_{j} P(X = t_i, Y = u_j) \)，即联合概率表的列合计或行合计<sup>[5](https://stats.libretexts.org/Bookshelves/Probability_Theory/Applied_Probability_%28Pfeiffer%29/08%3A_Random_Vectors_and_Joint_Distributions/8.01%3A_Random_Vectors_and_Joint_Distributions)</sup> |
| 解释 | 不论 Y 取值如何、或在没有 Y 的信息时 X 的分布<sup>[1](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)</sup> |
| 关键局限 | 边际分布一般不能确定联合分布；当各分量独立时可以<sup>[5](https://stats.libretexts.org/Bookshelves/Probability_Theory/Applied_Probability_%28Pfeiffer%29/08%3A_Random_Vectors_and_Joint_Distributions/8.01%3A_Random_Vectors_and_Joint_Distributions)</sup> |
| 词源 | 该术语来自把相应的合计数写在列联表的边栏里<sup>[6](https://mude.citg.tudelft.nl/book/2026-draft/multivariate/contingency_tables.html)</sup> |

## 定义与记号

对于联合密度为 \( f(x, y) \) 的两个连续变量 X 和 Y，边际密度通过对另一个变量积分得到：<sup>[1](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)</sup>

\[
Pr(X) = \int Pr(X, Y) \, dY, \qquad Pr(Y) = \int Pr(X, Y) \, dX.
\]

对于离散变量，积分变为对另一个变量支撑集的求和。<sup>[1](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)</sup> 用分布函数的形式表述，若 \( F(x_1, x_2) \) 是 \( X = (X_1, X_2) \) 的联合分布函数，则 \( X_1 \) 的分布函数为 \( F_1(x_1) = F(x_1, +\infty) \)；当二维分布绝对连续时，边际密度为 \( p_1(x_1) = \int_{-\infty}^{+\infty} p(x_1, x_2) \, dx_2 \)。<sup>[4](https://encyclopediaofmath.org/wiki/Marginal_distribution)</sup> 同样的构造适用于向量 \( (X_1, \dots, X_n) \) 的任一分量或分量集合，对任意 n 都成立。<sup>[4](https://encyclopediaofmath.org/wiki/Marginal_distribution)</sup>

推广到更多变量是直接的。给定四个离散变量 W、X、Y、Z，任一子集的联合概率通过对所有其他变量边缘化得到，例如 \( Pr(X, Y) = \sum_W \sum_Z Pr(W, X, Y, Z) \)。<sup>[1](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)</sup> 形式上，对于变量集 \( \mathbf{X} \) 及其子集 \( \mathbf{X} \subseteq \mathbf{X} \)，边际为 \( P(\mathbf{X}) = \sum_{\mathbf{z} \in Val(\mathbf{X} \setminus \mathbf{X})} P(\mathbf{X}, \mathbf{z}) \)；在联合概率表中，这相当于把对 \( \mathbf{X} \) 的赋值一致的所有行合并，并将其概率相加。<sup>[7](https://ai.stanford.edu/~joni/research/chapter2.pdf)</sup> 一种紧凑的记号把被边缘化的变量写在求和号下：\( P(\mathbf{X}) = \sum_{\mathbf{X} \setminus \mathbf{X}} P(\mathbf{X}) \)。<sup>[7](https://ai.stanford.edu/~joni/research/chapter2.pdf)</sup>

## 解释及与其他分布的关系

对 Y 边缘化回答的是一个具体问题：在对 Y 一无所知时，X 的分布是什么？<sup>[1](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)</sup> 在列联表中，每个格子计数的是某种结果组合的观测次数，边际分布就是换算成概率的行合计与列合计，而同一张表同时展示了变量的边际分布、联合分布和条件分布。<sup>[6](https://mude.citg.tudelft.nl/book/2026-draft/multivariate/contingency_tables.html)</sup>

**三个相关对象。** 条件分布、联合分布和边际分布由 \( f(y \mid x) = f(x, y) / f(x) \) 联系起来，可概括为条件 = 联合 / 边际，或联合 = 条件 × 边际。<sup>[3](https://www.stat.umn.edu/geyer/3701/notes/mcmc-bayes.html)</sup> 分母中用到的边际，始终是条件分布竖线之后那个或那些变量的边际。<sup>[3](https://www.stat.umn.edu/geyer/3701/notes/mcmc-bayes.html)</sup> 全概率公式给出另一条路径：\( P(a) = \sum_b P(a, b) = \sum_b P(a \mid b) P(b) \)，因此边际既可以从联合分布算出，也可以从条件分布和另一个边际算出。<sup>[8](https://ics.uci.edu/~smyth/courses/cs274/notes/Notes1_BasicProbability.pdf)</sup>

**边际分布不能告诉你什么。** 分别知道 X 和 Y 的分布，一般不足以确定它们的联合分布，因为联合分布含有变量之间如何相互依赖的信息。<sup>[9](https://math.tulane.edu/~spunshonsmith/MATH3080-Spring24/Multivariate-Dist.html)</sup> 反方向则总是成立：边际完全由联合决定。<sup>[4](https://encyclopediaofmath.org/wiki/Marginal_distribution)</sup> 例外情形是独立。当 \( X_1, \dots, X_n \) 相互独立时，联合分布由各边际唯一确定，有 \( F(x_1, \dots, x_n) = \prod_{i=1}^{n} F_i(x_i) \) 和 \( p(x_1, \dots, x_n) = \prod_{i=1}^{n} p_i(x_i) \)。<sup>[4](https://encyclopediaofmath.org/wiki/Marginal_distribution)</sup> 一个有用的特例涉及正态分布：若 \( X \) 的联合分布是正态的，则它的所有边际分布也都是正态的。<sup>[4](https://encyclopediaofmath.org/wiki/Marginal_distribution)</sup>

## 推断与计算中的边缘化

计算边际是贝叶斯网络等概率图模型中的核心任务，其中边际推断指计算变量子集的概率分布，这一任务与处理缺失数据和隐变量有关。<sup>[10](https://arxiv.org/abs/2112.09217)</sup> 基于变量消元的精确算法，其复杂度由图的树宽而非变量的原始数目决定，因此低树宽的图可以高效处理；当树宽过大时，与变量消元相关的近似方法，如环状信念传播和变分方法，能以远低于蒙特卡罗方法的代价给出准确结果。<sup>[11](https://onlinelibrary.wiley.com/doi/10.1111/anzs.12257)</sup> 关于推断复杂性的研究表明，在某个组合假设下，低树宽是唯一能保证可处理性的结构限制。<sup>[12](https://proceedings.mlr.press/r6/chandrasekaran08a)</sup>

边缘化还会改变可用的模型类别。如果一个贝叶斯网络——即有向无环图（DAG）模型——包含隐变量，那么关于其余可观测变量的可能边际分布集合一般不能用任何 DAG 表示，而更大的混合图模型类仍不足以涵盖出现的所有边际模型；牛津大学统计系的罗宾·J·埃文斯引入了一类称为 mDAG 的超图，以及一种隐投影运算，使得 DAG 模型的每个不同边际都至少由一个 mDAG 表示。<sup>[13](https://onlinelibrary.wiley.com/doi/pdf/10.1111/sjos.12194)</sup>

在贝叶斯统计中，对参数边缘化产生边际似然，也称证据：即在先验加权下对所有参数值平均后的观测数据概率，它出现在贝叶斯定理的分母中，是贝叶斯模型比较的关键量。<sup>[14](https://en.bayesianstatistics.com/Marginal_Likelihood)</sup> 能够对干扰参数边缘化被视为贝叶斯统计的一个重要特点；当对两个参数的后验积分以给出其中一个的边际后验时，出现的是同样的积分。<sup>[15](https://www.pp.rhul.ac.uk/~cowan/stat/stat_13.pdf)</sup> 术语并不统一：“边际似然”也曾被用于部分似然，那里的边缘化是在数据空间而非参数空间上进行的。<sup>[16](https://statistics.fas.harvard.edu/file_url/1005)</sup>

## 边际关联与条件关联

由于边际分布丢弃了信息，对同一对变量的边际描述和条件描述可能不一致。辛普森悖论就是一对变量的边际关联与偏（条件）关联方向相反的现象，因此一旦考虑第三个变量，关联的性质和方向就可能改变。<sup>[17](https://online.stat.psu.edu/stat504/Lesson05)</sup> 在辛普森本人的数值例子中，条件优势比在第三个变量的两个水平内相同，而条件关联与边际（无条件）关联并不相等；哪种度量合理取决于研究背景，从纯统计学角度看，并不存在偏好条件关联或边际关联的一般规则。<sup>[18](https://pmc.ncbi.nlm.nih.gov/articles/PMC3147074/)</sup> 这是明确说明所报告的概率或关联是边际的还是条件的一个实际理由。

## References

1. [Section 1.3, Marginalization, Probabilistic Machine Learning course notes, University of Toronto](https://www.cs.toronto.edu/~ucacsjp/ProbLearning.pdf)
2. [6.1 Probability Rundown, CS 188 Introduction to Artificial Intelligence, UC Berkeley](https://inst.eecs.berkeley.edu/~cs188/textbook/bayes-nets/probability.html)
3. [Stat 3701 Lecture Notes: Bayesian Inference via Markov Chain Monte Carlo, University of Minnesota](https://www.stat.umn.edu/geyer/3701/notes/mcmc-bayes.html)
4. [Marginal distribution, Encyclopedia of Mathematics (A.V. Prokhorov, originator)](https://encyclopediaofmath.org/wiki/Marginal_distribution)
5. [8.1: Random Vectors and Joint Distributions, Statistics LibreTexts (Paul Pfeiffer, Rice University)](https://stats.libretexts.org/Bookshelves/Probability_Theory/Applied_Probability_%28Pfeiffer%29/08%3A_Random_Vectors_and_Joint_Distributions/8.01%3A_Random_Vectors_and_Joint_Distributions)
6. [2.1 Contingency tables, MUDE textbook, TU Delft](https://mude.citg.tudelft.nl/book/2026-draft/multivariate/contingency_tables.html)
7. [Chapter 2, Preliminaries: The Joint Distribution, Stanford University](https://ai.stanford.edu/~joni/research/chapter2.pdf)
8. [Note Set 1: Review of Basic Concepts in Probability, Padhraic Smyth, UC Irvine](https://ics.uci.edu/~smyth/courses/cs274/notes/Notes1_BasicProbability.pdf)
9. [MATH 3080 Multivariate Distributions, Tulane University](https://math.tulane.edu/~spunshonsmith/MATH3080-Spring24/Multivariate-Dist.html)
10. [High-Dimensional Inference in Bayesian Networks, arXiv:2112.09217](https://arxiv.org/abs/2112.09217)
11. [Peyrard, N. et al. (2019). Exact or approximate inference in graphical models: why the choice is dictated by the treewidth, and how variable elimination can be exploited. Aust. N. Z. J. Stat. 61: 89–133.](https://onlinelibrary.wiley.com/doi/10.1111/anzs.12257)
12. [Chandrasekaran, V., Srebro, N., Harsha, P. (2008). Complexity of inference in graphical models. UAI 2008, PMLR R6:70–78.](https://proceedings.mlr.press/r6/chandrasekaran08a)
13. [Evans, R.J. (2016). Graphs for Margins of Bayesian Networks. Scandinavian Journal of Statistics.](https://onlinelibrary.wiley.com/doi/pdf/10.1111/sjos.12194)
14. [Marginal Likelihood, BayesianStatistics.com](https://en.bayesianstatistics.com/Marginal_Likelihood)
15. [Cowan, G. Lectures on Statistical Data Analysis, Lecture 13, Royal Holloway University of London](https://www.pp.rhul.ac.uk/~cowan/stat/stat_13.pdf)
16. [Bayesian Statistics 9, Harvard Statistics Department (discussion of the term "marginal likelihood")](https://statistics.fas.harvard.edu/file_url/1005)
17. [Lesson 5: Three-Way Tables, STAT 504 Analysis of Discrete Data, Penn State](https://online.stat.psu.edu/stat504/Lesson05)
18. [Simpson's paradox unraveled, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC3147074/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Conditional probability and independence › Conditional distributions (static)

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/marginal-distribution

English original: https://www.edgepedia.org/marginal-distribution
