Lesson Downloads
Calculating Covariance and Correlation
Both correlation and covariance are indicators of the relationship between two variables. They indicate whether the variables are positively or negatively related, i.e., how they move together. For example, what is the relationship between the performance of gold and S&P 500 index?
Covariance measures the comovement between two variables i.e. the amount by which the two random variables show movement or change together.
The correlation also indicates the degree to which the two variables are related. It’s a translation of covariance into a unit-less measure that we can understand (-1.0 to 1.0). The correlation of the variable with itself is always 1.
Calculating Covariance and Correlation
Covariance is calculated using the following formula:

Where Ri and Rj represent the returns on two assets, i and j.
The following example illustrates the calculation of expected returns:
| State of Economy | RA | RB | RA-E(RA ) | RB-E(RB ) | P*( RA-E(RA ))( RB-E(RB )) | |
| 1 | 10% | -10% | 5% | -26.00% | -9.00% | 0.234% |
| 2 | 30% | 15% | 12% | -1.00% | -2.00% | 0.006% |
| 3 | 30% | 18% | 19% | 2.00% | 5.00% | 0.030% |
| 4 | 20% | 22% | 15% | 6.00% | 1.00% | 0.012% |
Test Your Knowledge
Check your understanding of this lesson with a short quiz.

