D-分离

d-分离是一套决定准则:对于给定的因果图,决定在给定变量集合Z的情况下,变量集合X和变量集合Y是否独立[1]

d-分离的基本思想

它的基本想法是将统计意义上的“独立性”与图论中的“分离性”(“非连通性”)联系起来。这个基本想法首先需要我们去定义在给定的有向图中给定结点集Z取值下的“激活路径”。d-分离中的“d”实际上指示了我们讨论的目标为有向图。

d-分离的定义

[math]\displaystyle{ \mathbf{X} }[/math][math]\displaystyle{ \mathbf{Y} }[/math],是图[math]\displaystyle{ \mathcal{G} }[/math]中的三个结点集合。如果在给定Z的条件下,任意[math]\displaystyle{ X \in \mathbf{X} }[/math][math]\displaystyle{ Y \in \mathbf{Y} }[/math]两个结点间没有激活路径,则称[math]\displaystyle{ \mathbf{X} }[/math][math]\displaystyle{ \mathbf{Y} }[/math]是给定[math]\displaystyle{ \mathbf{Z} }[/math]下d-分离的,记作[math]\displaystyle{ d-sep_{\mathcal{G}(\mathbf{X}l\mathbf{Y} \mid \mathbf{Z}) } }[/math]

将结点间的一系列独立性关系记作[math]\displaystyle{ \mathcal{I}(\mathcal{G}) }[/math],从而可将独立性和d-分离联系起来:

[math]\displaystyle{ \mathcal{I}(\mathcal{G}) = \left\{ (\mathbf{X} \perp \!\!\! \perp \mathbf{Y} \mid \mathbf{Z}) : d-sep_{\mathcal{G}(\mathbf{X}l\mathbf{Y} \mid \mathbf{Z}) } \right\} }[/math]

d-分离的解释

激活路径的定义

假设[math]\displaystyle{ \mathcal{G} }[/math]是一个贝叶斯网络,[math]\displaystyle{ \mathbf{Z} }[/math]是给定的已观测变量集,我们称一条路径[math]\displaystyle{ \mathbf{X}_1 \leftrightarrow \cdots \leftrightarrow \mathbf{X}_n }[/math]是给定[math]\displaystyle{ \mathbf{Z} }[/math]下激活的,当且仅当:

  • 当路径中出现如此形式的V-结构:[math]\displaystyle{ \mathbf{X}_{i-1} \rightarrow \mathbf{X}_{i} \leftarrow \mathbf{X}_{i+1} }[/math]时,[math]\displaystyle{ \mathbf{X}_{i} }[/math]或它的某个子孙结点在[math]\displaystyle{ \mathbf{Z} }[/math]中。
  • 其它任何路径中的结点都不在[math]\displaystyle{ \mathbf{Z} }[/math]中。

根据激活路径的解释

由d-分离的定义可知,[math]\displaystyle{ d-sep_{\mathcal{G}(\mathbf{X}l\mathbf{Y} \mid \mathbf{Z}) } }[/math]实际上指的就是将所有[math]\displaystyle{ \mathbf{X} }[/math][math]\displaystyle{ \mathbf{Y} }[/math]间的激活路径以及相应激活结点集找出,只要保证[math]\displaystyle{ \mathbf{Z} }[/math]中没有激活节点集中的结点,且不含[math]\displaystyle{ \mathbf{X} }[/math][math]\displaystyle{ \mathbf{Y} }[/math]中结点即可做到d-分离。

根据阻断路径的解释[2]

类似激活路径的定义,我们还可以定义阻断路径:

一条路径被一组结点[math]\displaystyle{ \mathbf{Z} }[/math]阻断,当且仅当:

  • 路径中包含链结构或分叉结构,则中间结点包含在[math]\displaystyle{ \mathbf{Z} }[/math]中。
  • 路径中包含对撞结构,则对撞结点及其子孙结点都不在[math]\displaystyle{ \mathbf{Z} }[/math]中。

有了阻断路径的定义,我们可以重新定义d-分离为:

如果[math]\displaystyle{ \mathbf{Z} }[/math]阻断了[math]\displaystyle{ \mathbf{X} }[/math][math]\displaystyle{ \mathbf{Y} }[/math]之间的每一条路径,则称[math]\displaystyle{ \mathbf{X} }[/math][math]\displaystyle{ \mathbf{Y} }[/math]是给定[math]\displaystyle{ \mathbf{Z} }[/math]下d-分离的,[math]\displaystyle{ \mathbf{X} }[/math][math]\displaystyle{ \mathbf{Y} }[/math]在给定[math]\displaystyle{ \mathbf{Z} }[/math]下条件独立。

d-分离实例[3]

生成缩略图出错:无法找到文件
实例

在此图中,T和Y是给定W下d-分离的。但当Z取空集、{W,X1}、{W,X2}等情况下,T和Y不满足d-分离条件。

d-分离算法

算法

d-分离算法的基本思路如下:

  1. 构造概率表达式中提到的所有变量的“有向图”,即对应的贝叶斯网络。
  2. 对于具有公共子代的每对变量,在它们之间绘制无向边(线)。(如果一个变量有两个以上的父母,则在每对父母之间画一条线)
  3. 将所有边变成无向边。
  4. 删除所有给定变量的节点,以及他们的边。
  5. 解释得到的图。

具体的算法可参考文献[4]

代码实现

Python开源包NetworkX中包含D-Separation算法的实现。

d-分离与因果推断

相关性与因果性

d-分离实际上暗含了对相关性与因果性的区分。假设我们观测到了两个变量X、Y之间有统计相关性,为了鉴别这种相关性是否有两个变量间的直接因果关系导致,我们可以在变量对应的因果图中搜索可将X与Y作d-分离的集合Z,如果存在这样的Z,则说明X与Y可d-分离,即X与Y之间无直接因果关系,它们的相关性由共同原因导致。

Faithfulness假设

Faithfulness假设指的是从概率分布中的独立性中,我们可以推断出图中的d-分离性。Faithfulness假设常作为因果推断与因果发现算法的前提假设,更多关于Faithfulness假设的背景与讨论可见参考文献[5]

d-分离与后门调整

后门调整是do-演算的一种特例,找出满足后门准则的变量集W,给定W即可将干预下的条件分布识别为统计意义下的含W的条件分布,从而来计算变量间的因果效应[6]。后门准则中寻找的变量集,实际上就是对结果变量Y和干预变量T之间寻找d-分离变量集Z。

参考文献

  1. Koller D, Friedman N. Probabilistic graphical models: principles and techniques[M]. MIT press, 2009.
  2. Pearl J, Glymour M, Jewell N P. Causal inference in statistics: A primer[M]. John Wiley & Sons, 2016.
  3. Spirtes P. Introduction to causal inference[J]. Journal of Machine Learning Research, 2010, 11(5).
  4. Geiger D, Verma T, Pearl J. d-separation: From theorems to algorithms[M]//Machine Intelligence and Pattern Recognition. North-Holland, 1990, 10: 139-148.
  5. Uhler C, Raskutti G, Bühlmann P, et al. Geometry of the faithfulness assumption in causal inference[J]. The Annals of Statistics, 2013: 436-463.
  6. Pearl J. Causality[M]. Cambridge university press, 2009.