Covariance

Definition

The covariance between two rvs X,Y is:

Cov(X,Y)=E[(X−μX)(Y−μY)]={∑x∑y(x−μX)(y−μY)p(x,y)∫−∞∞∫−∞∞(x−μX)(y−μY)f(x,y)dxdy

based on whether X,Y are continuous or discrete.

For an example of its usage, see Ch 7 - 23, 25 for discrete examples and Ch 7 - 13, 17, 33 for continuous examples.

Properties of Covariance

Proposition

For any two random variables X,Y:

  1. Cov(X,Y)=Cov(Y,X)
  2. Cov(X,X)=Var(X)
  3. (Covariance Shortcut Formula): Cov(X,Y)=E[XY]−μXμY
  4. (Distributive Property of Covariance): For any rv Z and any constants a,b,c:
Cov(aX+bY+c,Z)=aCov(X,Z)+bCov(Y,Z)

Proof

  1. Obvious from the definition.
Cov(X,X)=E[(X−μX)2]=Var(X)
  1. Comes from the linearity of expectation:
Cov(X,Y)=E[(X−μX)(Y−μY)]=E[XY−μXY−μYX+μXμY]=E[XY]−μXE[Y]−μYE[X]+μXμY=E[XY]−μXμY−μYμX+μXμY=E[XY]−μXμY
  1. Using (3) we can then apply linearity of expectation again to get this result.

☐