递归函数基例和链条_链条和叉子

递归函数基例和链条

因果推论 (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本人合着的不错的入门文章。

Image for post
Amazon Affiliate Link
亚马逊会员链接

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用三个简单的因果模型说明了这一点,它们都具有相同的图形模型:

Image for post
Chain DAG corresponding to 3 Different Structural Causal Models
链DAG对应于3种不同的因果模型

Regardless of what the exact form of the functions in F, just by inspection of the graphical model we can immediately say:

无论F中函数的确切形式是什么,仅通过检查图形模型,我们都可以立即得出以下结论:

  1. Z and Y are dependent — P(Z|Y) ≠ P(Z)

    Z和Y取决于 — P(Z | Y)≠P(Z)

  2. Y and X are dependent — P(Y|Z) ≠ P(Y)

    Y和X是依赖的 -P(Y | Z)≠P(Y)

  3. Z and X are likely dependent — P(Z|X)≠P(Z)

    Z和X可能是依赖的 -P(Z | X)≠P(Z)

  4. 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如下所示:

Image for post
Fork DAG corresponding to 2 Different Structural Causal Models
对应2种不同结构因果模型的DAG叉

Then, following a similar reasoning, we can immediately know that:

然后,按照类似的推理,我们可以立即知道:

  1. X and Y are dependent — P(X|Y)≠P(X)

    X和Y是依赖的 -P(X | Y)≠P(X)

  2. X and Z are dependent — P(X|Z)≠P(Z)

    X和Z是依赖的 -P(X | Z)≠P(Z)

  3. Z and Y are likely dependent — P(Z|Y)≠P(Z)

    Z和Y很可能是依赖的 -P(Z | Y)≠P(Z)

  4. 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.mzph.cn/news/388809.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

java lock 信号_java各种锁(ReentrantLock,Semaphore,CountDownLatch)的实现原理

先放结论:主要是实现AbstractQueuedSynchronizer中进入和退出函数,控制不同的进入和退出条件,实现适用于各种场景下的锁。JAVA中对于线程的同步提供了多种锁机制,比较著名的有可重入锁ReentrantLock,信号量机制Semapho…

Intent.ACTION_MAIN

1 Intent.ACTION_MAIN String: android.intent.action.MAIN 标识Activity为一个程序的开始。比较常用。 Input:nothing Output:nothing 例如&#xff1a; 1 <activity android:name".Main"android:label"string/app_name">2 <intent-filter…

足球预测_预测足球热

足球预测By Aditya Pethe通过阿蒂亚皮特(Aditya Pethe) From September to January every year, football takes over America. Games dominate TV Sunday and Monday nights, and my brother tears his hair out each week over his consistently underperforming fantasy te…

C#的特性Attribute

一、什么是特性 特性是用于在运行时传递程序中各种元素&#xff08;比如类、方法、结构、枚举、组件等&#xff09;的行为信息的声明性标签&#xff0c;这个标签可以有多个。您可以通过使用特性向程序添加声明性信息。一个声明性标签是通过放置在它所应用的元素前面的方括号&am…

python3中朴素贝叶斯_贝叶斯统计:Python中从零开始的都会都市

python3中朴素贝叶斯你在这里 (You are here) If you’re reading this, odds are: (1) you’re interested in bayesian statistics but (2) you have no idea how Markov Chain Monte Carlo (MCMC) sampling methods work, and (3) you realize that all but the simplest, t…

【转载】移动端布局概念总结

布局准备工作及布局思想及概念: 一个显示器&#xff08;pc端显示器 及 手机屏显示器&#xff09;&#xff0c;既有物理像素&#xff0c;又有独立像素&#xff08;独立像素也叫作css像素&#xff0c;用于前端人员使用&#xff09;&#xff1b; -->重要 首先确定设计稿的尺寸…

深入浅出:HTTP/2

上篇文章深入浅出&#xff1a;5G和HTTP里给自己挖了一根深坑&#xff0c;说是要写一篇关于HTTP/2的文章&#xff0c;今天来还账了。 本文分为以下几个部分&#xff1a; HTTP/2的背景HTTP/2的特点HTTP/2的协议分析HTTP/2的支持 HTTP/2简介 HTTP/2主要是为了解决现HTTP 1.1性能不…

画了个Android

画了个Android 今晚瞎折腾&#xff0c;闲着没事画了个机器人——android&#xff0c;浪费了一个晚上的时间。画这丫还真不容易&#xff0c;为那些坐标&#xff0c;差点砸了键盘&#xff0c;好在最后画出个有模有样的&#xff0c;心稍安。 下面来看看画这么个机器人需要些什么东…

数据治理 主数据 元数据_我们对数据治理的误解

数据治理 主数据 元数据Data governance is top of mind for many of my customers, particularly in light of GDPR, CCPA, COVID-19, and any number of other acronyms that speak to the increasing importance of data management when it comes to protecting user data.…

提高机器学习质量的想法_如何提高机器学习的数据质量?

提高机器学习质量的想法The ultimate goal of every data scientist or Machine Learning evangelist is to create a better model with higher predictive accuracy. However, in the pursuit of fine-tuning hyperparameters or improving modeling algorithms, data might …

mysql 集群实践_MySQL Cluster集群探索与实践

MySQL集群是一种在无共享架构(SNA&#xff0c;Share Nothing Architecture)系统里应用内存数据库集群的技术。这种无共享的架构可以使得系统使用低廉的硬件获取高的可扩展性。MySQL集群是一种分布式设计&#xff0c;目标是要达到没有任何单点故障点。因此&#xff0c;任何组成部…

matlab散点图折线图_什么是散点图以及何时使用

matlab散点图折线图When you were learning algebra back in high school, you might not have realized that one day you would need to create a scatter plot to demonstrate real-world results.当您在高中学习代数时&#xff0c;您可能没有意识到有一天需要创建一个散点图…

python字符串和List:索引值以 0 为开始值,-1 为从末尾的开始位置;值和位置的区别哦...

String&#xff08;字符串&#xff09;Python中的字符串用单引号 或双引号 " 括起来&#xff0c;同时使用反斜杠 \ 转义特殊字符。 字符串的截取的语法格式如下&#xff1a; 变量[头下标:尾下标]索引值以 0 为开始值&#xff0c;-1 为从末尾的开始位置。[一个是值&#x…

逻辑回归 python_深入研究Python的逻辑回归

逻辑回归 pythonClassification techniques are an essential part of machine learning and data science applications. Approximately 70% of problems in machine learning are classification problems. There are lots of classification problems that are available, b…

spring定时任务(@Scheduled注解)

&#xff08;一&#xff09;在xml里加入task的命名空间 xmlns:task"http://www.springframework.org/schema/task" http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd&#xff08;二&#xff09;启用注…

JavaScript是如何工作的:与WebAssembly比较及其使用场景

*摘要&#xff1a;** WebAssembly未来可期。 原文&#xff1a;JavaScript是如何工作的&#xff1a;与WebAssembly比较及其使用场景作者&#xff1a;前端小智Fundebug经授权转载&#xff0c;版权归原作者所有。 这是专门探索 JavaScript及其所构建的组件的系列文章的第6篇。 如果…

Matplotlib中的“ plt”和“ ax”到底是什么?

Indeed, as the most popular and fundamental data visualisation library, Matplotlib is kind of confusing in some perspectives. It is usually to see that someone asking about的确&#xff0c;作为最受欢迎的基础数据可视化库&#xff0c;Matplotlib在某些方面令人困…

2018年阿里云NoSQL数据库大事盘点

2019独角兽企业重金招聘Python工程师标准>>> NoSQL一词最早出现在1998年。2009年Last.fm的Johan Oskarsson发起了一次关于分布式开源数据库的讨论&#xff0c;来自Rackspace的Eric Evans再次提出了NoSQL概念&#xff0c;这时的NoSQL主要是指非关系型、分布式、不提供…

cayenne:用于随机模拟的Python包

TL;DR; We just released v1.0 of cayenne, our Python package for stochastic simulations! Read on to find out if you should model your system as a stochastic process, and why you should try out cayenne.TL; DR; 我们刚刚发布了 cayenne v1.0 &#xff0c;这是我们…

java 如何将word 转换为ftl_使用 freemarker导出word文档

近日需要将人员的基本信息导出&#xff0c;存储为word文档&#xff0c;查阅了很多资料&#xff0c;最后选择了使用freemarker&#xff0c;网上一共有四种方式&#xff0c;效果都一样&#xff0c;选择它呢是因为使用简单&#xff0c;再次记录一下,一个简单的demo&#xff0c;仅供…