
Covariance
Covariance measures the directional relationship between the returns on two assets. They are: xi = a given x value in the data set xm = the mean, or average, of the x values yi = the y value in the data set that corresponds with xi ym = the mean, or average, of the y values n = the number of data points Given this information, the formula for covariance is: **Cov(x,y) = SUM \[(xi - xm) \(yi - ym)\] / (n - 1)** While the covariance does measure the directional relationship between two assets, it does not show the strength of the relationship between the two assets; the coefficient of correlation is a more appropriate indicator of this strength. The data set may look like: Q1: x = 2, y = 10 Q2: x = 3, y = 14 Q3: x = 2.7, y = 12 Q4: x = 3.2, y = 15 Q5: x = 4.1, y = 20 The average x value equals 3, and the average y value equals 14.2. would be divided by (n-1), as follows: Cov(x,y) = ((2 - 3) x (10 - 14.2) + (3 - 3) x (14 - 14.2) + ... (4.1 - 3) x (20 - 14.2)) / 4 = (4.2 + 0 + 0.66 + 0.16 + 6.38) / 4 = 2.85 Having calculated a positive covariance here, the analyst can say that the growth of the company's new product line has a positive relationship with quarterly GDP growth. To calculate the covariance, the sum of the products of the xi values minus the average x value, multiplied by the yi values minus the average y values

What Is Covariance?
Covariance measures the directional relationship between the returns on two assets. A positive covariance means that asset returns move together while a negative covariance means they move inversely. Covariance is calculated by analyzing at-return surprises (standard deviations from the expected return) or by multiplying the correlation between the two variables by the standard deviation of each variable.




Understanding Covariance
Covariance evaluates how the mean values of two variables move together. If stock A's return moves higher whenever stock B's return moves higher and the same relationship is found when each stock's return decreases, then these stocks are said to have positive covariance. In finance, covariances are calculated to help diversify security holdings.
When an analyst has a set of data, a pair of x and y values, covariance can be calculated using five variables from that data. They are:
Given this information, the formula for covariance is: Cov(x,y) = SUM [(xi - xm) * (yi - ym)] / (n - 1)
While the covariance does measure the directional relationship between two assets, it does not show the strength of the relationship between the two assets; the coefficient of correlation is a more appropriate indicator of this strength.
Covariance Applications
Covariances have significant applications in finance and modern portfolio theory. For example, in the capital asset pricing model (CAPM), which is used to calculate the expected return of an asset, the covariance between a security and the market is used in the formula for one of the model's key variables, beta. In the CAPM, beta measures the volatility, or systematic risk, of a security in comparison to the market as a whole; it's a practical measure that draws from the covariance to gauge an investor's risk exposure specific to one security.
Meanwhile, portfolio theory uses covariances to statistically reduce the overall risk of a portfolio by protecting against volatility through covariance-informed diversification.
Possessing financial assets with returns that have similar covariances does not provide very much diversification; therefore, a diversified portfolio would likely contain a mix of financial assets that have varying covariances.
Example of Covariance Calculation
Assume an analyst in a company has a five-quarter data set that shows quarterly gross domestic product (GDP) growth in percentages (x) and a company's new product line growth in percentages (y). The data set may look like:
The average x value equals 3, and the average y value equals 14.2. To calculate the covariance, the sum of the products of the xi values minus the average x value, multiplied by the yi values minus the average y values would be divided by (n-1), as follows:
Cov(x,y) = ((2 - 3) x (10 - 14.2) + (3 - 3) x (14 - 14.2) + ... (4.1 - 3) x (20 - 14.2)) / 4 = (4.2 + 0 + 0.66 + 0.16 + 6.38) / 4 = 2.85
Having calculated a positive covariance here, the analyst can say that the growth of the company's new product line has a positive relationship with quarterly GDP growth.
Related terms:
Asset
An asset is a resource with economic value that an individual or corporation owns or controls with the expectation that it will provide a future benefit. read more
Beta : Meaning, Formula, & Calculation
Beta is a measure of the volatility, or systematic risk, of a security or portfolio in comparison to the market as a whole. It is used in the capital asset pricing model. read more
Capital Asset Pricing Model (CAPM)
The Capital Asset Pricing Model is a model that describes the relationship between risk and expected return. read more
Correlation
Correlation is a statistical measure of how two securities move in relation to each other. read more
Correlation Coefficient
The correlation coefficient is a statistical measure that calculates the strength of the relationship between the relative movements of two variables. read more
Cross-Correlation
Cross-correlation is a measurement that tracks the movements over time of two variables relative to each other. read more
Diversification
Diversification is an investment strategy based on the premise that a portfolio with different asset types will perform better than one with few. read more
Financial Asset
A financial asset is a non-physical, liquid asset that represents—and derives its value from—a claim of ownership of an entity or contractual rights to future payments. Stocks, bonds, cash, and bank deposits are examples of financial assets. read more
Gross Domestic Product (GDP)
Gross domestic product (GDP) is the monetary value of all finished goods and services made within a country during a specific period. read more
Inverse Correlation
An inverse correlation is a relationship between two variables such that when one variable is high the other is low and vice versa. read more