Covariance and Correlation Calculations
- 06:38
What the correlation and covariance metrics tell us and how they are calculated.
Downloads
No associated resources to download.
Transcript
covariance and correlation covariance measures whether the Returns on two individual assets move in the same direction a positive covariance or in opposite direction a negative covariance the formula multiplies the variance of the first asset against its mean and the variance of the second asset against its mean and then divides the result by the number of observations minus 1 Since we are dividing by n minus 1, we are calculating a sample covariance which is typically the standard statistical method since we are usually working with a sample of monthly returns across assets.
When working with a population IE the entire data the denominator changes to n rather than n minus 1 typically investors look to historical covariance for guidance on developing expectations for the future for this purpose the sample covariance, which is computed against a sample of historical data about the two variables is appropriate the calculation is similar to variance, but we are comparing two items deviations from their means while covariance specifies the direction. It is harder to compare and interpret their results as the units are not scaled and do not indicate the strength of the relationship.
In this example of covariance. We have tracked the monthly return on the S&P 500 versus Microsoft taking the difference between the monthly return and the mean over the period we can calculate the variance. Then the product is calculated by multiplying the two variances the sum of the products divided by the number of observations minus one gives the covariance Microsoft has a positive covariance to the S&P 500 meaning the Returns on the stock move in the same direction as the Returns on the market download the supporting file to get Hands-On with the example Excel data shown here and throughout this module.
In comparison here. We have added a third asset Franco, Nevada Corp fnv is a gold mining company Returns on fnv have a negative covariance with the market which means they will move in the opposite direction to the market. We can also observe that fnv has a negative covariance with msft calculating covariance across three assets becomes more cumbersome. So here we have utilized excel's matrix multiplication function and malt first we find the difference of each observation from its mean columns a through D rows 15 through 19, then multiply the values using the mulch and transpose functions column G through I row seven to nine since we are multiplying arrays after you enter the formula and highlighting the relevant cells. You must press control shift enter to return the multiple results in an array on the worksheet. The Excel function equal covariance dot s can also be to get the same values like covariance correlations tell you if two assets are positively or inversely related unlike covariance correlation easily tells you the degree of the positive or negative relationship results are easier to interpret as the range of values are scaled it always negative 1 to positive 1 the correlation is calculated by taking the covariance of the two variables and dividing by the product of their standard deviations.
The Excel formula equal Corel will do this quickly and easily for you the bounds of the results largest and smallest possible values allow for comparisons between different pairs of assets covariance doesn't support this that is why you are more likely to see correlation data. It is more useful.
Coming back to our two examples. We first calculate the standard deviation of the Returns on the S&P and the returns of Microsoft over six month period then we take the covariance of Microsoft against the S&P of 21.5 and divide by the product 5.3 times 6.0 of the standard deviation to get the correlation coefficient of 0.7 Returns on Microsoft have a positive correlation to the S&P 500 over this period In example 2 here, we calculate the Returns on fnv compared to the S&P 500 giving a negative correlation of 0.1 demonstrating that there is a weak negative relationship between fnv's returns and the S&P 500 FMV has a larger negative correlation with msft at negative 0.8 demonstrating that there is a stronger negative value relationship between the two stocks. Once again, we utilize the Excel and malt and transpose functions to create a correlation Matrix for the three assets first. We did a matrix multiplication of standard deviations and then divided those values by the corresponding covariance to calculate the correlation excel's function equal Chorale can also be used to achieve the same results as shown.
Scatter Plots are formed by using the data from two different series to plot coordinates along the X and Y axis where one element of the data series forms the x coordinate and the other the y coordinate.
Here you can see three examples visual inspection of a scatter plot. Although not sufficient to demonstrate a statistical relationship is often a starting point for examining data in order to assess whether there appears to be an underlying relationship. You will rarely see measures at the perfect outer bounds rather. You will see them in between negative one and positive one and the strength of the relationship increases as the value approaches those outer bounds.
Correlation is used to determine what asset to add to a portfolio to increase diversification the lower the correlation the more diversification benefits. There are no diversification benefits. If the correlation is positive one correlation does not equal causation. It can be spurious snow boots and car accidents have a correlation but snow boots do not cause car accidents the correlation between the variable is from their relationships to a third variable the weather not each other.