## 2 Background and Relevant Research  
### Causal Effects  
The main objective of the proposed methodology is to provide accurate estimations of causal effects from RWD. In detail, we are interested in calculating the effect of an intervention or a treatment on the outcome of interest. For the purpose of our study, we consider the case of a binary treatment variable.  
Formally, let \(\mathbf{x}_{i}\in\mathcal{X}\) be the covariates in the covariate space, \(t_{i}\in\{0,1\}\) the (binary) treatment assignment and \(y(\mathbf{x}_{i},t_{i})\) the outcome of interest for subject or unit \(i\), with \(i=1,2,\ldots,n\). Each unit can be assigned into a control or treatment group, denoted as \(t_{i}=0\) and \(t_{i}=1\), respectively. Under the Neyman-Rubin potential outcome framework [16] and depending on the unit's assigned group, we can either measure the outcome \(y(\mathbf{x}_{i},0)\) or the outcome \(y(\mathbf{x}_{i},1)\), which stands for the factual outcome for \(i\). The fundamental problem of causal inference is that we cannot observe and measure what the outcome would have been if unit \(i\) had been assigned to the other group. This outcome is known as the counterfactual outcome, or simply counterfactual, and needs to be estimated to calculate the effect of the treatment on an individual level. Specifically, the individual treatment effect (ITE) for unit \(i\) is defined as the difference of the outcomes in the treatment and control groups,  
\[\text{ITE}=y(\mathbf{x}_{i},1)-y(\mathbf{x}_{i},0) \tag{1}\]  
The challenge in this case lies in providing an accurate estimate, \(\hat{y}(\mathbf{x}_{i},t_{i})\), of the unobserved counterfactual outcome. For measuring the accuracy of the estimated ITE, we use the Precision in Estimation of Heterogeneous Effect (PEHE), which is defined as follows:  
\[\text{PEHE}=\frac{1}{n}\sum_{i=1}^{n}[(y(\mathbf{x}_{i},1)-y(\mathbf{x}_{i},0 ))-(\hat{y}(\mathbf{x}_{i},1)-\hat{y}(\mathbf{x}_{i},0))]^{2} \tag{2}\]  
Given that each sample in the dataset is represented by its covariates, this problem can be approximated via the conditional average treatment effect (CATE), that is  
\[\text{CATE}(\mathbf{x})=\mathbb{E}[y(X,1)-y(X,0)\mid X=\mathbf{x}] \tag{3}\]  
where \(X\) is a random variable corresponding to the vector of covariates for each sample. If estimators \(\hat{y}(\mathbf{x},0)\) and \(\hat{y}(\mathbf{x},1)\) are available, then the CATE can be estimated as  
\[\text{CATE}(\mathbf{x})=\frac{1}{n}\sum_{i=1}^{n}(\hat{y}(\mathbf{x}_{i},1)- \hat{y}(\mathbf{x}_{i},0)) \tag{4}\]  
Additionally, when interested in measuring the causal effects on a population level, the average treatment effect (ATE) is defined by  
\[\text{ATE}=\mathbb{E}[y(X,1)-y(X,0)] \tag{5}\]which can be estimated as  
\[\text{ATE}=\frac{1}{n_{1}}\sum_{i=1}^{n_{1}}y(\mathbf{x}_{i},1)-\frac{1}{n_{0}} \sum_{i=1}^{n_{0}}y(\mathbf{x}_{i},0) \tag{6}\]  
where \(n_{1}\) and \(n_{0}\) are the number of samples in the treatment and the control group, respectively. After the estimation of the missing counterfactual outcomes, the average treatment effect is estimated as  
\[\text{ATE}=\frac{1}{n}\sum_{i=1}^{n}[\hat{y}(\mathbf{x}_{i},1)-\hat{y}(\mathbf{ x}_{i},0)] \tag{7}\]  
To quantify the effectiveness of causal effect estimation at the population level (assuming both outcomes are available in the evaluation data), we use the absolute error on the ATE, defined by  
\[|e_{\text{ATE}}|=\left|\frac{1}{n}\sum_{i=1}^{n}[y(\mathbf{x}_{i},1)-y(\mathbf{ x}_{i},0)]-\frac{1}{n}\sum_{i=1}^{n}[\hat{y}(\mathbf{x}_{i},1)-\hat{y}( \mathbf{x}_{i},0)]\right| \tag{8}\]