这一篇博文并不是讲解什么是d-分离。而是假定你已经知道了d-分离,我们来讲一讲如何实现d-分离算法。为此,你可能需要提前了解这些概念:
有效迹,d-分离,你可以参考我们之前的博文:
《概率图模型7:推理与流动》
《概率图模型4:贝叶斯网络》
d-separation is a criterion for deciding, from a given a causal graph, whether a set X of variables is independent of another set Y, given a third set Z. The idea is to associate “dependence” with “connectedness” (i.e., the existence of a connecting path) and “independence” with “unconnected-ness” or “separation”. The only twist on this simple idea is to define what we mean by “connecting path”, given that we are dealing with a system of directed arrows in which some vertices (those residing in Z) correspond to measured variables, whose values are known precisely. To account for the orientations of the arrows we use the terms “d-separated” and “d-connected” (d-connotes “directional”).–http://bayes.cs.ucla.edu/BOOK-2K/d-sep.html
1. 两个小问题
1.1 问题一:
假如X通过有效迹现在来到了Y,那么有可能是从Y的上一级节点到达Y的,也有可能从Y的下一级节点到达Y的,为此我们用
对于
对于经过Y的有效迹而言,无论Y下一步往哪里走,都可能有有效迹。因此我们可以从Y往下走,即把
我们也可以从Y往上走,即把
对于
如果Y或者Y的后代是观测变量,那么根据有效迹的条件,此刻的有效迹只能是V结构,因此Y只能往上走。即把
如果Y不是观测变量,那么根据有效迹的条件,此刻的有效迹不可能是V结构,只能是因果迹,因此Y只能往下走。即把
鉴于此,我们可以用一小段(伪)代码来表示上面的过程。这段代码里,
1.2 问题二
假如我们已经访问了
1. 我们还能不能再重复访问
2. 我们还能不能访问