# Some Conditional Moments

• The expected value of $X$ given $Y$ is defined as

$E_{\left.X\right|Y}\left(\left.X\right|Y=y\right)=\begin{cases} \sum_{s\in\mathbb{R}}s.f_{X|Y}\left(s,y\right), & \text{if}\,\left(X,Y\right)'\,\text{is discrete }\\ \int_{-\infty}^{\infty}s.f_{X|Y}\left(s,y\right)ds & \text{if}\,\left(X,Y\right)'\,\text{is continuous} \end{cases}$

We often write $E_{\left.X\right|Y}\left(\left.X\right|Y\right)$ instead of $E_{\left.X\right|Y}\left(\left.X\right|Y=y\right)$, when we haven't yet settled for a value of $y$.

Perhaps a more popular notation, which means the same, is

$E\left(\left.X\right|Y\right).$

Notice that $E\left(\left.X\right|Y\right)$ is a function of $Y.$ The $X$ has been integrated out!

• The conditional variance of $X$ given $Y$ is

$Var\left(\left.X\right|Y\right)=E\left[\left.\left(X-E\left(\left.X\right|Y\right)\right)^{2}\right|Y\right]=E\left(\left.X^{2}\right|Y\right)-E\left(\left.X\right|Y\right)^{2}$.