# Does the property $\min_{c \in \mathbb{R}} E[ (X-c)^2] =E[ (X-E[X])^2]$ generalize to the covariance of $(X,Y)$

It is well known that \begin{align} \min_{c \in \mathbb{R}} E[ (X-c)^2] =E[ (X-E[X])^2]= V(X) \end{align}

My question does this property in some nontrivial way (I don't know which way) generalize to the covariance. Where the covariance for a pair $$(X,Y)$$ is defined as \begin{align} Cov(X,Y)=E[(X-E[X]) (Y-E[Y]) ]. \end{align}

• so you mean \begin{align} \min_{(c_x,c_y) \in \mathbb{R}^2} E[(X-c_x) (Y-c_y) ] \end{align} ? Commented Aug 2, 2019 at 14:21
• @AhmadBazzi No. Obviously, this will lead to - infinitiy.
– Boby
Commented Aug 2, 2019 at 16:05
• @Boby You could have mentioned in your question that you know that this is not the way to go...
– saz
Commented Aug 2, 2019 at 16:49
• @saz Sorry, I should have.
– Boby
Commented Aug 2, 2019 at 19:33
• @Boby Nothing prevents you from still editing the question accordingly. Commented Aug 5, 2019 at 14:24

## 2 Answers

$$E[(X-a)^2] = \sigma_X^2 + (\mu_X-a)^2$$ where $$\mu_X:=E[X]$$ and $$\sigma_X:=\sqrt{E[(X-\mu_X)^2]}$$. So, $$a=\mu_X$$ is minimizes $$f(a) = E[(X-a)^2].$$

The "generalization" of this equation is

$$E[(X-a)(Y-b)] = Cov(X,Y) + (\mu_X-a)(\mu_Y-b).$$

So, $$(a,b)=(\mu_X, \mu_Y)$$ is the saddle-point of the hyperbolic-paraboloid $$z=g(a,b)=E[(X-a)(Y-b)]$$.

It might be tempting to think that $$\text{cov}(X,Y) = \min_{a,b \in \mathbb{R}} \mathbb{E}((X-a)(Y-b)).$$ This is, however, not true. It's easy to see that "$$\geq$$" always holds (take $$a=\mathbb{E}(X)$$ and $$b=\mathbb{E}(Y)$$) but "$$\leq$$" is, in general, wrong.

Consider for instance two independent random variables $$X$$ and $$Y$$. Then

$$\text{cov}(X,Y)= \mathbb{E}(X-\mathbb{E}(X)) \mathbb{E}(Y-\mathbb{E}Y)=0.$$

However,

$$\min_{a,b \in \mathbb{R}} \mathbb{E}((X-a)(Y-b)) = \min_{a,b} (\mathbb{E}(X)-a) (\mathbb{E}(Y)-b) =- \infty$$

(choose $$a=\mathbb{E}(X)+n^2$$ and $$b=\mathbb{E}(Y)-1/n$$).

This being said, I'm not sure whether there is some other way to generalize the variation principle to the covariance.

• @Boby, obviously yes, this is what this answer addresses :) Commented Aug 2, 2019 at 16:11