Covariance
A measure of the relationship between random variables
A measure of the relationship between random variables
In mathematics and statistics, covariance is a measure of the relationship between random variables. The metric primarily evaluates how much the variables together change. In other words, it is essentially a variance between two variables (note that the variance of one variable equals the variance of the variable). However, the metric does not assess the dependency between variables.
Unlike the correlation coefficient, covariance is measured in units. The units are computed by multiplying the units of the two variables. The coefficient can take any positive or negative values. The values are interpreted as follows:
In finance, the concept of covariance is primarily used in portfolio theory. One of its most common applications in portfolio theory is the diversification method using the covariance between the assets in the portfolio. By choosing the assets that do not exhibit a high positive covariance with each other, the undiversifiable risk can be partially eliminated.
CFI’s Math for Corporate Finance Course explores the financial mathematics concepts required for Financial Modeling.
The covariance formula is similar to the formula for correlation and deals with the calculation of data points from the average value in a dataset. For example, the covariance between two random variables X and Y can be calculated using the following formula (for population):
For a sample covariance, the formula is slightly adjusted:
Where:
The concepts of covariance and correlation are related to each other. Both values primarily assess the relationship between variables. However, the two measures are different and cannot be used interchangeably. The closest analogy to the relationship between covariance and correlation is the relationship between the variance and standard deviation.
Covariance measures the total variation of two random variables from their expected values. Using covariance, we can only gauge the direction of the relationship (whether the variables tend to move in tandem or the variables show an inverse relationship). However, it does not indicate the strength of the relationship, as well as the dependency between the variables.
On the other hand, correlation measures the strength of the relationship between variables. Correlation is the scaled measure of covariance. Besides, it is dimensionless. In other words, the correlation coefficient is always a pure value and not measured in any units.
The relationship between covariance and correlation can be expressed using the formula below:
Where:
John is an investor. His portfolio primarily tracks the performance of the S&P 500 and John wants to add the stock of ABC Corp. Before adding the stock to his portfolio, he wants to assess the directional relationship between the stock and the S&P 500.
John does not want to increase the unsystematic risk of his portfolio. Thus, he is not interested in owning securities in the portfolio that tend to move in the same direction.
John can calculate the covariance between the stock of ABC Corp. and S&P 500 by following the steps below:
1. Obtain the data.
Firstly, John obtains the figures for both ABC Corp. stock and S&P 500. The prices obtained are summarized in the table below:
2. Calculate the mean (average) prices for each asset.
3. For each security, find the difference between each value and mean price.
4. Multiply the results obtained in the previous step.
5. Using the number calculated in step 4, find the covariance.
In such a case, the positive covariance indicates that the prices of the stock and S&P 500 tend to move in the same direction.
CFI offers the Financial Modeling & Valuation Analyst (FMVA)™ certification program for those looking to take their careers to the next level. To keep learning and advancing your career, the following resources will be helpful:
Get world-class financial training with CFI’s online certified financial analyst training program!
Gain the confidence you need to move up the ladder in a high powered corporate finance career path.
Learn financial modeling and valuation in Excel the easy way, with step-by-step training.