I have studied fundamental property of conditional expectation:
$\mathbb{E}[r(X)\mathbb{E}(Y|X)] = \mathbb{E}(r(X)Y] \qquad \text{for every function} \qquad r:S \rightarrow R$
My question is what does mean function $r$. Why left side of equation equals to the right side and what is intution behind this function?
Thanks in advance
I'm a little confused about the domain/range $S\to R...$ I would think it would just be from the reals to the reals. But, anyway, by function, they mean... function. I don't know another way to put it. Just a function like $r(X)=X^2$ or any other example. The key is that the property holds for any function.
The quickest way to see that the left side equals the right is that $$ r(X)E(Y|X) = E(r(X)Y|X)$$ since you can always pull something conditioned on out of a conditional expectation (when it's conditioned on, it's effectively constant). So plugging this in, we have $$E(r(X)E(Y|X))=E(E(r(X)Y|X)) = E(r(X)Y) $$
where the second equality is the law of total expectation.