# 因果推断｜反事实（二）

Posted by Derek on June 27, 2020

# 非确定性的反事实

## 1. 反事实的概率

\begin{aligned} X&=aU \\ Y&=bX+U \end{aligned}

Table 1.1 The values attained by $X(u), Y(u), Y_x(u),$ and $X_y(u)$ in the linear model
 $u$ $X(u)$ $Y(u)$ $Y_1(u)$ $Y_2(u)$ $Y_3(u)$ $X_1(u)$ $X_2(u)$ $X_3(u)$ $1$ $1$ $2$ $2$ $3$ $4$ $1$ $1$ $1$ $2$ $2$ $4$ $3$ $4$ $5$ $2$ $2$ $2$ $3$ $3$ $6$ $4$ $5$ $6$ $3$ $3$ $3$

\begin{aligned} X&=U_1 \\ Z&=aX+U_2 \\ Y&=bZ \end{aligned}

Figure 1.1 A graphical model1

Table 1.2 The values attained by $X(u), Y(u), Z(u), Y_0(u), Y_1(u), Z_0(u)$ and $Z_1(u)$ in the linear model
 $X=u_1, Z=aX+u_2, Y=bZ$ $u_1$ $u_2$ $X(u)$ $Z(u)$ $Y(u)$ $Y_0(u)$ $Y_1(u)$ $Z_0(u)$ $Z_1(u)$ $0$ $0$ $0$ $0$ $0$ $0$ $ab$ $0$ $a$ $0$ $1$ $0$ $1$ $b$ $b$ $(a+1)b$ $1$ $a+1$ $1$ $0$ $1$ $a$ $ab$ $0$ $ab$ $0$ $a$ $1$ $1$ $1$ $a+1$ $(a+1)b$ $b$ $(a+1)b$ $1$ $a+1$

## 2. 反事实的图示化

Figure 2.1 (a) The original model. (b) The modified model $M_x$ in which the node labeled $Y_x$ represents the potential outcome $Y$ predicated on $X=x.$2

\begin{aligned} P(Y_x=y)&=\sum_z P(Y_x=y|Z=z)P(z) \\&=\sum_z P(Y_x=y|Z=z, X=x)P(z) \\&=\sum_z P(Y=y|Z=z, X=x)P(z) \end{aligned}

## 3. 实验环境中的反事实

Table 3.1 Potential and observed outcomes predicted by the structural model (units were selected at random, with each $U_i \sim \text{Unif}[0, 1]$)
 Participant characteristics Observed behavior Predicted potential outcomes Participant $U_X$ $U_H$ $U_Y$ $X$ $Y$ $H$ $Y_0$ $Y_1$ $H_0$ $H_1$ $Y_{00}\cdots$ $1$ $0.5$ $0.75$ $0.75$ $0.5$ $1.50$ $1.0$ $1.05$ $1.95$ $0.75$ $1.25$ $0.75$ $2$ $0.3$ $0.1$ $0.4$ $0.3$ $0.71$ $0.25$ $0.44$ $1.34$ $0.1$ $0.6$ $0.4$ $3$ $0.5$ $0.9$ $0.2$ $0.5$ $1.01$ $1.15$ $0.56$ $1.46$ $0.9$ $1.4$ $0.2$ $4$ $0.6$ $0.5$ $0.3$ $0.6$ $1.04$ $0.8$ $0.50$ $1.40$ $0.5$ $1.0$ $0.3$ $5$ $0.5$ $0.8$ $0.9$ $0.5$ $1.67$ $1.05$ $1.22$ $2.12$ $0.8$ $1.3$ $0.9$ $6$ $0.7$ $0.9$ $0.3$ $0.7$ $1.29$ $1.25$ $0.66$ $1.56$ $0.9$ $1.4$ $0.3$ $7$ $0.2$ $0.3$ $0.8$ $0.2$ $1.10$ $0.4$ $0.92$ $1.82$ $0.3$ $0.8$ $0.8$ $8$ $0.4$ $0.6$ $0.2$ $0.4$ $0.80$ $0.8$ $0.44$ $1.34$ $0.6$ $1.1$ $0.2$ $9$ $0.6$ $0.4$ $0.3$ $0.6$ $1.00$ $0.7$ $0.46$ $1.36$ $0.4$ $0.9$ $0.3$ $10$ $0.3$ $0.8$ $0.3$ $0.3$ $0.89$ $0.95$ $0.62$ $1.52$ $0.8$ $1.3$ $0.3$

Table 3.2 Potential and observed outcomes in a randomized clinical trial with $X$ randomized over $X=0$ and $X=1$
 Predicted potential outcomes Observed outcomes Participant $Y_0$ $Y_1$ $Y_0$ $Y_1$ $1$ $1.05$ $1.95$ $1.05$ $/$ $2$ $0.44$ $1.34$ $/$ $1.34$ $3$ $0.56$ $1.46$ $/$ $1.46$ $4$ $0.50$ $1.40$ $/$ $1.40$ $5$ $1.22$ $2.12$ $1.22$ $/$ $6$ $0.66$ $1.56$ $0.66$ $/$ $7$ $0.92$ $1.82$ $/$ $1.82$ $8$ $0.44$ $1.34$ $0.44$ $/$ $9$ $0.46$ $1.36$ $/$ $1.36$ $10$ $0.62$ $1.52$ $0.62$ $/$ True average treatment effect: $0.90$ Study average treatment effect: $0.68$

## 4. 线性模型中的反事实

\begin{aligned} \text{ETT}&=\mathbb{E}[Y_1|X=1]-\mathbb{E}[Y_0|X=1] \\&=\mathbb{E}[Y|X=1]-\mathbb{E}[Y|X=1]+\tau(1-\mathbb{E}[X|X=1])-\tau(0-\mathbb{E}[X|X=1]) \\&=\tau \\&=b+ac=0.9 \end{aligned}

# Reference

1. Pearl, J., Glymour, M., & Jewell, N. P. (2016). Causal inference in statistics: A primer. John Wiley & Sons, 99.

2. Pearl, J., Glymour, M., & Jewell, N. P. (2016). Causal inference in statistics: A primer. John Wiley & Sons, 102.