# A proof of the law of iterated expectations for continuous variables

Angrist and Pischke(2009) Mostly Harmless Econometricsの[31-2]。

A proof of the law of iterated expectations for continuously distributed ${\small(X_{i},Y_{i}) }$ with joint density ${\small f_{xy}(u,t)}$, where ${\small f_{y}(t\mid X_{i}=u)}$ is the conditional distribution of ${\small Y_{i}}$ given ${\small X_{i}=u}$ and ${\small g_{y}(t)}$ and ${\small g_{x}(u)}$ are the marginal densities:

$E\{E\left[Y_{i}\mid X_{i}\right]\}$
$=\int E\left[Y_{i}\mid X_{i}=u\right]g_{x}(u)du$
$=\int \left[\int tf_{y}(t\mid X_{i}=u)dt\right]g_{x}(u)du$
$=\int \int tf_{y}(t\mid X_{i}=u)g_{x}(u)dudt$
$=\int t\left[\int f_{y}(t\mid X_{i}=u)g_{x}(u)du\right]dt$
$=\int t\left[\int f_{xy}(u,t)du\right]dt$
$=\int tg_{y}(t)dt=E\left[Y_{i}\right].$

ゆっくり式を追っていけば大したことはないのであるが、この辺りを曖昧にしていると論文を読んでいてつまづく。