Covariance
December 4, 2024
What is Covariance?
Covariance is a measure of how returns on two assets move in relation to each other, indicating whether they move together or in opposite directions. The calculation is similar to variance, but instead of focusing on one variable’s mean, it compares two variables to their means to assess their variations.
Investors can use covariance to look at how stocks (or asset classes) perform in relation to each other. By analyzing historic stock price performance, the covariance can help guide investors as to whether stock prices are likely to have similar patterns in the future relative to each other (or an index).
Key Learning Points
- Covariance measures how returns on two assets move in relation to each other, indicating whether they move together or in opposite directions
- A positive covariance indicates a positive relationship
- A negative covariance suggests they move in opposite directions
- The correlation coefficient standardizes the relationship between two assets, providing a value between -1 and 1 – this makes it easier to interpret and compare the strength of relationships between assets
- Lower correlations between assets generally provide greater diversification benefits, helping investors navigate various market environments and potentially lower overall volatility
- Portfolio managers will use correlation to assess the level of diversification within portfolios, both for asset classes and individual stocks
Covariance Formula
The covariance 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 one.
The formula is shown below:
Positive and Negative Covariance
A positive covariance indicates a positive relationship, meaning the assets tend to move together, while a negative covariance suggests they move in opposite directions. However, interpreting covariance can be challenging due to its units, leading to the use of the correlation coefficient, which provides a standardized value between -1 and 1. This makes correlation easier to interpret, allowing for better understanding of the strength of relationships between assets and facilitating comparisons across different asset pairs.
How Correlation Works?
For instance, a correlation of +1 signifies perfect correlation, where two assets move together in the same proportion, while -1 indicates perfect negative correlation, where they move in opposite directions. It would be very usual to find stocks or asset classes that were perfectly correlated, although there are many that have a high correlation, such as oil stocks. A correlation of zero suggests no apparent relationship.
Although scatterplots can visually represent these relationships, they often require further statistical analysis to confirm any underlying patterns. In finance, correlation is crucial for determining asset allocation to enhance diversification; lower correlations between assets generally provide greater diversification benefits, whereas perfectly correlated assets do not add variability to a portfolio.
It’s also important to remember that correlation does not imply causation; for example, while there may be a correlation between snow boots and car accidents during snowy weather, it’s actually snow that influences both.
What is a Correlation Matrix?
A correlation matrix can summarize how different asset classes move together, illustrating their potential diversification benefits over time. For example, intermediate government bonds historically show a negative correlation with equities, making them an effective diversifier in an equity portfolio.
Correlation in Portfolio Diversification
A diversified strategy can navigate more market environments and potentially lower overall volatility; however, correlations can be volatile across different market conditions, often changing quickly during market stress. The diversifying aspect of combining factors with different risk and return characteristics, and low correlations, helps investors weather adverse market conditions.
The formula for calculating portfolio variance and standard deviation may seem intimidating, but it involves taking the variance of each individual asset weighted by its percentage in the portfolio, squaring it, and adding it to the product of the weights, asset correlation, and individual asset standard deviations. Thus, it reflects not just the risk of individual assets but also their interactions. A portfolio of four assets will have four weights and six correlation terms, while five assets will have ten correlation terms. Variance itself can be difficult to interpret, which is why most analysts calculate the standard deviation as the square root of variance.
How to Calculate Covariance and Correlation
In this workout, we are asked to calculate the correlation between the Company A and Company B stock price performance over the course of 2024, focusing on monthly returns. Download the Correlation workout from the free resources section to work through this calculation.
These are the steps to follow in this template to calculate the correlation between Company A and Company B:
- First, we calculate the mean for each stock movement on an individual basis, using the average function in excel for their respective 12 months of returns.
- In our example the mean monthly stock price for Company A is 4.2% and Company B is 2.3%.
- Next, we calculate the standard deviation using the sample standard deviation function – for Company A this yields 6.4%, while for Company B it is 5.4% -these values are crucial for our calculations moving forward.
- We then calculate the difference between each month’s return and the overall mean return for the entire year for both Company A and Company B, using the appropriate functions to copy these calculations down for all months.
- The next step involves multiplying the differences for each month from their respective means, which we also copy down for all 12 months.
- To find the correlation coefficient, we sum the products of the monthly differences for both stocks, and identify the number of observations, which is 12 months – since we’re working with a sample, we subtract one from this number.
- The covariance is calculated by dividing the sum of the products by the number of observations, resulting in a covariance of 5.4, indicating a positive relationship between the two stocks as they generally move in the same direction.
- To assess the strength of this relationship, we calculate the correlation coefficient by dividing the covariance by the product of the standard deviations of the two stocks, yielding a correlation of 0.04.
- This indicates a positive correlation between Company A and Company B’s stock prices, but it is not strong, suggesting almost no correlation given the range from -1 to +1.
- Finally, we can confirm this correlation using the Excel function “CORREL” by identifying the monthly returns for both stocks as the data sets, which returns the same correlation coefficient calculated manually.
Conclusion
Covariance and correlation are vital in finance to understand asset relationships. Covariance indicates how two assets move together, while correlation standardizes this relationship, making it easier to interpret. These metrics help investors make informed decisions about asset allocation, diversification, and risk management.