Law of total expectation for covariance

38 Views Asked by At

Let X and Y be integrable random variables.

We know that $$\mathop{\mathbb{E}}[h(X,Y)] = \mathop{\mathbb{E}}[\mathop{\mathbb{E}}[h(X,Y)|X]]$$ for any measurable function $h$, positive or integrable on $\mathop{\mathbb{R}}^2$.

So I decided to apply it for the definition of the covariance:

$$cov(X,Y):=\mathop{\mathbb{E}}[(X-\mathop{\mathbb{E}}[X])(Y-\mathop{\mathbb{E}}[Y])] = \mathop{\mathbb{E}}[\mathop{\mathbb{E}}[(X-\mathop{\mathbb{E}}[X])(Y-\mathop{\mathbb{E}}[Y])|X]] = 0$$

Can you explain at what point I made a mistake? Why can't the law of total expectation be applied in this case?

1

There are 1 best solutions below

2
On BEST ANSWER

The problem is that in the formula for covariance, $\mathbb{E}(X)$ is a constant value and therefore does not behave the way you think when you condition on $X$. Instead, you should think about the formula as being $\mathbb{E}[(X - \mu)(Y - \nu)]$ where $\mu$ and $\nu$ are parameters, and we choose to set $\mu = \mathbb{E}X$ and $\nu = \mathbb{E}Y$ when we do the calculation.