# 因果贝叶斯网络

因果[贝叶斯网络](https://www.edgepedia.org/zh/bayesian-network)是一种图模型，它将一个联合概率分布与一个有向无环图（DAG）配对，图中的弧表示直接的因果关系，用于预测干预的效果。形式上，它是一个二元组 \( \langle p(\mathbf{X}), \mathcal{G} \rangle \)，其中联合分布关于因果DAG \( \mathcal{G} \) 是马尔可夫的。<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup> 普通贝叶斯网络只编码概率依赖性；对弧赋予因果解释，才能使学习到的图预测变量受到外部操纵时会发生什么——没有因果解释则无法做到这一点。<sup>[2](http://heckerman.com/david/H95uai.pdf)</sup> 一旦学习到这样的图，它就能预测干预或分布偏移的效果，而传统机器学习方法只对与训练数据同分布的输入做出预测。<sup>[3](https://link.springer.com/article/10.1007/s10208-022-09581-9)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 一个二元组 \( \langle p(\mathbf{X}), \mathcal{G} \rangle \)：关于因果DAG \( \mathcal{G} \) 的马尔可夫联合分布<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup> |
| 核心假设 | 因果马尔可夫条件：每个变量在给定其父节点时独立于其非效应<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup> |
| 附加假设 | 因果充分性（所有共同原因都在图中）<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup> 与忠实性<sup>[3](https://link.springer.com/article/10.1007/s10208-022-09581-9)</sup> |
| 因果查询 | 干预分布，如 \( P(Y \mid do(X=x)) \)，由联合分布和DAG计算<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup> |
| 主要算法输出 | 基于约束的方法返回CPDAG（PC、SGS、GS）或PAG（FCI）；基于评分的方法返回CPDAG（GES）或完整DAG（连续优化）<sup>[4](https://link.springer.com/article/10.1007/s10462-022-10351-w)</sup><sup> • </sup><sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)</sup> |
| 样本复杂度 | 对于可识别的高斯贝叶斯网络，\( O(k^{4} \log p) \) 个样本即以高概率恢复真实DAG，其中 \( p \) 为变量数，最大马尔可夫毯大小为 \( k \)<sup>[6](https://papers.nips.cc/paper_files/paper/2017/file/907edb0aa6986220dbffb79a788596ee-Paper.pdf)</sup> |
| 难度 | 最优网络的精确结构发现在一般情况下计算困难；基于顺序的动态规划在变量数上为以2为底的指数级<sup>[7](https://proceedings.mlr.press/v275/rios25a.html)</sup> |

## 工作原理

因果马尔可夫条件指出，每个变量在给定其父节点时独立于其非效应，这将DAG中的因果陈述与联合分布的因子分解联系起来。<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup> 马尔可夫条件与极小性条件合在一起，可以表述为 \( \mathcal{G} \) 是 \( p(\mathbf{X}) \) 的最小独立图（I-map）。<sup>[4](https://link.springer.com/article/10.1007/s10462-022-10351-w)</sup> 在结构因果模型形式中，每个变量是其父节点与相互独立的随机扰动项的确定性函数，

\[ X_{i} = f_{i}(\mathrm{pa}_{i}, \varepsilon_{i}), \]

其中 \( \mathrm{pa}_{i} \) 表示图中 \( X_{i} \) 的父节点，\( \varepsilon_{i} \) 服从任意分布但相互独立。<sup>[8](https://bayes.cs.ucla.edu/R218-B.pdf)</sup>

还有两个假设为将边解读为因果提供了依据。因果充分性要求任意两个变量的所有共同原因本身都在图中得到考虑。<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup> 忠实性要求分布中的每个条件独立性都对应图中的d-分离（[条件独立性](https://www.edgepedia.org/zh/conditional-independence)的图判据）；这是一个一般性假设，因为在线性高斯模型中，违反它的参数集的[勒贝格测度](https://www.edgepedia.org/zh/lebesgue-measure)为零。<sup>[3](https://link.springer.com/article/10.1007/s10208-022-09581-9)</sup>

干预用do算子建模，它通过删除设定被干预变量的函数并将其替换为常数、保持模型其余部分不变，来模拟物理干预。<sup>[9](https://people.csail.mit.edu/tdanford/discovering-causal-graphs-papers/pearl-causality-review.pdf)</sup> 在图上，\( do(X=x) \) 移除从 \( X \) 的父节点到 \( X \) 的所有箭头，然后以 \( X=x \) 为条件。<sup>[10](https://alexdeng.github.io/causal/cgm.html)</sup> 等价地，可以构建一个残缺网络，移除被干预变量的所有入弧并将其条件分布固定为指示函数。<sup>[11](https://armahmood.github.io/files/mahmood-TR11-01.pdf)</sup> 得到的干预后分布由截断分解给出，

\[ f^{*}(v_{1}, \dots, v_{k}) = \prod_{i \mid V_{i} \notin X} f(v_{i} \mid \pi_{i}) \big|_{X=x}, \]

它去掉了被干预变量的因子。<sup>[10](https://alexdeng.github.io/causal/cgm.html)</sup> 将 \( X \) 从 \( x_{0} \) 变为 \( x_{1} \) 的平均处理效应则为

\[ E(Y \mid do(X=x_{1})) - E(Y \mid do(X=x_{0})). \]

do演算利用联合分布与DAG，将含有do算子的表达式变换为只涉及可观测变量的无do表达式。<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup><sup> • </sup><sup>[10](https://alexdeng.github.io/causal/cgm.html)</sup> 当 \( P(y \mid \hat{x}) \) 可以从任何与观测分布一致的模型中观测变量的概率唯一计算出来时，\( X \) 对 \( Y \) 的因果效应是可识别的。<sup>[12](https://ftp.cs.ucla.edu/pub/stat_ser/r236-3ed.pdf)</sup> 只要模型是马尔可夫的——即图是无环的且所有误差项联合独立——可识别性就有保证。非马尔可夫模型，例如由未测量混杂因素引起误差相关的模型，仅在由图结构确定的某些条件下才允许识别。<sup>[9](https://people.csail.mit.edu/tdanford/discovering-causal-graphs-papers/pearl-causality-review.pdf)</sup> 识别 \( P(y \mid do(x)) \) 的一个充分条件是：\( X \) 与其任何子节点之间不存在双有向路径，即完全由双有向弧组成的路径。<sup>[12](https://ftp.cs.ucla.edu/pub/stat_ser/r236-3ed.pdf)</sup>

## 操作流程

实际工作流有四个步骤：结构学习，即从数据或专家知识构建网络；结构审查，即验证每个关系以便断言其为因果；参数的似然估计；以及用观测或[反事实推断](https://www.edgepedia.org/zh/counterfactual-inference)进行预测。<sup>[13](https://causalnex.readthedocs.io/en/latest/04_user_guide/04_user_guide.html)</sup> 当从完全观测数据学习时，结构学习本质上与普通贝叶斯网络结构学习相同，方法分为基于约束和基于评分两类。<sup>[11](https://armahmood.github.io/files/mahmood-TR11-01.pdf)</sup> 贝叶斯方法从后验中采样DAG，例如通过顺序MCMC或划分MCMC，因果效应可以用基于采样的估计器估计，这些估计器将采样参数映射为隐含的因果效应。<sup>[1](https://ar5iv.labs.arxiv.org/html/2402.00623)</sup><sup> • </sup><sup>[14](https://proceedings.neurips.cc/paper_files/paper/2020/file/48f7d3043bc03e6c48a6f0ebc0f258a8-Paper.pdf)</sup>

## 起源

在连续优化这一研究路线中，贝洛、阿拉加姆和[拉维库马尔](https://www.edgepedia.org/zh/ravikumar)于2022年在arXiv上提出了DAGMA，它通过M矩阵和无环性的对数行列式刻画来学习DAG。<sup>[15](https://doi.org/10.48550/arxiv.2209.08037)</sup>

## 变体

**基于约束的方法**检验条件独立性。[PC算法](https://www.edgepedia.org/zh/pc-algorithm)从完全无向图开始，通过使用基数递增的条件集检验条件独立性来删除边，然后利用邻接阶段得到的分离集定向v结构，并用Meek规则传播定向。<sup>[3](https://link.springer.com/article/10.1007/s10208-022-09581-9)</sup><sup> • </sup><sup>[4](https://link.springer.com/article/10.1007/s10462-022-10351-w)</sup> 它输出马尔可夫等价类的CPDAG。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)</sup> SGS是一种类似的全局方法，假设数据完整；生长—收缩（GS）算法是一种局部方法，也输出CPDAG。<sup>[4](https://link.springer.com/article/10.1007/s10462-022-10351-w)</sup> FCI算法将基于约束的方法扩展到因果不充分的潜变量情形，输出PAG且不假设因果充分性；其变体包括RFCI和FCI+。<sup>[3](https://link.springer.com/article/10.1007/s10208-022-09581-9)</sup><sup> • </sup><sup>[4](https://link.springer.com/article/10.1007/s10462-022-10351-w)</sup>

**基于评分的方法**搜索高分图。GES从空图开始，在拟合评分改进的引导下逐步添加边，输出CPDAG。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)</sup> 连续优化方法始于NOTEARS用光滑函数替代离散DAG约束，将结构学习转化为可用标准梯度技术优化的可微问题，返回从线性到多层神经网络的显式函数关系。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)</sup> LiNGAM是一种独特的替代方案，假设非高斯噪声，从而无需条件独立性检验即可确定因果方向，输出连续线性因果模型。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)</sup>

在定量方面，\( O(k^{4} \log p) \) 个样本足以高概率恢复可识别的高斯DAG结构。<sup>[6](https://papers.nips.cc/paper_files/paper/2017/file/907edb0aa6986220dbffb79a788596ee-Paper.pdf)</sup> 最优网络的精确发现在一般情况下计算困难，最先进的精确方法使用整数线性规划、动态规划与拓扑序上的最短路径搜索，以及约束规划。<sup>[7](https://proceedings.mlr.press/v275/rios25a.html)</sup>

## 应用

已记录的应用集中在生物学。在由直接遗传操纵实验构建的基准中，基于约束的PC算法在几乎所有基于图的评估中都是稳定的最佳表现者，而将PC输出作为额外约束嵌入NOTEARS优化的混合方法在结构和效应量指标上取得了最佳总体性能。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)</sup> 在贝叶斯估计器中，一种三阶段采样方法——采样DAG、以DAG为条件采样参数、通过矩阵求逆将参数映射为因果效应——在因果效应估计精度上优于BIDA方法，并在邻域大小为4的网络上优于现有的基于IDA的方法。<sup>[14](https://proceedings.neurips.cc/paper_files/paper/2020/file/48f7d3043bc03e6c48a6f0ebc0f258a8-Paper.pdf)</sup>

## 局限与替代方案

仅从观测数据学习因果贝叶斯网络的结构在理论上并非总是可行。<sup>[16](https://ar5iv.labs.arxiv.org/html/2408.11181)</sup> 基于约束的方法往往无法揭示完整的DAG，而是返回CPDAG，其中只有有向边表示真实因果关系，无向边表示因果方向未知的相关性。<sup>[16](https://ar5iv.labs.arxiv.org/html/2408.11181)</sup> 条件独立性检验误差会连锁传播并显著降低所得CPDAG的质量，这就是基于评分的方法通常被认为更稳健的原因；PC尤其在小样本数据集上因检验的不确定性而脆弱。<sup>[16](https://ar5iv.labs.arxiv.org/html/2408.11181)</sup> 未测量的混杂会产生相关误差和非马尔可夫模型，仅在由图确定的条件下可识别<sup>[9](https://people.csail.mit.edu/tdanford/discovering-causal-graphs-papers/pearl-causality-review.pdf)</sup>；FCI类算法通过放弃因果充分性假设并输出PAG来处理这一情形。<sup>[4](https://link.springer.com/article/10.1007/s10462-022-10351-w)</sup> 与普通贝叶斯网络相比，因果变体增加了弧的干预语义；与LiNGAM相比，它不需要非高斯噪声假设。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)</sup>

## References

1. [Bayesian Causal Inference with Gaussian Process Networks](https://ar5iv.labs.arxiv.org/html/2402.00623)
2. [A Bayesian Approach to Learning Causal Networks](http://heckerman.com/david/H95uai.pdf)
3. [Causal Structure Learning: A Combinatorial Perspective](https://link.springer.com/article/10.1007/s10208-022-09581-9)
4. [A survey of Bayesian Network structure learning](https://link.springer.com/article/10.1007/s10462-022-10351-w)
5. [A hybrid constrained continuous optimization approach for optimal causal discovery from biological data](https://pmc.ncbi.nlm.nih.gov/articles/PMC11373380/)
6. [Learning Identifiable Gaussian Bayesian Networks in Polynomial Time and Sample Complexity](https://papers.nips.cc/paper_files/paper/2017/file/907edb0aa6986220dbffb79a788596ee-Paper.pdf)
7. [Exact discovery is polynomial for certain sparse causal Bayesian networks](https://proceedings.mlr.press/v275/rios25a.html)
8. [UCLA technical report R218-B](https://bayes.cs.ucla.edu/R218-B.pdf)
9. [Statistics and Causal Inference: A Review](https://people.csail.mit.edu/tdanford/discovering-causal-graphs-papers/pearl-causality-review.pdf)
10. [Chapter 5 Causal Graphical Model | Causal Inference and Its Applications in Online Industry](https://alexdeng.github.io/causal/cgm.html)
11. [Structure Learning of Causal Bayesian Networks: A Survey](https://armahmood.github.io/files/mahmood-TR11-01.pdf)
12. [Graphical Models for Probabilistic and Causal Inference (UCLA technical report R-236)](https://ftp.cs.ucla.edu/pub/stat_ser/r236-3ed.pdf)
13. [CausalNex User Guide, Causal Inference with Bayesian Networks](https://causalnex.readthedocs.io/en/latest/04_user_guide/04_user_guide.html)
14. [Towards Scalable Bayesian Learning of Causal DAGs (Beeps)](https://proceedings.neurips.cc/paper_files/paper/2020/file/48f7d3043bc03e6c48a6f0ebc0f258a8-Paper.pdf)
15. [Bello, Kevin, Aragam, Bryon, Ravikumar, Pradeep (2022). DAGMA: Learning DAGs via M-matrices and a Log-Determinant Acyclicity Characterization. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2209.08037)
16. [A Full DAG Score-Based Algorithm for Learning Causal Bayesian Networks with Latent Confounders](https://ar5iv.labs.arxiv.org/html/2408.11181)

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

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/causal-bayesian-network

English original: https://www.edgepedia.org/causal-bayesian-network
