# Expectation and Conditional Independence

This question is an aside from another question here on CV.

We know that the expectation of the product of two independent random variables is the product of expectations, i.e., $$\mathbb{E}[XY]=\mathbb{E}[X]\mathbb{E}[Y]$$

However, is there a conditionally equivalent version of this statement? For example, could I say if $X$ and $Y$ are dependent random variables then by conditional independence we have

$$\mathbb{E}[XY]=\mathbb{E}[X]\mathbb{E}[Y|X]$$

I know that we can factor joint distributions that way using conditional properties, for example, $$f(x,y)=f(x)f(y|x)$$ and so is there an equivalence for expectations?

## 2 Answers

Your second equality is certainly untrue unless $$X$$ and $$Y$$ are independent.

An easy way to view it is that the left side of the equality is a number while the right side of the equality is in general a random variable. Keep in mind that the conditional expectations are random variables.

An analog to the formula $$f(x, y) = f(x)f(y|x)$$ you mentioned is actually the law of iterative expectations: \begin{align} E[XY] = E[E[XY|X]] = E[XE[Y|X]]. \end{align}

A consequence of conditional independence is

$$E \left[ X Y | Z \right] = E \left[X|Z \right] E\left[Y|Z \right]$$

and the idea is often encountered in hierarchical models. Is that perhaps what you had in mind?

• Thanks for that but no. I guess I want to know if my second equality is true.
– user95564
Dec 4, 2015 at 0:53
• @RustyStatistician You can get $E\left[XY \right] = E \left[ X E\left( Y | X \right) \right]$ simply by applying the Law of Iterated Expectations but I have not seen anywhere what you have written. Dec 4, 2015 at 0:55