21
$\begingroup$

I am working on a problem from probability theory and am a little bit stuck.

I know that the formula for $\operatorname{Var}(X + Y)$ is $$\operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X,Y)$$

Does this mean that for $\operatorname{Var}(X - Y)$ it is just:

$$\operatorname{Var}(X) - \operatorname{Var}(Y) - 2\operatorname{Cov}(X,Y)$$?

$\endgroup$
5
  • 7
    $\begingroup$ Nope, it is $\mathrm{Var}(X) + \mathrm{Var}(-Y) + 2 \mathrm{Cov}(X,-Y) = \mathrm{Var}(X) + \mathrm{Var}(Y) - 2 \mathrm{Cov}(X,Y)$. $\endgroup$
    – Hugo
    Oct 8, 2018 at 23:37
  • $\begingroup$ Why do we only flip the sign of the last one? $\endgroup$
    – Ethan
    Oct 8, 2018 at 23:39
  • 5
    $\begingroup$ Because $\mathrm{Cov}(X,-Y) = E[-XY]-E[X]E[-Y] = -E[XY]+E[X]E[Y] = - \mathrm{Cov}(X,Y)$. $\endgroup$
    – Hugo
    Oct 8, 2018 at 23:40
  • $\begingroup$ Ok, thank you for the clarification. $\endgroup$
    – Ethan
    Oct 8, 2018 at 23:42
  • $\begingroup$ @Ethan While on the other hand $Var(-Y)=Var(Y)$. $\endgroup$ Apr 27, 2022 at 15:54

2 Answers 2

26
$\begingroup$

It will be $\text{Var}(X) + \text{Var}(Y) - 2\text{Cov}(X,Y)$, because $\text{Var}(-Y) = \text{Var}(Y)$.

$\endgroup$
2
  • 1
    $\begingroup$ Why do we only flip the sign of the last one? $\endgroup$
    – Ethan
    Oct 8, 2018 at 23:37
  • 2
    $\begingroup$ @Ethan the covariance is linear in both of the variables, i.e. you can pull a scalar out of either the first or the second variable. This follows from the linearity of expectations. Since $\text{Var}(Y) = \text{Cov}(Y, Y)$, a negative sign on the variance "pulls out twice" which cancels. (Or if you prefer a more probabilistic proof, the variance indicates the [square of the] expected distance from the mean, which doesn't change if we just put a minus sign in front of all the data.) $\endgroup$
    – hunter
    Oct 8, 2018 at 23:52
18
$\begingroup$

$Var (X) = E[X^2] - E[X]^2$

The definition of variance.

$Var (X-Y) = $$E[(X-Y)^2] - E[X-Y]^2\\ E[X^2 - 2XY + Y^2] - E[X-Y]^2$

Linearity of expectation:

$E[X^2 - 2XY + Y^2] = E[X^2] + E[Y^2] - 2E[XY]$ and $E[X-Y] = E[X] - E[Y]$

$Var (X-Y) = $$E[X^2] - 2E[XY] + E[Y^2] - (E[X]^2 - 2E[X]E[Y] + E[Y]^2)\\ E[X^2] - E[X]^2 + E[Y^2] - E[Y]^2 - 2(E[XY] - E[X]E[Y])$

Now note that: \begin{align} Cov(x,y)&=E[(x-E[x])](y-E[y])]\\ &=E[xy]-E[x E[y]]-E[y[E[x]]+ E[x]E[y]\\ &=E[xy]-E[x]E[y]-E[y]E[x]+E[x]E[y]\\ &=E[xy]-E[x]E[y] \end{align}

Which immediately gives the result desired in terms of the covariance.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .