Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

$(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*}$$

share|improve this answer
    
Thanks, that makes sense overall. I also expanded out the factors, but I'm wondering why we can say that $E(E(Y)X) = EYEX$? –  David Faux Nov 7 '12 at 23:46
    
@David: Because $E(Y)$ is a constant, the one that I called $\beta$, and $E$ is linear: $E(\beta X)=\beta E(X)$, just as with any linear function. –  Brian M. Scott Nov 7 '12 at 23:48
    
Ah thank you! That makes sense! –  David Faux Nov 7 '12 at 23:50
    
@David: You’re welcome. –  Brian M. Scott Nov 7 '12 at 23:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.