Expectation of Multidimensional Function of Random Variables w.r.t. Marginal Distribution

116 Views Asked by At

Suppose two random variables $X$ and $Y$ are given. $\mathbb{E}(XY)$ will be the uncentered covariance of them. But this expectation is with respect to the joint distribution $P(X,Y)$. My question is what is the expectation if we take the expectation w.r.t say $Y$, i.e. something like $$ \mathbb{E}_Y(XY)= \int XY dP(Y) $$ I first thought $X$ will come out of the integral so that we would get: $$ \mathbb{E}_Y(XY)= X\int Y dP(Y) $$ but I realized that doesn't make sense since if say $Y=X$ this would be a wrong equation and we actually end up getting $\int Y^2 dP(y)$ which is a number. So now my question is whether $$\int f(X,Y)dP(y)$$ is well-defined or not, and if not, why it is in the special case of $X=Y$?

EDITED QUESTION(Thanks to @kimchilover)

1

There are 1 best solutions below

3
On

This is so mixed up. The conditional expectation of $X$ given $Y$ is a function of $Y$, call it $g(Y)$ (a.k.a. $g(Y)=E(X|Y)$) such that $E( Xf(Y)) = E (g(Y)f(Y))$ for every function $f$. (That is, such that all the law of iterated expectations holds every-which way.) (See this for more info.)

If you know $E(XY)$ you can use this formula to write $E(XY)=E( E(X|Y)Y)$ with $g(Y)=E(X|Y)$ and $f(Y)=Y$.

That's it. But of course there are many notational variations possible. One is: $$ E XY = \int E(X|Y=y)yP(dy).$$