# What is $E[E[X|Y]|Y]$?

What is $E[E[X|Y]|Y]$. Constant or random variable?

We know that $E[X|Y]$ is a random variable that dou should get epends on Y. Then the last given Y in $E[E[X|Y]|Y]$ should tell you what that Y is, so $E[E[X|Y]|Y]$ is a constant right?

It like saying $E[X|X]$ that should be a constant.

• Where did you find the formula? Are you sure it is not E(E(X|Y))? – Tim Sep 17 '17 at 6:53
• Its not a formula, It just appeared during one of the steps im doing as part of a proof. Can you tell me if the second |Y is redundant or not? – mitwit Sep 17 '17 at 7:04
• I feel like you can just not write it for the fact that you're given Y twitce which is the same as giving it once. – mitwit Sep 17 '17 at 7:05
• $E[E[X|Y] | Y]$ is redundant (exactly equal to $E[X|Y]$), but $E[E[X | Y]]$ is not, because you are taking the average value of $E[X|Y]$ over all $Y$. It could be written more clearly as $E_Y[E[X | Y]]$. I think most readers will assume you misquoted the formula; if that's actually what appeared in the proof, then either (a) they may be applying it in some tricky way (i.e. the proof applies $E[...|Y]$ to both sides of an equation or something like that) or (b) there may be a typo. – Cliff AB Sep 17 '17 at 18:48

$\mathrm{E}(X\,|\,X)$ is not a constant, it is equal to $X$. Similarly, $E(E(X\,|\,Y)\,|\,Y)$ is equal to $E(X\,|\,Y)$. How you can explain this is depending on how your definition of conditional expectation is. Informally, $E(X\,|\,Y)$ is a random variable, defined for all outcomes of $Y$, that is equal to the expectation of $X$ given this outcome of $Y$ ($E(X|Y=a)$). Conditioning on $Y$ again is trivial, since that would be a function equal to $E(E(X\,|\,Y)|Y = a)$ for every outcome $a$ of $Y$, so that is equal to $E(X|Y=a)$ for all outcomes, equivalent to conditioning one time.

EDIT The important parts from Wikipedia I list below. This is not a real explanation, but if you are into the theory already, you may know where this fits in.

1. Definition

Let $\displaystyle g:U\to \mathbb {R} ^{n}$ be a $\Sigma$ -measurable function such that, for every $\displaystyle \Sigma$-measurable function $\displaystyle f:U\to \mathbb {R} ^{n}$,

$$\displaystyle \int g(Y)f(Y)\,dP=\int Xf(Y)\,dP.$$

Then the random variable$\displaystyle g(Y)$, denoted as $\displaystyle \operatorname {E} (X\mid Y)$, is a conditional expectation of X given $\displaystyle Y$ .

1. Why $\mathrm{E}(X|X) = X$?

It's this property:

(Stability) If $\displaystyle X$ is $\displaystyle {\mathcal {H}}$-measurable, then $\displaystyle E(X\mid {\mathcal {H}})=X$.

• You are right about expected value, but conditional expectation is a random variable. There is a difference between those. My explanation is not that clear, so I'll give you that as well. – Gijs Sep 17 '17 at 10:45
• There is a difference between $E(Y|Z)$ and $E(Y|Z=boy)$. The latter is a constant, the former is a random variable. – Gijs Sep 17 '17 at 10:58