Implications of law of iterated expectation

157 Views Asked by At

Is the rule below correct? And if yes, does it follow from the law of iterated expectations?

Let $X,Y$ be real valued random variables, and $g,f$ some functions.

Then $$ E_{X,Y}[f(Y) g(X)]= E_X\Big[E_{Y|X}\big(f(Y) g(X)| X\big)\Big]=E_X\Big[E_{Y|X}\big(f(Y)|X\big) g(X)\Big] $$