Casual inference 综述框架

2023-10-27

A survey on causal inference

因果推理综述——《A Survey on Causal Inference》一文的总结和梳理

因果推断理论解读

Rubin因果模型的三个假设

基础理论

理论框架

名词解释

  • individual treatment effect :ITE = Y 1 i − Y 0 i Y_{1i}-Y_{0i} Y1iY0i
  • average treatment effect :ATE= E ( Y 1 i − Y 0 i ) E(Y_{1i}-Y_{0i}) E(Y1iY0i)
  • conditional treatment effect :CAPE = E ( Y 1 i − Y 0 i ∣ X ) E(Y_{1i}-Y_{0i}|X) E(Y1iY0iX)

两个挑战

  • counterfact:无法观测到反事实数据
  • confounder bias:treatment不是随机分配

1 Rubin Causal Model(RCM)

potential outcome model (虚拟事实模型 ),也叫做Rubin Causal Model(RCM),希望估计出每个unit或者整体平均意义下的potential outcome,进而得到干预效果treatment effect(eg. ITE/ATE)。

因此准确地估计出potential outcome是该框架的关键,由于混杂因子confounder的存在,观察到的数据不用直接用来近似potential outcome,需要有进一步的处理。

核心思想:准确估计potential outcome,寻找对照组

  • matching:根据倾向得分,找到最佳对照组
  • weighting/pairing:重加权
  • subclassification/stratification:分层,求得CATE

2 Pearl Causal Graph(SCM)

通过计算因果图中的条件分布,获得变量之间的因果关系。有向图指导我们使用这些条件分布来消除估计偏差,其核心也是估计检验分布、消除其他变量带来的偏差。

  • 链式结构:常见在前门路径,A -> C一定需要经过B
  • 叉式结构:中间节点B通常被视为A和C的共因(common cause)或混杂因子(confounder )。混杂因子会使A和C在统计学上发生关联,即使它们没有直接的关系。经典例子:“鞋的尺码←孩子的年龄→阅读能力”,穿较大码的鞋的孩子年龄可能更大,所以往往有着更强的阅读能力,但当固定了年龄之后,A和C就条件独立了。
  • 对撞结构:AB、BC相关,AC不相关;给定B时,AC相关

三个假设

1. 无混淆性(Unconfoundedness)

也称之为「条件独立性假设」(conditional independence assumption, CIA),即解决X->T的路径。

Given the background variable, X, treatment assignment T is independent to the potential outcomes Y

( Y 1 , Y 0 ) ⊥ W ∣ X (Y_1, Y_0) \perp W | X (Y1,Y0)WX

在这里插入图片描述

该假设使得具有相同X的unit是随机分配的。

2. 正值(Positivity)

For any value of X, treatment assignment is not deterministic

P ( W = w ∣ X = x ) > 0 P(W=w \mid X=x)>0 P(W=wX=x)>0

干预一定要有实验样本;干预、混杂因子越多,所需的样本也越多

3. 一致性(Consistency)

也可以叫「稳定单元干预值假设」(Stable Unit Treatment Value Assumption, SUTVA)

The potential outcomes for any unit do not vary with the treatment assigned to other units, and, for each unit, there are no different forms or versions of each treatment level, which lead to different potential outcomes.

任意单元的潜在结果都不会因其他单元的干预发生改变而改变,且对于每个单元,其所接受的每种干预不存在不同的形式或版本,不会导致不同的潜在结果。

混淆因素

Confounders are the variables that affect both the treatment assignment and the outcome.

Confounder大多会引起伪效应(spurious effect)和选择偏差(selection bias)。

  • 针对spurious effect,根据X分布进行权重加和
     ATE  = ∑ x p ( x ) E [ Y F ∣ X = x , W = 1 ] − ∑ x p ( x ) E [ Y F ∣ X = x , W = 0 ] \text { ATE }=\sum_x p(x) \mathbb{E}\left[Y^F\mid X=x, W=1\right]-\sum_x p(x) \mathbb{E}\left[Y^F \mid X=x, W=0\right]  ATE =xp(x)E[YFX=x,W=1]xp(x)E[YFX=x,W=0]

  • 针对selection bias,为每个group找到对应的pseudo group,如sample re-weighting, matching, tree-based methods, confounder balancing, balanced representation learning methods, multi-task-based methods

建模方法

1. re-weighting methods*

在这里插入图片描述

By assigning appropriate weight to each unit in the observational data, a pseudo-population can be created on which the distributions of the treated group and control group are similar.

通过给每个观测数据分配权重,调整treatment和control两个组的分布,使其接近。关键在于怎么选择balancing score,propensity score是特殊情况。

e ( x ) = Pr ⁡ ( W = 1 ∣ X = x ) e(x)=\operatorname{Pr}(W=1 \mid X=x) e(x)=Pr(W=1X=x)

The propensity score can be used to balance the covariates in the treatment and control groups and therefore reduce the bias through matching, stratification (subclassification), regression adjustment, or some combination of all three.


1. Propensity Score Based Sample Re-weighting

IPW r = W e ( x ) + 1 − W 1 − e ( x ) r=\frac{W}{e(x)}+\frac{1-W}{1-e(x)} r=e(x)W+1e(x)1W,用r给每个样本算权重
A T E I P W = 1 n ∑ i = 1 n W i Y i F e ^ ( x i ) − 1 n ∑ i = 1 n ( 1 − W i ) Y i F 1 − e ^ ( x i ) \mathrm{ATE}_{I P W}=\frac{1}{n} \sum_{i=1}^n \frac{W_i Y_i^F}{\hat{e}\left(x_i\right)}-\frac{1}{n} \sum_{i=1}^n \frac{\left(1-W_i\right) Y_i^F}{1-\hat{e}\left(x_i\right)} ATEIPW=n1i=1ne^(xi)WiYiFn1i=1n1e^(xi)(1Wi)YiF
经normalization,
A T E I P W = ∑ i = 1 n W i Y i F e ^ ( x i ) / ∑ i = 1 n W i e ^ ( x i ) − ∑ i = 1 n ( 1 − W i ) Y i F 1 − e ^ ( x i ) / ∑ i = 1 n ( 1 − W i ) 1 − e ^ ( x i ) \mathrm{ATE}_{I P W}=\sum_{i=1}^n \frac{W_i Y_i^F}{\hat{e}\left(x_i\right)} / \sum_{i=1}^n \frac{W_i}{\hat{e}\left(x_i\right)}-\sum_{i=1}^n \frac{\left(1-W_i\right) Y_i^F}{1-\hat{e}\left(x_i\right)} / \sum_{i=1}^n \frac{\left(1-W_i\right)}{1-\hat{e}\left(x_i\right)} ATEIPW=i=1ne^(xi)WiYiF/i=1ne^(xi)Wii=1n1e^(xi)(1Wi)YiF/i=1n1e^(xi)(1Wi)

缺点:极大依赖e(X)估计的准确性

DR:解决propensity score估计不准的问题

A T E D R = 1 n ∑ i = 1 n { [ W i Y i F e ^ ( x i ) − W i − e ^ ( x i ) e ^ ( x i ) m ^ ( 1 , x i ) ] − [ ( 1 − W i ) Y i F 1 − e ^ ( x i ) − W i − e ^ ( x i ) 1 − e ^ ( x i ) m ^ ( 0 , x i ) ] } = 1 n ∑ i = 1 n { m ^ ( 1 , x i ) + W i ( Y i F − m ^ ( 1 , x i ) ) e ^ ( x i ) − m ^ ( 0 , x i ) − ( 1 − W i ) ( Y i F − m ^ ( 0 , x i ) ) 1 − e ^ ( x i ) } \begin{aligned} \mathrm{ATE}_{D R} &=\frac{1}{n} \sum_{i=1}^n\left\{\left[\frac{W_i Y_i^F}{\hat{e}\left(x_i\right)}-\frac{W_i-\hat{e}\left(x_i\right)}{\hat{e}\left(x_i\right)} \hat{m}\left(1, x_i\right)\right]-\left[\frac{\left(1-W_i\right) Y_i^F}{1-\hat{e}\left(x_i\right)}-\frac{W_i-\hat{e}\left(x_i\right)}{1-\hat{e}\left(x_i\right)} \hat{m}\left(0, x_i\right)\right]\right\} \\ &=\frac{1}{n} \sum_{i=1}^n\left\{\hat{m}\left(1, x_i\right)+\frac{W_i\left(Y_i^F-\hat{m}\left(1, x_i\right)\right)}{\hat{e}\left(x_i\right)}-\hat{m}\left(0, x_i\right)-\frac{\left(1-W_i\right)\left(Y_i^F-\hat{m}\left(0, x_i\right)\right)}{1-\hat{e}\left(x_i\right)}\right\} \end{aligned} ATEDR=n1i=1n{[e^(xi)WiYiFe^(xi)Wie^(xi)m^(1,xi)][1e^(xi)(1Wi)YiF1e^(xi)Wie^(xi)m^(0,xi)]}=n1i=1n{m^(1,xi)+e^(xi)Wi(YiFm^(1,xi))m^(0,xi)1e^(xi)(1Wi)(YiFm^(0,xi))}
m ^ ( 1 , x i ) \hat{m}\left(1, x_i\right) m^(1,xi) m ^ ( 0 , x i ) \hat{m}\left(0, x_i\right) m^(0,xi)是treatment和control两组的回归模型

The estimator is robust even when one of the propensity score or outcome regression is incorrect (but not both).


2. Confounder Balancing

D2VD :Data-Driven Variable Decomposition

根据seperation assumption,变量分为confounder、adjusted variables和irrelavant variables。
A T E D 2 V D = E [ ( Y F − ϕ ( z ) ) W − p ( x ) p ( x ) ( 1 − p ( x ) ) ] \mathrm{ATE}_{\mathrm{D}^2 \mathrm{VD}}=\mathbb{E}\left[\left(Y^F-\phi(\mathrm{z})\right) \frac{W-p(x)}{p(x)(1-p(x))}\right] ATED2VD=E[(YFϕ(z))p(x)(1p(x))Wp(x)]
其中,z为调整变量

假设 α , β \alpha,\beta αβ分别分离调整变量和混淆变量,即 Y D 2 V D ∗ = ( Y F − X α ) ⊙ R ( β ) Y_{\mathrm{D}^2 \mathrm{VD}}^*=\left(Y^F-X \alpha\right) \odot R(\beta) YD2VD=(YFXα)R(β) γ \gamma γd对应所有变量的ATE结果,则问题可以建模成

minimize ⁡ ∥ ( Y F − X α ) ⊙ R ( β ) − X γ ∥ 2 2  s.t.  ∑ i = 1 N log ⁡ ( 1 + exp ⁡ ( 1 − 2 W i ) ⋅ X i β ) ) < τ ∥ α ∥ 1 ≤ λ , ∥ β ∥ 1 ≤ δ , ∥ γ ∥ 1 ≤ η , ∥ α ⊙ β ∥ 2 2 = 0 \begin{aligned} \operatorname{minimize} &\left\|\left(Y^F-X \alpha\right) \odot R(\beta)-X \gamma\right\|_2^2 \\ \text { s.t. } &\left.\sum_{i=1}^N \log \left(1+\exp \left(1-2 W_i\right) \cdot X_i \beta\right)\right)<\tau \\ &\|\alpha\|_1 \leq \lambda,\|\beta\|_1 \leq \delta,\|\gamma\|_1 \leq \eta,\|\alpha \odot \beta\|_2^2=0 \end{aligned} minimize s.t.  (YFXα)R(β)Xγ 22i=1Nlog(1+exp(12Wi)Xiβ))<τα1λ,β1δ,γ1η,αβ22=0

第一个约束是正则项,最后一个约束保证调整变量和混淆变量的分离


2. stratification methods

A T E strat  = τ ^ strat  = ∑ j = 1 J q ( j ) [ Y ˉ t ( j ) − Y ˉ c ( j ) ] \mathrm{ATE}_{\text {strat }}=\hat{\tau}^{\text {strat }}=\sum_{j=1}^J q(j)\left[\bar{Y}_t(j)-\bar{Y}_c(j)\right] ATEstrat =τ^strat =j=1Jq(j)[Yˉt(j)Yˉc(j)]
其中,一共分成J个block,且 q ( j ) q(j) q(j)为j-th block的比例

关键在于如何划分block,典型方法有等频法,基于出现概率(如PS)划分相似样本。但是,该方法在两侧重叠区域小,从而导致高方差。

However, this approach suffers from high variance due to the insufficient overlap between treated and control groups in the blocks whose propensity score is very high or low.

3. matching methods*

在这里插入图片描述

4. tree-based methods*

This approach is different from conventional CART in two aspects. First, it focuses on estimating conditional average treatment effects instead of directly predicting outcomes as in the conventional CART. Second, different samples are used for constructing the partition and estimating the effects of each subpopulation, which is referred to as an honest estimation. However, in the conventional CART, the same samples are used for these two tasks.

5. representation based methods


1. Domain Adaptation Based on Representation Learning

Unlike the randomized control trials, the mechanism of treatment assignment is not explicit in observational data. The counterfactual distribution will generally be
different from the factual distribution.

关键在于缩小反事实分布和实际分布的差别,即源域和目标域


6. multi-task methods

7. meta-learning methods*


1. S-learner

S-learner是将treatment作为特征,所有数据一起训练

  • step1: μ ( T , X ) = E [ Y ∣ T , X ] \mu(T, X)=E[Y \mid T, X] μ(T,X)=E[YT,X]
  • step2: τ ^ = 1 n ∑ i ( μ ^ ( 1 , X i ) − μ ^ ( 0 , X i ) ) \hat{\tau}=\frac{1}{n} \sum_i\left(\hat{\mu}\left(1, X_i\right)-\hat{\mu}\left(0, X_i\right)\right) τ^=n1i(μ^(1,Xi)μ^(0,Xi))

该方法不直接建模uplift,X的high dimension可能会导致treatment丢失效果。


2. T-learner

T-learner分别对control和treatment组建模

  • step1: μ 1 ( X ) = E [ Y ∣ T = 1 , X ] μ 0 ( X ) = E [ Y ∣ T = 0 , X ] \mu_1(X)=E[Y \mid T=1, X] \quad \mu_0(X)=E[Y \mid T=0, X] μ1(X)=E[YT=1,X]μ0(X)=E[YT=0,X]
  • step2: τ ^ = 1 n ∑ i ( μ ^ 1 ( X i ) − μ 0 ^ ( X i ) ) \hat{\tau}=\frac{1}{n} \sum_i\left(\hat{\mu}_1\left(X_i\right)-\hat{\mu_0}\left(X_i\right)\right) τ^=n1i(μ^1(Xi)μ0^(Xi))

每个estimator只使用部分数据,尤其当样本不足或者treatment、control样本量差别较大时,模型variance较大(对数据利用效率低);容易出现两个模型的Bias方向不一致,形成误差累积,使用时需要针对两个模型打分分布做一定校准;同时当数据差异过大时(如数据量、采样偏差等),对准确率影响较大。


3. X-learner

X-Learner在T-Learner基础上,利用了全量的数据进行预测,主要解决Treatment组间数据量差异较大的情况。

  • step1: 对实验组和对照组分别建立两个模型 μ ^ 1 \hat \mu_1 μ^1 μ ^ 0 \hat \mu_0 μ^0
    D 0 = μ ^ 1 ( X 0 ) − Y 0 D 1 = Y 1 − μ ^ 0 ( X 1 ) \begin{aligned} &D_0=\hat{\mu}_1\left(X_0\right)-Y_0 \\ &D_1=Y_1-\hat{\mu}_0\left(X_1\right) \end{aligned} D0=μ^1(X0)Y0D1=Y1μ^0(X1)
  • step2: 对求得的实验组和对照组增量D1和 D 0 D 0 D0 建立两个模型 τ ^ 1 \hat{\tau}_1 τ^1 τ ^ 0 \hat{\tau}_0 τ^0
    τ ^ 0 = f ( X 0 , D 0 ) τ ^ 1 = f ( X 1 , D 1 ) \begin{aligned} &\hat{\tau}_0=f\left(X_0, D_0\right) \\ &\hat{\tau}_1=f\left(X_1, D_1\right) \end{aligned} τ^0=f(X0,D0)τ^1=f(X1,D1)
  • step3: 引入倾向性得分模型 e ( x ) e(x) e(x) 对结果进行加权,求得增量。
    e ( x ) = P ( W = 1 ∣ X = x ) τ ^ ( x ) = e ( x ) τ ^ 0 ( x ) + ( 1 − e ( x ) ) τ ^ 1 ( x ) \begin{aligned} &e(x)=P(W=1 \mid X=x) \\ &\hat{\tau}(x)=e(x) \hat{\tau}_0(x)+(1-e(x)) \hat{\tau}_1(x) \end{aligned} e(x)=P(W=1X=x)τ^(x)=e(x)τ^0(x)+(1e(x))τ^1(x)

4. R-learner

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Casual inference 综述框架 的相关文章

  • t检验.医学统计实例详解

    t检验是医学统计学中常用的一种假设检验方法 用于比较两个样本均值是否有显著差异 它可以帮助医学研究者确定一个治疗方法或药物是否显著地改善了患者的症状或生理指标 在医学研究中 t检验常被用来 比较两个独立样本的均值 例如 比较一个治疗组和一个

随机推荐

  • proto 编译命令

    proto 编译命令 protoc I python out src test test proto
  • 深入理解Linux网络技术内幕——网络设备初始化

    概述 内核的初始化过程过程中 与网络相关的工作如下所示 内核引导时执行 start kernel start kernel结束之前会调用rest init rest init初始化 内核线程init 在Linux3 12中为kernel i
  • C语言第四章第2节用if语句实现选择结构学习导案

    课 题 4 2 用if语句实现选择结构 课时安排 2课时 课 型 新授 学 习目标 掌握if语句 if else语句 if else if else语句的一般形式 掌握if语句 if else语句 if else if else语句的执行过
  • 微信小程序云开发源码(垃圾分类源码)

    目录 微信小程序云开发源码 垃圾分类源码 小程序云数据库介绍 小程序界面 可搜索名称 大众垃圾分类 小程序体验 微信小程序源码 源码地址 https pan baidu com s 1U19Suzs3nZnMt5OHNGUahQ 提取码 z
  • Mysql表关系 连接查询

    表关联查询 文章目录 表关联查询 内连接 左连接 右连接 如果多个表存在一定关联关系 可以多表在一起进行查询操作 其实表的关联整理与外键约束之间并没有必然联系 但是基于外键约束设计的具有关联性的表往往会更多使用关联查询查找数据 简单多表查询
  • C++ default constructor 讨论

    豆瓣是个好地方 可以找到很多好书 最近翻到了Lippman的inside the c object model 今天看了关于默然构造函数部分 对这个东西有了新的理解 又找出c standard对照着看了看 首先看c standard 12
  • webview加载完成监听

    最近由于产品需要 一个页面上部分是一个WebView 下面是一些文字介绍 但是在赋值时 HTML网页加载会消耗一定时间 在其加载过程中 文字已经展示出来 给用户的体验很不好 所以我就想在webview加载成功结束后再给文字赋值 于是在网上搜
  • 云服务器Docker安装ElasticSearch却启动不了怎么办?

    下载镜像 docker pull elasticsearch 启动容器 docker run d name es p 9200 9200 p 9300 9300 e discovery type single node elasticsea
  • 用WinDbg断点调试FFmpeg

    本文主要讲解 WinDbg 调试器的使用 WinDbg 在 Windows 里面的地位 就跟 GDB 在 Linux 的地位一样 可以通过 微软的官方网站 下载 安装 WinDbg WinDbg 是比较轻量级的调试工具 在一些场景下比较实用
  • 联想服务器esxi虚拟化,企业服务器管理必备——VMware ESXI虚拟化服务器搭建

    现在企业虚拟化服务器使用越来越多 这是一篇VMware虚拟化服务器搭建教程 让我们开始吧 制作U盘安装ESXI镜像 1 使用Linux系统制作U盘启动镜像 UltraISO制作的镜像不能用 必须依赖Linux系统 安装镜像制作工具 yum
  • Hadoop3.x 之 MapReduce 框架原理(月薪过万 第九章下)

    Hadoop3 x 之 MapReduce 框架原理 一 MapTask工作机制 二 ReduceTask 工作机制 三 ReduceTask 并行度决定机制 四 MapTask 源码解析流程 五 ReduceTask 源码解析流程 六 R
  • c++在多个源文件中定义同一个类

    在自己写代码练习时 创建好多个源文件 然后有些文件又定义了相同的类 比如源文件1 class B public B B 源文件2 class B public B new A B 然后在运行源文件2的时候一直都没有进入到构造函数里面去 最后
  • matlab函数之reshape()

    reshape 重构数组 功能 B reshape A sz 按矢量sz定义的维度 包括行数 列数 维数 重构矩阵A来得到矩阵B 实现原理 先将矩阵A先排列成一列 结果感受就是按列优先排列 再按照矢量sz定义大小的行数切割 结构及实例 A
  • 区间图着色问题

    这是算法导论贪心算法一章的一个习题 题目描述 假定有一组活动 我们需要将它们安排到一些教室 任意活动都可以在任意教室进行 我们希望使用最少的教室完成所有的活动 设计一个高效的贪心算法求每个活动应该在哪个教室进行 这个问题称为区间图着色问题
  • 在Linux应用程序中打印函数调用栈

    在Linux中打印函数调用栈 要求 在Linux系统的应用程序中写一个函数print stackframe 用于获取当前位置的函数调用栈信息 方法 execinfo h库下的函数backtrace可以得到当前线程的函数调用栈指针和调用栈深度
  • ODOO15固定资产管理系统解决方案(原创)

    有些公司固定资产众多 而且涉及到在建工程的费用归集及在建工程结转固定资产等复杂情况 使用ODOO系统如何来解决这个客户需要解决的问题呢 我们根据自身的实施经验 分享ODOO固定资产的管理解决方案 1 资产分类设置 资产众多 需要进行类别设置
  • 谷歌云GCP

    感谢公司赞助了Google Cloud Platform GCP Coursera课程 https www coursera org 包括云基础设施 应用开发 数据湖和数据仓库相关知识 其中谷歌云的实验操作平台是 https www qwi
  • 数据库系统丨关系代数运算总结

    文章目录 1 需要记忆的符号 2 集合运算 1 并运算 2 差运算 3 交运算 4 广义笛卡尔积 3 关系运算 1 选择 Selection 2 投影 Projection 3 连接 Join 4 除 Division 1 需要记忆的符号
  • VOT 数据集 groundtruth 8个维度 转成 4个维度的方法

    VOT数据集由于加入了带旋转角度的boundingbox 使得其groundtruth的维度达到了8个 如下 8个维度就代表boundingbox的4个点 比如VOT16中 bag数据序列的groundtruth第一行 334 02 128
  • Casual inference 综述框架

    A survey on causal inference 因果推理综述 A Survey on Causal Inference 一文的总结和梳理 因果推断理论解读 Rubin因果模型的三个假设 基础理论 理论框架 名词解释 individ