I read from a text book that covariance is $E((X - EX)(Y - EY))$. The book then states that this expression is equivalent to $E(XY) - E(X)E(Y)$. Where did the latter expression come from?
Why can covariance be written both of these ways?
1
$\begingroup$
probability
1 Answers
4
$(X-EX)(Y-EY)=XY-(EY)X-(EX)Y+(EX)(EY)$, and expectation is linear, so
$\begin{align*} E\big((X-EX)(Y-EY)\big)&=E(XY)-(EY)EX-(EX)EY+(EX)(EY)\\ &=E(XY)-(EX)(EY)\;. \end{align*}$
If you get lost in all the expectations, let $\alpha=E(X)$ and $\beta=E(Y)$; then
$(X-\alpha)(Y-\beta)=XY-\beta X-\alpha Y+\alpha\beta\;,$ and
$\begin{align*} E\big((X-\alpha)(Y-\beta)\big)&=E(XY)-\beta E(X)-\alpha E(Y)+\alpha\beta\\ &=E(XY)-\beta\alpha-\alpha\beta+\alpha\beta\\ &=E(XY)-\alpha\beta\\ &=E(XY)-E(X)E(Y)\;. \end{align*}$
-
0@David: You’re welcome. – 2012-11-07