Why can we factor out $X$ in $E(E(XY∣X))$?

60 Views Asked by At

Using the law of total expectation, $E(XY)=E(E(XY∣X))=E(XE(Y∣X))$

I understand the first equality is part of the definition, but why are we able to treat $X$ as a constant in the second equality and factor it out?

2

There are 2 best solutions below

4
On BEST ANSWER

Because $X$ is constant with respect to $X$.

The idea of $\mathbb{E}(Y|X)$ is the probability once $X$ is known, so the result is a function of $X$. Just like $\mathbb{E}(aY|X) = a\mathbb{E}(Y|X)$ when $a$ is constant wrt $X$, so too $\mathbb{E}(XY|X) = X\mathbb{E}(Y|X)$ since once $X$ is known, it is constant wrt itself.

1
On

Factoring out $X$ corresponds to the following manipulation in the case where $(X,Y)$ have a joint density:

$$ \begin{split} E(XY) &= \iint xy f(x,y)dy dx \\ &= \int_x \left(\int_y xy f(y\mid x)f(x)dy\right)dx \\ &= \int_x x\left(\int_y y f(y\mid x)dy\right)f(x)dx \end{split} $$