While reading Jennifer Hill (2011), p. 220, in the context of conditional average treatment effect, the author is able to calculate $E[Y|Z]$ from $f(Y|X)$ and $f(X|Z)$.

My attempt to replicate the author's calculation is as follows: $$ \begin{align} E[Y|Z] &= \int y f(y|z) dy \\ &= \int y \int f(y, x| z) dx dy \\ &= \int y \int f(y|x, z) f(x|z) dx dy\\ &= \int y \int f(y|x) f(x|z) dx dy \end{align} $$

where the last equation is true because $y$ is independent from $z$ once conditional on $x$.

However, this integration is rather nightmarish even with the Gaussian distributions, i.e. $f(x|z=1) \sim N(40, 10^2)$ and $f(y|x) = N(72 + 3 \sqrt x, 1)$. I tried Mathematica, which couldn't give the numerical result either.

Is this the correct approach to calculate $E[Y|Z]$, or there is a more sensible approach?

  • $\begingroup$ So you occasionally get complex means for $y$? $\endgroup$ – Taylor Jun 19 '16 at 13:20

Continuing from your last statement, we have $$ \int_y y \int_x f(y|x) f(x|z) dx dy $$ $$ =\int_x\left[\int_y y f(y|x) dy \right] f(x|z) dx $$ $$ =\int_x E[Y|X] f(x|z) dx $$ and that's it.

But, if by any chance everything is Gaussian, then $$E[Y|X]=E[Y]+\alpha (X-E[X])$$ where $\alpha=\frac{cov(X,Y)}{var(X)}$. So we have $$ = \int_x \left[ \mu_Y + \alpha x -\alpha \mu_X \right] f(x|z) dx $$ $$ = \mu_Y -\alpha \mu_X + \alpha \int_x x f(x|z) dx $$ $$ = \mu_Y -\alpha \mu_X + \alpha E[X|Z]$$ which can be expressed easily using the same method, if it is Gaussian.

| cite | improve this answer | |
  • $\begingroup$ How does $X$ and $Y$ being normal lead to that way of calculating $E[Y|X]$? I think that's only true when $X, Y$ are bivariate normal. $\endgroup$ – Heisenberg Jun 19 '16 at 15:54
  • $\begingroup$ You're right, by 'everything' I meant they're jointly normal. $\endgroup$ – yoki Jun 19 '16 at 16:28
  • $\begingroup$ Thanks a lot! Using $\int_x E[Y|X] f(x|z) dx$ Mathematica did manage to give the definite integral this time. Is it because we've simplified the integral? $\endgroup$ – Heisenberg Jun 19 '16 at 16:42
  • $\begingroup$ Well, I don't know how Mathematica works, but consider that switching the integral order does require some assumptions, so the algorithm might not have wanted to do that on its own. $\endgroup$ – yoki Jun 19 '16 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.