How to Calculate Covariance of Stocks

A properly diversified portfolio of stocks contains stocks that have a low correlation with each other. This means that when one stock goes up, the other one usually goes down. This helps reduce the volatility of your investments. When done correctly, your diversified portfolio will have the same rate of return as a more risky investment without the jarring ups and downs in value.

Calculating the covariance of two stocks is the first step in calculating correlation and only requires high school math, but because there are a lot of data points, it is best to use a spreadsheet.

Things You'll Need

  • Computer with Internet
  • Spreadsheet
Show More

Instructions

  1. Calculate the Answer on a Spreadsheet Using Data from the Web

    • 1

      Collect historical prices of the two stocks. Yahoo Finance (see link below) offers these prices. Copy and paste the historical prices of Stock 1 from a time period of your choosing into Column 1 of a spreadsheet.

    • 2

      Look up the historical prices of Stock 2. Make sure to choose the same time period and interval (e.g. monthly) as Stock 1. Copy and paste these prices into Column 2 of your spreadsheet.

      Make sure that the data for Stock 1 and Stock 2 line up correctly. Also, choose a time period that makes sense given the stocks you are comparing. For example, the end of 2008 was an unusual time for stocks because of the severe downturn, so that may be a bad time period from which to exclusively gather data.

    • 3

      Calculate the averages of Column 1 and then of Column 2 by adding up each column and dividing by the number of rows. These averages are your expected price of Stock 1 and Stock 2.

    • 4

      In column 3, use the following calculation: (Price of Stock 1---Expected Value of Stock 1) x (Price of Stock 2---Expected Value of Stock 2).

    • 5

      Calculate the average of column 3, and that figure is your covariance.

Tips & Warnings

  • There are mathematically equivalent ways to calculate covariance, so don't get confused if someone teaches you to calculate it a different way. The method described in this article works, and so do others. The reason correlation is considered more useful than covariance is that it standardizes the units, so if, for example, you are computing the correlation between gold and silver, the fact that gold is more expensive than silver won't confound the result. AssetCorrelation.com (see link below) allows you to create a custom portfolio, and it will display the correlations between all of the stocks in your portfolio in a matrix, and you can choose a time period of 1, 3, 6, 12, 18, or 24 months. Using this Web site is a lot easier than doing it yourself.

  • Utilizing covariances and correlations to pick stocks uses historical data to make decisions about the future. Unfortunately, the future only sometimes resembles the past, so your analysis may lead you to the wrong decision.

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured