遞歸函數基例和鏈條
因果推論 (Causal Inference)
This is the fifth post on the series we work our way through “Causal Inference In Statistics” a nice Primer co-authored by Judea Pearl himself.
這是本系列的第五篇文章,我們通過“因果統計推斷”一書進行工作,這本由Judea Pearl本人合著的不錯的入門文章。

You can find the previous post here and all the we relevant Python code in the companion GitHub Repository:
您可以在此處找到相關的上一篇文章以及相關的GitHub存儲庫中所有與我們相關的Python代碼:
While I will do my best to introduce the content in a clear and accessible way, I highly recommend that you get the book yourself and follow along. So, without further ado, let’s get started!
盡管我會盡力以清晰易懂的方式介紹內容,但我強烈建議您自己拿書并繼續學習。 因此,事不宜遲,讓我們開始吧!
In the previous four posts I, II, III, IV, we covered Chapter I of the book where Pearl lays down the mathematical and conceptual foundations for Causal Inference. In this post we start diving into Chapter II where we diver more deeply into Graphical Models and Their Applications.
在前四, 第一 , 第二 , 第三和第四篇文章中 ,我們介紹了本書的第一章,其中Pearl為因果推理奠定了數學和概念基礎。 在這篇文章中,我們開始深入研究第二章,在第二章中我們將更深入地探討圖形模型及其應用。
2.2鏈條和叉子 (2.2 Chains and Forks)
Structural causal models allow us to encode causal mechanisms that represent the data generating process. In their graphical form, they make it easy to quickly (and often visually) to detect interdependencies in the data and enable us to reason about the model and its correctness.
結構因果模型使我們能夠編碼代表數據生成過程的因果機制。 通過它們的圖形形式,它們使快速(通常在視覺上)易于檢測數據中的相互依賴性,并使我們能夠對模型及其正確性進行推理。
The Graphical Model directly and explicitly encodes which variables depend on which others, which variables are independent conditional on other variables, etc.
圖形模型直接和顯式地編碼哪些變量取決于哪些變量,哪些變量是獨立于其他變量的條件等。
Pearl illustrates this point with three simple Structural Causal Models that all have the same Graphical Model:
Pearl用三個簡單的因果模型說明了這一點,它們都具有相同的圖形模型:

Regardless of what the exact form of the functions in F, just by inspection of the graphical model we can immediately say:
無論F中函數的確切形式是什么,僅通過檢查圖形模型,我們都可以立即得出以下結論:
Z and Y are dependent — P(Z|Y) ≠ P(Z)
Z和Y取決于 — P(Z | Y)≠P(Z)
Y and X are dependent — P(Y|Z) ≠ P(Y)
Y和X是依賴的 -P(Y | Z)≠P(Y)
Z and X are likely dependent — P(Z|X)≠P(Z)
Z和X可能是依賴的 -P(Z | X)≠P(Z)
Z and X are independent conditional on Y— P(Z|X, Y)=P(Z|Y)
Z和X在Y — P(Z | X,Y)= P(Z | Y) 上為獨立條件
The first two items are easy to understand and refine the fundamental rule of Graphical models:
前兩項很容易理解并完善了圖形模型的基本規則:
Rule 0 (Edge dependency) — Any two variables with a directed edge between them are dependent
規則0(邊依存性)-兩個有向邊的變量都是依存的
This is easy to understand as the formula for one explicitly requires the value for the other. Point 3 is a bit trickier. Z depends on Y that depends on X so, by transitivity, we can also expect that Z depends on X. However, it is possible that the specific forms of fY and fZ break this dependency. The book refers to this possibility as a “Pathological Case of Intransitive Dependence”: something uncommon that non the less we should be aware of.
這很容易理解,因為其中一個的公式明確要求另一個的值。 第三點有點棘手。 Z取決于依賴于X的Y,因此,通過傳遞性 ,我們還可以期望Z依賴于X。但是,fY和fZ的特定形式可能會打破這種依賴關系。 該書將這種可能性稱為“ 不及物依賴的病理學案例 ”:這是我們不應該意識到的罕見現象。
Point 4 is the most interesting of all and, while apparently non-trivial it is easy to understand. If we look in our dataset and find out what the current value of Y is, that immediately helps us determine what the value of Z is (using P(Z|Y)). On the other hand, fixing the value of Y essentially isolates X from Z. Changes in the value of X are compensated by changes in the value o Uy such that Y remains fixed. This is defined in the book as:
第4點是所有內容中最有趣的一點,盡管很簡單,但很容易理解。 如果我們查看數據集并找出Y的當前值是什么,那將立即幫助我們確定Z的值是什么(使用P(Z | Y))。 另一方面,固定Y的值本質上將X與Z隔離開。X值的變化由o Uy的值變化所補償,以使Y保持固定。 在書中定義為:
Rule 1 (Conditional Independence on Chains) — Two variables, X and Y, are conditionally independent given Z, if there is only one unidirectional path between X and Y and Z is any set of variables that intercepts that path.
規則1(鏈上的條件獨立性)—如果X和Y之間只有一條單向路徑,并且Z是截斷該路徑的任何一組變量,則給定Z時??,兩個變量X和Y在條件上是獨立的。
A fundamental assumption underlying Rule 1 is that the error terms Ux, Uy, and Uz are independent.
規則1的基本假設是誤差項Ux,Uy和Uz是獨立的。
On the other hand, if our DAG looks like this:
另一方面,如果我們的DAG如下所示:

Then, following a similar reasoning, we can immediately know that:
然后,按照類似的推理,我們可以立即知道:
X and Y are dependent — P(X|Y)≠P(X)
X和Y是依賴的 -P(X | Y)≠P(X)
X and Z are dependent — P(X|Z)≠P(Z)
X和Z是依賴的 -P(X | Z)≠P(Z)
Z and Y are likely dependent — P(Z|Y)≠P(Z)
Z和Y很可能是依賴的 -P(Z | Y)≠P(Z)
Y and Z are independent, conditional on X — P(Y|Z, X)=P(Y|X)
Y和Z是獨立的,并取決于X — P(Y | Z,X)= P(Y | X)
Points 1 and 2 follow directly from Rule 0. Point 3 is a logical consequence of the fact that Z and Y have a common cause: any specific value of X will result in specific values of Y and Z making them correlated across all values of X.
點1和2直接從規則0得出。點3是Z和Y具有共同原因的邏輯結果:X的任何特定值都將導致Y和Z的特定值,從而使它們在X的所有值之間相關。
Finally, Point 4 requires a bit more thinking to properly understand, but is directly related to Point 3. If we fix the value of X, Y and Z are only allowed to vary due to their respective Uy and Uz which we assume to be independent. This result is summarized in Rule 2:
最后,第4點需要更多的思考才能正確理解,但與第3點直接相關。如果我們固定X,Y和Z的值,則僅由于它們各自的Uy和Uz(我們認為是獨立的)而被允許變化。 。 規則2中匯總了此結果:
Rule 2 (Conditional Independence in Forks) — If a variable X is a common cause of variables Y and Z, and there is only one path between Y and Z, then Y and Z are independent conditional on X.
規則2(分叉中的條件獨立性)—如果變量X是變量Y和Z的常見原因,并且Y和Z之間只有一條路徑,則Y和Z是X的獨立條件。
Congratulations on making it this far in these blog post series. I sincerely hope that you continue to enjoy reading them as much as I enjoy writing them.
祝賀您在這些博客文章系列中取得了如此長的成就。 我衷心希望您繼續喜歡閱讀它們,就像我喜歡寫它們一樣。
Just a quick reminder that you can find the code for all the examples above in our GitHub repository:
謹在此提醒您,您可以在我們的GitHub存儲庫中找到上述所有示例的代碼:
And if you would like to be notified when the next post comes out, you can subscribe to the The Sunday Briefing newsletter:
而且,如果您希望在下一篇文章發表時得到通知,可以訂閱《星期日簡報》時事通訊:
翻譯自: https://medium.com/data-for-science/causal-inference-part-v-chains-and-forks-7b0b088c346e
遞歸函數基例和鏈條
本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。 如若轉載,請注明出處:http://www.pswp.cn/news/388809.shtml 繁體地址,請注明出處:http://hk.pswp.cn/news/388809.shtml 英文地址,請注明出處:http://en.pswp.cn/news/388809.shtml
如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!