SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Yaroslav Kivva
School of Computer and Communication Sciences
EPFL, Lausanne, Switzerland
yaroslav.kivva@epfl.ch
Saber Salehkaleybar
saber-salehkaleybar@epfl.ch
Negar Kiyavash
College of Management of Technology
negar.kiyavash@epfl.ch
We consider the problem of estimating the causal effect of a treatment on an outcome in linear structural causal models (SCM) with latent confounders when we have access to a single proxy variable. Several methods (such as difference-in-difference (DiD) estimator or negative outcome control) have been proposed in this setting in the literature. However, these approaches require either restrictive assumptions on the data generating model or having access to at least two proxy variables. We propose a method to estimate the causal effect using cross moments between the treatment, the outcome, and the proxy variable. In particular, we show that the causal effect can be identified with simple arithmetic operations on the cross moments if the latent confounder in linear SCM is non-Gaussian. In this setting, DiD estimator provides an unbiased estimate only in the special case where the latent confounder has exactly the same direct causal effects on the outcomes in the pre-treatment and post-treatment phases. This translates to the common trend assumption in DiD, which we effectively relax. Additionally, we provide an impossibility result that shows the causal effect cannot be identified if the observational distribution over the treatment, the outcome, and the proxy is jointly Gaussian. Our experiments on both synthetic and real-world datasets showcase the effectiveness of the proposed approach in estimating the causal effect.
Estimating the effect of a treatment (or an action) on an outcome is an important problem in many fields such as healthcare [SJS17], social sciences [Gan10], and economics [IR]. Randomized control trials are the gold standard to estimate causal effects. However, in many applications, performing randomized experiments are too costly or even infeasible, say due to ethical or legal concerns. Thus, estimating the causal effect from merely observational studies is one of the main topics of interest in causal inference. This problem has been studied extensively in two main frameworks, potential outcome (PO) framework [Rub74] and structural causal model (SCM) framework [Pea09]. The main
quantity of interest in PO framework is the individual-based response variable, i.e., the value of outcome for a specific individual in the population considering a particular value for the treatment. In SCM framework, a set of structural causal assignments are defined to describe the data generation mechanism among a set of variables. This set of assignments is often represented by a directed acyclic graph (DAG) to show the causal relationships among the variables in the model. It can be shown that the two frameworks are logically equivalent in the sense that any theorem in one can be translated to the other [PJS17].
Difference-in-Difference (DiD)  $[\mathrm{L}^{+}11]$  is one of the most frequently used non-experimental methods to estimate the effect of a treatment by comparing the average of outcome before and after applying the treatment in a treatment and control group. In fact, 26 of 100 most cited papers published by the American Economic Review used some variant of DiD or two-way fixed effect (an extension to multi-group and multi-time slots) to estimate the causal effect [DCD22]. DiD is an estimation process in PO framework for the setting where we have access to a population partitioned into control and treatment groups. The goal is to estimate the effect of treatment  $D$  on outcome  $Y$  where  $D$  is equal to one if a treatment is given to an individual and zero otherwise. It is also assumed that the value of the outcome is observed just before giving any treatment (this pre-treatment value is denoted by  $Z$ ) and it can be seen as a proxy variable for latent common causes of  $D$  and  $Y$ . DiD method computes the causal effect by subtracting the difference of average outcome in two groups before applying treatment (i.e.,  $\mathbb{E}[Z|D = 1] - \mathbb{E}[Z|D = 0]$ ) from the one after the treatment (i.e.,  $\mathbb{E}[Y|D = 1] - \mathbb{E}[Y|D = 0]$ ). It can be shown the output of DiD is an unbiased estimate of the causal effect under some assumptions such as the parallel/common trend assumption which states that the outcome of the treatment group would have followed the same trend as the control group in the absence of the treatment (see (2) for the exact definition).
Although the initial setting of DiD is in PO framework, its counterpart in the SCM framework was considered in the negative outcome control approach  $\mathrm{[SRC^{+}16]}$ . A negative outcome variable is a type of proxy variable that is not causally affected by the treatment. The causal graph in this approach is represented in Figure 1 where the unmeasured common cause of  $D$  and  $Y$  is represented by a latent variable  $U$  and  $D$  is not a cause of proxy variable  $Z$ . The causal effect of  $D$  on  $Y$  cannot be identified from the observational distribution over
Figure 1: The suggested causal graph in SCM framework for the approaches in DiD and negative outcome control.
$(D,Y,Z)$  because of the common confounder  $U$ . However, imposing further assumptions on the SCM, the causal effect of  $D$  on  $Y$  can become identified. Such assumptions include monotonicity [SRC+16], knowledge of the conditional probability  $P(Z|U)$  [KP14], or having at least two proxy variables [KP14, MGTT18,  $\mathrm{TYC}^{+}20$ , CPS+20], all of which may not hold in practice (see related work in Section 4 for a more detailed discussion). Recently, [SGKZ20] considered linear SCMs with non-Gaussian exogenous noise and proposed a method that can identify the causal effect for the causal graph in Figure 1 from the observational distribution over  $(D,Y,Z)$ . The proposed method is based on solving an over-complete independent component analysis (OICA) [HKO01]. However given the landscape of the optimization problem, in practice, OICA can get stuck in bad local minima and return wrong results [DGZT19].
In this paper, we consider the setup in causal graph in Figure 1 in linear SCM where we have access to a proxy variable  $Z$ . We propose a "Cross-Moment" algorithm that estimates the causal effect using cross moments between the treatment, the outcome, and the proxy variable. Our main contributions are as follows:
- We show that the causal effect can be identified correctly from the observational distribution if there exists  $n \in \mathbb{N}$  such that for the latent confounder  $U$ , we have:  $\mathbb{E}[U^n] \neq (n - 1)\mathbb{E}[U^{n - 2}]\mathbb{E}[U^2]$  (Theorem 1). Under additional mild assumption (Assumption 3), this condition implies that our proposed method can recover the causal effect when  $U$  is non-Gaussian. Additionally, when the observational distribution is jointly Gaussian, we prove that it is impossible to identify the causal effect uniquely (Theorem 3).
1 More precisely, at most one of the exogenous noises in the system can be Gaussian.
- Unlike previous work [SGKZ20, AHZ21,  $\mathrm{YGN}^{+}22$ ] which requires solving an OICA problem, the proposed approach only performs simple arithmetic operations on cross moments. Therefore, it does not suffer from the drawbacks of OICA such as getting stuck in bad local optima.
- We show that DiD estimator in general provides a biased estimate of the causal effect over the data generated by the linear SCM consistent with the causal graph in Figure 1 unless the latent confounder has exactly the same values of direct causal effects on the outcomes in the pre-treatment and post-treatment phases. Our proposed method does not require such a strong restriction.
The structure of the paper is as follows. In Section 2, we define the notation and provide some background on DiD estimator. In Section 3, we describe Cross-Moment algorithm and show that it recovers the true causal effect under mild assumptions on the distribution of the latent confounder. We also show that DiD estimator is in general biased if the data generative model follows a linear SCM. In Section 4, we review the related work. In Section 5, we evaluate the proposed algorithm experimentally and show its superior performance compared to the state of the art. Finally, we conclude the paper in Section 6.
2 Preliminaries and Notations
Throughout the paper, we denote random variables by capital letters and their realizations by small letters e.g.,  $X$  and  $x$ , respectively. Bold capital letters are used to specify a set of random variables and their realizations are denoted by small capital letters (e.g.,  $\mathbf{X}$  and  $\mathbf{x}$ ).
A SCM  $\mathcal{M}$  over a set of random variables  $\mathbf{V}$  is defined by a set of assignments  $\{X := f_X^{\mathcal{M}}(Pa_{\mathcal{G}}(X), \epsilon_X)\}_{X \in \mathbf{V}}$ , where  $\epsilon_X$  is the exogenous noise corresponding to  $X$  and  $Pa_{\mathcal{G}}(X) \subseteq \mathbf{V}$ . It is assumed that the exogenous noises are mutually independent. Let us denote by  $\mathbf{O}$  and  $\mathbf{U}$ , the set of observed and unobserved variables in  $\mathbf{V}$ , respectively. Note that  $\mathbf{V} = \mathbf{O} \cup \mathbf{U}$  and  $\mathbf{O} \cap \mathbf{U} = \emptyset$ .
The set of assignments in SCM  $\mathcal{M}$  is commonly represented by a DAG. Let  $\mathcal{G} = (\mathbf{V},\mathbf{E})$  be a DAG with the set of vertices  $\mathbf{V}$  and set of edges  $\mathbf{E}$ . For ease of notation, we use the notation of  $\mathbf{V}$  for the set of vertices in the graph. We also use the term "vertex" and "random variable" interchangeably. Each vertex in the graph represents some random variable and each direct edge shows a direct causal relationship between a pair of random variables. In particular, we say that  $X$  is a parent of  $Y$  or, equivalently,  $Y$  is a child of  $X$  if  $(X,Y)\in \mathbf{E}$ . We define  $Pa_{\mathcal{G}}(X)$  as a set of all parents of  $X$  in graph  $\mathcal{G}$ .
2.1 Difference-in-Difference (DiD)
Difference-in-difference (DiD) was proposed in the PO framework in order to estimate the causal effect from observational studies under some assumptions. In this framework, the population under study is divided into control and treatment groups and only individuals in the treatment group receive the treatment. In particular, the treatment variable  $D$  represents treatment assignment which is equal to 1 if the treatment was given and 0 otherwise. Let  $Y(0)$  and  $Y(1)$  be two random variables representing the outcome under treatment value  $D = 0$  and  $D = 1$ , respectively. Denote the value of the outcome right before administering the treatment by  $Z$  and assume it is measurable. Our goal is to obtain the average causal effect in the treatment group  $\mathbb{E}[Y(1) - Y(0)|D = 1]$ . DiD estimate of the average causal effect equals:
$$
\left(\mathbb {E} [ Y | D = 1 ] - \mathbb {E} [ Y | D = 0 ]\right) - \left(\mathbb {E} [ Z | D = 1 ] - \mathbb {E} [ Z | D = 0 ]\right). \tag {1}
$$
This quantity is an unbiased estimate of the average causal effect as long as the following assumptions hold.
- Stable Unit Treatment Value Assumption (SUTVA):
$$
Y = D Y (1) + (1 - D) Y (0).
$$
Common trend assumption:
$$
\mathbb {E} [ Y (0) - Z (0) | D = 1 ] = \mathbb {E} [ Y (0) - Z (0) | D = 0 ]. \tag {2}
$$
SUTVA states that the potential outcome for each individual is not related to the treatment value of the other individuals. The common trend assumption states that there would be the same "trend" in both groups in the absence of treatment which allows us to subtract group-specific means of the outcome in estimating the average causal effect in (1).
3 Methodology: Cross-Moment Algorithm
In this section, we propose Cross-Moment algorithm to estimate the causal effect of treatment  $D$  on outcome  $Y$ . Throughout this section, we consider linear SCMs, i.e., each random variable in SCM  $\mathcal{M}$  is a linear combination of its parents and its corresponding exogenous noise. More precisely, the linear assignments in  $\mathcal{M}$  for the causal graph in Figure 2 are:
$$
U := \epsilon_ {u},
$$
$$
Z := \alpha_ {z} U + \epsilon_ {z} = \alpha_ {z} \epsilon_ {u} + \epsilon_ {z}, \tag {3}
$$
$$
D := \alpha_ {d} U + \epsilon_ {d} = \alpha_ {d} \epsilon_ {u} + \epsilon_ {d},
$$
$$
Y := \beta D + \gamma U + \epsilon_ {y} = (\alpha_ {d} \beta + \gamma) \epsilon_ {u} + \beta \epsilon_ {d} + \epsilon_ {y},
$$
Without loss of generality, we assume that  $\epsilon_{u},\epsilon_{y},\epsilon_{z},\epsilon_{d}$  are arbitrary random variables with zero mean. This assumption can always be achieved by centering the observational data.
Moreover, we assume that the only observed random variables are given by  $\mathbf{O} = \{D,Y,Z\}$ . Our goal is to identify  $\beta$  (the causal effect of  $D$  on  $Y$ ) from the distribution over the observed variables  $\mathbf{O}$ . We consider SCMs that satisfy the following assumption.
Assumption 1. In the linear SCM given by (3),  $\alpha_{z} \neq 0$  and  $\mathrm{Var}(\epsilon_d) > 0$ .
Assumption 1 is necessary for identifying the causal effect. In particular, if  $\alpha_{z} = 0$ , the directed edge from  $U$  to  $Z$  is removed and the causal effect cannot be identified even if all the
Figure 2: The considered causal graph with linear assignments in the SCM framework.
exogenous noises are non-Gaussian as shown in [SGKZ20]. Moreover, if  $\mathrm{Var}(\epsilon_d) = 0$ , then  $\epsilon_{d}$  is zero almost surely (as we assumed that all the exogenous noises are mean zero). In this case, we can construct another SCM  $\mathcal{M}'$  which encodes the same observational distribution as our original SCM but results in a different value of the causal effect of  $D$  on  $Y$  compared to the original SCM. More specifically, in this SCM, we delete the directed edge from  $U$  to  $Y$  and change the structural assignment of  $Y$  to  $Y := (\beta + \gamma / \alpha_{d}) D + \epsilon_{y}$ . Hence, the assumption  $\mathrm{Var}(\epsilon_d) > 0$  is necessary for the unique identification of the causal effect.
Under Assumption 1, it can be shown that:
$$
\beta = \frac {\operatorname {C o v} (D , Y) - \frac {\alpha_ {d}}{\alpha_ {z}} \operatorname {C o v} (Y , Z)}{\operatorname {V a r} (D) - \frac {\alpha_ {d}}{\alpha_ {z}} \operatorname {C o v} (D , Z)}, \tag {4}
$$
where  $\operatorname{Cov}(A, B)$  denotes the covariance of random variables  $A$  and  $B$  and  $\operatorname{Var}(A)$  is the variance of  $A$ .  $\beta$  is identifiable as long as the ratio  $\alpha_d / \alpha_z$  is known as we can obtain  $\operatorname{Cov}(D, Y)$ ,  $\operatorname{Cov}(Y, Z)$ ,  $\operatorname{Var}(D)$ , and  $\operatorname{Cov}(D, Z)$  from the observational distribution. In the sequel, we will show how this ratio can be learnt as long as  $\epsilon_u$  has bounded moments.
Assumption 2. For all  $n\in \mathbb{N}$ , assume that:  $\mathbb{E}[\epsilon_u^n ] < \infty$
When the bounded moment assumption of 2 holds, the following theorem provides an approach for recovering  $\alpha_{d} / \alpha_{z}$ .
Theorem 1. For variables  $Z$  and  $D$  as defined in (3), under Assumptions 2,  $\frac{\alpha_d}{\alpha_z}$  can be determined uniquely if  $\exists n \in \mathbb{N}$  such that:
$$
\mathbb {E} \left[ \hat {\epsilon} _ {u} ^ {n} \right] \neq (n - 1) \mathbb {E} \left[ \hat {\epsilon} _ {u} ^ {n - 2} \right] \mathbb {E} \left[ \hat {\epsilon} _ {u} ^ {2} \right], \tag {5}
$$
where  $\hat{\epsilon}_u = \sqrt{\alpha_d\alpha_z}\epsilon_u$
The detailed proof of the Theorem 1 is provided in the Appendix A.
It is interesting to see for what families of distributions, the condition in Theorem 1 is satisfied. Assume (5) is not satisfied. Recall that from the definition of SCM (3),  $\mathbb{E}[\hat{\epsilon}_u] = 0$  and  $\mathbb{E}[(\hat{\epsilon}_u)^2] = \mathbb{E}[DZ]$ . These in a combination with  $\mathbb{E}[\hat{\epsilon}_u^n] = (n - 1)\mathbb{E}[\hat{\epsilon}_u^{n - 2}]\mathbb{E}[\hat{\epsilon}_u^2]$  for any  $n\in \mathbb{N}$  determine
Figure 3: Example of causal graph extended with two observed covariates, two latent confounders, and corresponding proxy variables.
uniquely all the moments of  $\hat{\epsilon}_u$ . More specifically, recursively solving for  $\mathbb{E}[\hat{\epsilon}_u^n]$  we have  $\mathbb{E}[\hat{\epsilon}_u^n] = (n - 1)!!\mathbb{E}[(\hat{\epsilon}_u)^2]$  for even  $n \geq 1$  and  $\mathbb{E}[\hat{\epsilon}_u^n] = 0$  for odd  $n \geq 1$  where  $n!!$  denotes double factorial. Double factorial notation  $n!!$  denotes the product of all numbers from 1 to  $n$  with the same parity as  $n$ . Specifically the moments of Gaussian distribution satisfy the aforementioned moment equation. Therefore when  $\epsilon_u$  is Gaussian, we cannot identify the causal effect. Under some mild technical assumption on  $\epsilon_u$  (see Assumption 3 in the following), we can prove that the moments of  $\epsilon_u$  uniquely determine its distribution. As a result, as long as  $\epsilon_u$  is non-Gaussian, we can identify the causal effect.
Assumption 3. We assume that there exists some  $s > 0$  such that the power series  $\sum_{k} \mathbb{E}[\epsilon_u^k] r^k / k!$  converges for any  $0 < r < s$ .
Corollary 1. Under Assumptions 1, 2 and 3, the causal effect  $\beta$  can be recovered uniquely as long as  $\epsilon_{u}$  is not Gaussian.
In [SGKZ20], it was shown that  $\beta$  can be recovered as long as all exogenous noises are non-Gaussian. Therefore, our result relaxes the restrictions on the model in [SGKZ20] by allowing  $\epsilon_{D},\epsilon_{Y},\epsilon_{Z}$  to be Gaussian.
Based on Theorem 1, we present Cross-Moment algorithm in Algorithm 1 that computes coefficient  $\beta$  from the distribution over the observed variables  $Z, D, Y$ . Algorithm 1 is comprised of two functions GetRatio and GetBeta. In the proof of Theorem 1, we show that  $|\alpha_d / \alpha_z| = (\mathrm{num} / \mathrm{den})^{1 / (n - 2)}$  for the smallest  $n$  such that  $\mathrm{den} \neq 0$  where num and den are defined in lines 6 and 7 of function GetRatio, respectively. Moreover,  $\mathbb{E}[DZ]$  has the same sign as  $\alpha_d / \alpha_z$  and we can recover the sign of the ratio  $\alpha_d / \alpha_z$  from  $\mathbb{E}[DZ]$ . Thus, in lines 8-10, for the smallest  $n$  such that  $\mathrm{den} \neq 0$ , we obtain the ratio  $\alpha_d / \alpha_z$  and then use it in function GetBeta to recover  $\beta$ .
For ease of presentation, we presented the Cross-Moment algorithm for the specific causal graph in Figure 2 with only one proxy. However, the Cross-Moment algorithm can be utilized in a more general setting with additional covariates and latent confounders such as in the graph depicted in Figure 3. This generalization is stated in the following theorem.
Theorem 2. Suppose that the linear SEM of (3) with the graph in Figure 2 is extended with observed covariates  $\mathbf{X}$ , non-Gaussian latent confounders  $\mathbf{U}$  and proxy variables  $\mathbf{Z}$  such that
- none of the observed covariate is a descendant of any latent variable;
- no latent confounder  $U \in \mathbf{U}$  of variables  $D$  and  $Y$  is an ancestor of any other latent confounder;
- for each latent confounder  $U \in \mathbf{U}$  there exists a unique proxy variable  $Z \in \mathbf{Z}$  which is not an ancestor of  $Y$ ;
- each latent confounder and its unique proxy variable satisfy the Assumptions 1, 2 and 3.
Then the causal effect  $\beta$  from  $D$  to  $Y$  can be computed uniquely from the observational distribution.
The proof of the theorem appears in Appendix A. The main idea of the proof is to reduce the problem to a set of sub-problems that can be solved with Cross-Moment algorithm. As mentioned earlier, an example of the causal graph satisfying the conditions of the theorem is depicted in Figure 3.
Algorithm 1 Cross-Moment algorithm
1: Function GetBeta(D,Z,Y)  
2: ratio := GetRatio(D,Z)  
3:  $\beta := (\mathbb{E}[DY] - \text{ratio} \cdot \mathbb{E}[YZ]) / (\mathbb{E}[D^2] - \text{ratio} \cdot \mathbb{E}[DZ])$   
4: Return  $\beta$   
1: Function GetRatio(D,Z)  
2: findRatio := False  
3:  $n := 2$   
4: while findRatio ≠ True do  
5:  $n := n + 1$   
6: num :=  $\mathbb{E}[D^{n-1}Z] - (n-1)\mathbb{E}[D^{n-2}]\mathbb{E}[DZ]$   
7: den :=  $\mathbb{E}[Z^{n-1}D] - (n-1)\mathbb{E}[Z^{n-2}]\mathbb{E}[DZ]$   
8: if den ≠ 0 then  
9: ratio := sign( $\mathbb{E}[DZ]$ ) |  $(\frac{\text{num}}{\text{den}})^{1/(n-2)}$   
10: findRatio := True  
11: end if  
12: end while  
13: Return: ratio
3.1 Impossibility Result
In the previous sections, we showed that the causal effect  $\beta$  can be identified if the distribution of latent confounder is non-Gaussian. Herein, we show that no algorithm can learn  $\beta$  uniquely if the observed variables are jointly Gaussian in any linear SCM defined by (3) satisfying the following assumption.
Assumption 4. In the linear SCM defined by (3),  $\alpha_{d} \neq 0, \gamma \neq 0$  and  $\mathrm{Var}(\epsilon_z) > 0$ .
Theorem 3. Suppose that the observed variables in linear SCM defined by (3) are jointly Gaussian. Under Assumptions 1, 2 and 4, the total causal effect  $\beta$  cannot be identified uniquely.
The proof of the Theorem 3 appears in the Appendix A. The key idea in the proof is to show that there exist two linear SCMs that encode the same observational distribution and are consistent with the causal graph in Figure 2 but the causal effect of  $D$  on  $Y$  has two different values in these two models.
Note that it is known that the causal structure is not identifiable in a linear SCM with Gaussian exogenous noises [PJS17]. Our impossibility result here is different from the non-identifiability result in linear Gaussian models. Specifically, in the linear Gaussian models, the goal is to recover all the coefficients in the linear SCM from the observational distribution. In our setting, we have additional knowledge of the exact DAG (restriction on the form of the linear SCM in (3)), and the goal is to identify a specific coefficient (i.e.,  $\beta$ ) from the linear SCM. Therefore, we have more constraints on the model and need to infer less information about it. Still, we show that the target coefficient  $\beta$  cannot be determined in the causal graph in Figure 2 if the observed variables are jointly Gaussian.
3.2 Bias in DiD Estimator
Suppose that the data is generated from a linear SCM consistent with the causal graph in Figure 2. We show that DiD estimator is biased except when the latent variable  $U$  has the exact same direct causal effect on  $Z$  that it has on  $Y$ , i.e.,  $\alpha_{Z} = \gamma$ . Our Cross-Moment algorithm identifies the true causal effect without any such restrictive assumption on the coefficients of the linear SCM.
DiD estimator is given by the following linear regression  $\left[\mathrm{L}^{+}11\right]$ :
$$
\hat {Y} = \hat {\beta} _ {1} T + \hat {\beta} _ {2} D + \hat {\beta} D T, \tag {6}
$$
where  $\hat{\beta}_1, \hat{\beta}_2$ , and  $\hat{\beta}$  are the regression coefficients and  $T$  is a binary variable that equals zero for the pre-treatment phase and equals one otherwise. In the pre-treatment phase,  $Z$  (i.e., the outcome before the treatment) is predicted as  $\hat{\beta}_2D$  and in the post-treatment phase,  $Y$  (the outcome after giving treatment to the treatment group) is predicted accordingly as  $\hat{\beta}_1 + (\hat{\beta} + \hat{\beta}_2)D$ . In order to obtain
the regression coefficients, the expectation of squared residuals over the population is minimized as follows (see Appendix C for the derivations of the following minimization problem and subsequent equations in this section):
$$
\min _ {\hat {\beta} _ {1}, \hat {\beta} _ {2}, \hat {\beta}} \mathbb {E} [ (Z - \hat {\beta} _ {2} D) ^ {2} ] + \mathbb {E} [ (Y - \hat {\beta} _ {1} - (\hat {\beta} + \hat {\beta} _ {2}) D) ^ {2} ].
$$
This results in the following regression coefficients:
$$
\hat {\beta} _ {1} = 0, \quad \hat {\beta} _ {2} = \frac {\mathbb {E} [ Z D ]}{\mathbb {E} [ D ^ {2} ]}, \quad \hat {\beta} = \frac {\mathbb {E} [ Y D ] - \mathbb {E} [ Z D ]}{\mathbb {E} [ D ^ {2} ]}.
$$