Trieschmarksslides PDF
Trieschmarksslides PDF
variables
• Height and wake-up time are uncorrelated, but height and weight
are correlated.
• Covariance
Cov(X, Y) = 0 for X = height, Y = wake-up times
Cov(X, Y) > 0 for X = height, Y = weight
• Definition:
1 n
Cov ( X , Y ) - , ( xi $ mx )( yi $ m y ) “sample covariance”
n i -1
Questions:
What is Cov(X, X) ? Cov(X, X) = Var(X)
How are Cov(X, Y) and Cov(Y, X) related? Cov(X, Y) = Cov(Y, X)
n ) " &
) &
)* yn $ m y &'
Method 1: >> v = (1/n)*(x-m_x)*(y-m_y)’
Method 2: >> w = x-m_x
>> z = y-m_y
>> v = (1/n)*w*z’
Properties:
• -1 ! Cxy ! 1
• if Cxy = 0 : X and Y uncorrelated
• if Cxy bigger/smaller zero : X and Y are positively/negatively
correlated
• Advantage: we can multiply X and Y with arbitrary factors and
Cxy stays the same.
+X ( +20 0(
V -) & ) 0 1&
*Y ' * '
>> m = (1/n)*sum(v,2)
>> z = v - repmat(m,1,n)
>> v = (1/n)*z*z’