2011年6月13日 星期一

Covariance and Correlation Coefficient

Covariance

In probability theory and statistics, covariance is a measure of how much two variables change together.
Variance is a special case of the covariance when the two variables are identical.

For any two assets A & B, the covariance of the return of these two asset in n months is calculated by the following formula:

Cov = 1/(n-1) * Σ i = 1 to n (RAi – avgRAi) * (RBi – avgRBi)

where
RAi = Return of asset A in month i
avgRAi = Average return of asset A in n months
RBi = Return of asset B in month i
avgRBi = Average return of asset B in n months

Large positive covariance does not meaning two asset have high correlation. It also depends on their volatility (standard deviation). If the volatility is high, then the corrlation is not high. To solve this problem, we can make use of correlation coefficient of these two assets.

Correlation Coefficient

Correlation coefficient = Cov / (StdA * StdB)

where
StdA = Standard deviation of A
StdB = Standard deviation of B

The value of correlation coefficient will be lie between –1  to +1, for positive value, it mean positive correlation, vice versa.

 

Reference:
綠角財經筆記: 共變異數與相關係數(Covariance and Correlation Cofficient of Financial Assets)
Covariance - Wikipedia, the free encyclopedia
Correlation and dependence - Wikipedia, the free encyclopedia

沒有留言:

張貼留言