# Conditional Expectations and Variances

$\textbf{Background:}$ When $\mathbb EX$ is hard to calculate, it is a common trick to use the following formula: $$\mathbb EX=\mathbb E[\mathbb E(X|Y)].$$ And similarly, $\mathbb VX$ can be calculated using the following formula: $$\mathbb VX=\mathbb E[\mathbb V(X|Y)]+\mathbb V[\mathbb E(X|Y)].$$

$\textbf{Question:}$ Recently, I saw similar formula for conditional expectation and variance as follows. $$\mathbb E(Y|X)=\mathbb E[\mathbb E(Y|X, Z)|X],$$ and $$\mathbb V(Y|X)=\mathbb E[\mathbb V(Y|X,Z)|X]+\mathbb V[\mathbb E(Y|X, Z)|X].$$ I do not know how to prove them. Could anyone provide some hint or reference, please? Thank you!

• can you tell me in what book or paper you saw this formula? – omidi Feb 7 '14 at 12:04
• In fact, it's used in one exercise in a lecture I attended. – LaTeXFan Feb 7 '14 at 21:07

## 1 Answer

The conditional version of the law of total variance works just the same.

Expectation follows trivially from the tower property, and for variance: \begin{align} \mathbb{V} [X | Y] &= \mathbb{E}[(X - E[X | Y])^2 | Y] \\ &= \mathbb{E}[X^2 | Y] - (\mathbb{E}[X | Y])^2 \\ &= \mathbb{E}[\mathbb{E}[X^2 | Y,Z] | Y] - (\mathbb{E}[X | Y,Z])^2 \\ &= \mathbb{E}[\mathbb{V}[X | Y,Z] + (\mathbb{E}[X | Y,Z])^2 | Y] - (\mathbb{E}[\mathbb{E}[X | Y,Z] | Y])^2 \\ &= \mathbb{E}[\mathbb{V}[X | Y,Z] | Y] + \mathbb{V}[\mathbb{E}[X | Y,Z] | Y] \\ \end{align}