Transcript E[(X+Y)Z]

4.3 Covariance ﹠Correlation
1.Covariance
Definition 4.3
suppose that ( X , Y )are dependent tw o  dim ensio nal random vector,
if E [( X  E X )(Y  E Y )]exsits, it is called the covariance of X and Y .
That is to say
C ov ( X , Y )  E [( X  E ( X ))(Y  E (Y ))]
P articu larly , w e h ave C o v ( X , X )  D ( X ).
If X and Y are discrete random variables,
C ov( X , Y ) 
  [x
i
i
 E ( X )][ y j  E (Y )] p ij ,
j
If X and Y are continuous random variables,
C ov ( X , Y ) 

 



[ x  E ( X )][ y  E (Y )] f ( x , y ) dxdy .
C ov( X , Y )  E ( X Y )  E ( X ) E (Y );
Proof
C ov( X , Y )  E {[ X  E ( X )][Y  E (Y )]}
 E [ XY  YE ( X )  XE (Y )  E ( X ) E (Y )]
 E ( XY )  2 E ( X ) E (Y )  E ( X ) E (Y )
 E ( XY )  E ( X ) E (Y ).
Example Suppose that (X, Y) is uniformly
distributed on D={(X, Y):x2+y21} .Prove that X and
Y are uncorrelated but not independent.
Proof
1

f ( x, y)  
 0
x  y 1
2
1 x
2
1
 xdx 
1
1
E ( XY ) 

1
1
others
1
E(X ) 
2

1 x
1 x
2
xy

dx

1 x
2
2


dy  0
dy  0
1
1
1
 Cov ( X , Y )  E ( XY )  E ( X ) E (Y )  0
Thus X and Y are uncorrelated. Since


fX (x)  





fY ( y )  



1 x
2
1

1 x
2

dy 
2

1 x
2
0
1 y
1 x 1
others
2
1

1 y
2

dy 
2

1 y
0
2
1 y 1
others
f ( x , y )  f X ( x ) fY ( y )
Thus, X is not independent of Y.
2. Properties of covariance:P82
(1) Cov(X, Y)=Cov(Y, X);
(2) Cov(aX, bY)=abCov(X, Y), where a, b are constants
Proof
Cov(aX, bY)=E(aXbY)-E(aX)E(bY)
=abE(XY)-aE(X)bE(Y)
=ab[E(XY)-E(X)E(Y)]
=abCov(X,Y)
(3) Cov(X+Y,Z)=Cov(X, Z)+Cov(Y, Z);
Proof Cov(X+Y,Z)= E[(X+Y)Z]-E(X+Y)E(Z)
=E(XZ)+E(YZ)-E(X)E(Z)-E(Y)E(Z)
=Cov(X,Z)+Cov(Y,Z)
(4) D(X+Y)=D(X)+D(Y)+2Cov(X, Y).
Remark D(X-Y)=D[X+(-Y)]=D(X)+D(Y)-2Cov(X,Y)
Example 4.15----P84
3.Correlation Coefficients
Definition4.4 Suppose that r.v. X,Y has finite variance,
dentoed by DX>0,DY>0,respectively, then,
 XY 
C o v( X , Y )
D(X )
D (Y )
is name the correlation coefficients of r.v. X and Y .
Properties of coefficients
(1) |XY|1;
(2) |XY|=1There exists constants a, b such that P {Y=
aX+b}=1;
(3) X and Y are uncorrelated XY;
1. Suppose that (X,Y) are uniformly distributed on D:0<x<1,0<y<x,
try to determine the coefficient of X and Y.
Answer
2
f ( x, y)  
0
( x, y) D
others
x=y
D
1
1
E(X ) 
x

2 xdx
0

2 dx  ydy 
0
1
E ( XY ) 
1
 2x
1
D (Y ) 
3
2
dx  dy 
ydy 
0
0
x
 2 dx 
0
x
 2 xdx 
0
D( X ) 
x
0
x
0
1
3
0
1
E (Y ) 

dy 
2
y dy 
2
4
9
18
1
1
9
0
1
4
C O V ( X , Y )  E ( X Y )  E ( X ) E (Y ) 
1
36
 XY 
COV ( X , Y )
D ( X ) D (Y )

1
2

1
D
1

18
1) X ~ U (0,1), Y  X , determ ine  X Y
2
2) X ~ U (  1,1), Y  X , determ ine  X Y
2
Answer 1)
E(X ) 
1
2
, E (Y ) 
1
, E ( XY ) 
3
1
4
, D( X ) 
1
, D (Y ) 
12
4
45
1
 XY 
12
 0 . 968
1
4

12 45
2)
E ( X )  0 , E ( XY )  0
 XY  0
What does Example 2 indicate?
Exam ple 4.18
Suppose ( X , Y ) ~ N (  1 ,  2 ,  1 ,  2 ,  ), t hen  XY   .
Proof
f ( x, y ) 
2

1
exp 
2
 2(1  ρ )
2
1
2 π σ 1σ 2 1  ρ
2
2
 ( x  μ1 ) 2
( x  μ1 )( y  μ 2 ) ( y  μ 2 )
 2ρ


2
2
σ1
σ 1σ 2
σ2

 fX (x) 
fY ( y ) 
1

e
( x  μ1 )
2
2 σ1
 

 
2
,    x   ,
2 πσ 1 ( y  μ )2
2

2
1
2σ2
e
,    y   .
2 πσ 2
 E ( X )  μ 1 , E (Y )  μ 2 , D ( X )  σ 1 , D (Y )  σ 2 .
2
2
Suppose ( X , Y ) ~ N (  1 ,  2 ,  1 ,  2 ,  ), t hen  XY   .
2
Exam ple 4.18
2
 E ( X )  μ 1 , E (Y )  μ 2 , D ( X )  σ 1 , D (Y )  σ 2 .
2

 
C ov( X , Y ) 


Let t 


( x  μ1 )( y  μ 2 ) f ( x , y ) d x d y

1
2 π σ 1σ 2 1  ρ
 y  μ2
x  μ1 
ρ

,
2
σ1 
1 ρ  σ2
1
C ov( X , Y ) 
1

 
2π



2
2
 




( x  μ1 )( y  μ 2 )  e
x  μ1
u
σ1
2
2
2 σ1
 y  μ2
x  μ1 

ρ

2 
σ
σ1 
2 (1  ρ ) 
2
2
1
e
d y d x.
,
( σ 1 σ 2 1  ρ tu  ρ σ 1 σ 2 u )e
2
( x  μ1 )
2

u
2
2

t
2
2
dtdu
u
    t
 σ σ 1  ρ 2    u
    t
 ρσ σ
ρσ 1 σ 2   2  2
1 2
2
2
2
1 2

du   e dt  
d u    te d t  
 u e
  ue
  

 
  

2 π  
2
π
2





2
SO C ov( X , Y )  ρσ 1 σ 2 .
2
Hence  X Y 
2
C ov( X , Y )
D(X )
2
2 
 .
D (Y )
Note P86
Thus, if (X,Y)follow two-dimensional distribution,
then “X and Y are independent” is equvalent to “X and Y are uncorrelated
2 ,
Example 4.16—4.18 (P86)
Exercise:P90—11 Find Cov(X,Y),12
Homework:P91—16,17