 distribution can be considered as learning a representation. Based on this idea, Johansson et al. \citep{johansson2016learning} proposed a domain adaptation framework to learn a counterfactual distribution from the factual distribution. The estimated counterfactual distribution is then used to evaluate causal effect conditional on specific covariates, also known as the conditional average treatment effect (CATE). 

For estimating ACE, there is a rich literature in statistics that proposes estimators based on the backdoor formula, including stratification, matching and propensity score-based methods like IPW \citep{shah2005propensity}. In the absence of latent confounders, error in estimating causal effect has been well studied for estimators like IPW \cite{rosenbaum1983central}. For instance, estimators like Horvitz Thompson and Hajeck estimators \cite{henderson2013estimating} provide us with a unbiased variance estimate for IPW. 
However, all of the above methods for CATE and ACE do not focus on producing general error bounds and  assume that $U$ is ignorable.


\section{Causal Inference as Representation Learning}
\label{sec:causal-rep}
As discussed above, the problem of estimating ACE can be considered as learning the target distribution $P$ given data from $Q$ and then estimating the observed conditional expectation $E_P[Y|T]$. $Q$ can be considered as the factual distribution, and $P$ the counterfactual distribution corresponding to the question---\textit{what would have happened if we intervened on $T$ without changing anything else?} Our goal is to learn an intermediate distribution $R$ that approximates $P$. This setup is similar to domain adaptation, except that  instead of learning a function $f$ as in Mansour et al.~\cite{mansour2009domain},  we learn a new representation of the data and estimate the same APE function.

\subsection{Defining the weighting method}\label{problemsetup}
Given this formulation, a key question is how to generate a representation such that its APE will be close to ACE. We first define  a consistent estimator for $APE$ under any distribution $R$, $h(x_R)$. Then, the estimator ($h$), and the  APE under infinite samples ($h^\infty$) can be written as:
\begin{align}
  h(x_R)=\hat{E}_R[Y\vert T=1]-\hat{E}_R[Y\vert T=0];  &&   h^\infty(x_R)=E_R[Y\vert T=1]-E_R[Y\vert T=0]  
\end{align}\label{eq:hdef}
By the above definition of $h$, $ACE=h^\infty(x_P)$. Next, we define a class of distributions given by weighting of $Q$. Following Johansson et al.~\citep{johansson2018learning}, we generate a weighted representation $R$ from our source distribution $Q$ such that $h(x_R)$ is an estimator for ACE. 
\begin{defn}\label{def:beta}
    Let $Q(W,T,Y)$ be the source distribution. We define a weighting function $\beta(W,T)$ to generate a representation $R$ such that,
    $$\beta(W,T) = \frac{R(W\vert T)}{Q(W\vert T)}= \frac{R(T\vert W)}{Q(T\vert W)}$$ and that $R$ is a valid probability distribution, $\forall W,T\hspace{1ex}R(W,T)\geq 0$, $\sum_W \sum _T R(W,T)=1$. 
\end{defn}









 



 

\subsection{IPW and stratification as weighting methods}
We now show that the IPW estimator and back-door methods such as stratification can be considered as a weighted $\beta$ estimator.
\begin{theorem}
\label{thm:IPW}
Consider the causal graphical model in Figure~\ref{fig:source-simple} where the observed common causes $W$ are the only confounders. The IPW estimator can be written as a representation $R$ where $\beta(W,T=t)=\dfrac{R(W|T=t)}{Q(W\vert T=t)}=\dfrac{Q(W)}{Q(W\vert T=t)}$.
\end{theorem}
\begin{proof}
    Here we consider only the $T=1$ part of IPW estimator from the RHS of Equation~\ref{eq:IPW}. The proof is symmetric for $T=0$.
\begin{align}
    IPW_{T=1}&=\dfrac{1}{n}\bigg(\sum\limits_{i=1}^n\dfrac{T_i*Y_i}{Q(T_i\vert W_i)}\bigg)
    =E_Q\bigg[\dfrac{1_{T=1}Y}{Q(T=1\vert W)}\bigg]
    =\sum_W \dfrac{E_Q[Y \vert T=1,W]Q(T=1\vert W)Q(W)}{Q(T=1\vert W)}\\
    &=\sum_W\sum_Y\dfrac{YQ(Y\vert T=1,W)Q(T=1\vert W)Q(W)}{Q(T=1\vert W)}
    =\sum_W\sum_Y YQ(Y\vert T=1,W)Q(W) \label{eqn:backdoor-ipw}
\end{align}
where $1_{T=1}$ is an indicator function that is 1 whenever T is 1 and 0 otherwise. The second equality above utilized that $T$ is binary. 


Similarly, we can write the the first part $(T=1)$  of the $APE$ under $R$ as:
\begin{align*}
    APE_{T=1}^R=\sum_Y YR(Y\vert T=1)
    =\sum_W\sum_Y YR(Y\vert T=1,W)R(W\vert T=1)
    =\sum_W\sum_Y YQ(Y\vert T=1,W)R(W\vert T=1)
\end{align*}

where the last equality is since $Q(Y\vert T=1,W)=R(Y \vert T=1,W)$ (\emph{ignorability} assumption from Equation~\ref{eqn:strat}). Further, using $\beta(W,T) Q(W\vert T=1)=R(W\vert T=1)$ (by definition),
\begin{align*}
    APE_{T=1}^R=
    =\sum_W\sum_Y YQ(Y\vert T=1,W)\beta(W,T=1)Q(W\vert T=1)
\end{align*}
Comparing the two terms for $IPW_{T=1}$ and $APE_{T=1}^R$, if     $\beta(W,T=1)=\dfrac{Q(W)}{Q(W\vert T=1)}$, then $IPW_{T=1}=APE_{T=1}^R$.
\end{proof}

The  above proof also shows the equivalence of IPW and backdoor-based stratification~\cite{hernanbook}. Under the conditions of Theorem~\ref{thm:IPW}, and using $\sum_W E_Q(Y\vert W, T=1)Q(W)=\sum_W\sum_Y YQ(Y\vert T=1,W)Q(W)$, we have: 
\begin{corollary}
    The stratification estimator from Equation~\ref{eqn:strat}, $\sum_W E_Q(Y\vert W, T=1)Q(W)$ 
    is equivalent to Equation~\ref{eqn:backdoor-ipw} and thus also a weighting method with $\beta(W,T=1)=\dfrac{Q(W)}{Q(W\vert T=1)}$.
\end{corollary}


This project is funded by a James R. Mallory Grant (2019-2020) from the Canadian Study of Parliament Group. In the study I will analyse recent efforts to address sexual harassment in the Canadian Senate from a gendered perspective. I will also evaluate how and in what ways women have participated in policy discussions that will better protect people from violence and sexual harassment within the Senate. The goal of the project is to further develop best practices for legislative bodies seeking to (re)design rules that prohibit violence against women in politics, broadly defined (ie. administrative and political staffers, Senators, members of the press, visitors, interns, etc..).
This project is in partnership with Dr. Cheryl N. Collier (University of Windsor), Dr. Grace Lore, and Equal Voice and is funded by a Partnership Engage Grant from the Social Sciences and Humanities Research Council of Canada (2017-2018). Andrea Spender, a PhD student in Policy Studies at Ryerson, is also a team member and R.A. on this project. Our goal in this study is to understand how and why sexual harassment happens in Canadian politics in order to stop it. To do