## What Is Covariance?

Covariance measures the directional relationship between the returns on two assets. A positive covariance means 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 multiplying the correlation between the two random variables by the standard deviation of each variable.

### Key Takeaways

- Covariance is a statistical tool used to determine the relationship between the movements of two random variables.
- When two stocks tend to move together, they are seen as having a positive covariance; when they move inversely, the covariance is negative.
- Covariance is different from the correlation coefficient, a measure of the strength of a correlative relationship.
- Covariance is an important tool in modern portfolio theory for determining what securities to put in a portfolio.
- Risk and volatility can be reduced in a portfolio by pairing assets that have a negative covariance.

## Understanding Covariance

Covariance evaluates how the mean values of two random variables move together. For example, 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, these stocks are said to have positive covariance. In finance, covariances are calculated to help diversify security holdings.

### Formula for Covariance

When an analyst has price information from a selected stock or fund, covariance can be calculated using the following formula:

$\begin{array}{cc}& \text{Covariance}=\sum \frac{({\text{Ret}}_{abc}-{\text{Avg}}_{abc})\times ({\text{Ret}}_{xyz}-{\text{Avg}}_{xyz})}{\text{SampleSize}-1}\\ & \text{where:}\\ & {\text{Ret}}_{abc}=\text{Day\u2019sreturnforABCstock}\\ & {\text{Avg}}_{abc}=\text{ABC\u2019saveragereturnovertheperiod}\\ & {\text{Ret}}_{xyz}=\text{Day\u2019sreturnforXYZstock}\\ & {\text{Avg}}_{xyz}=\text{XYZ\u2019saveragereturnovertheperiod}\\ & \text{SampleSize}=\text{Numberofdayssampled}\end{array}\backslash begin\{aligned\}\backslash text\{Covariance\}\; =\; \backslash sum\; \backslash frac\{\; (\; \backslash text\{Ret\}\_\{abc\}\; -\; \backslash text\{Avg\}\_\{abc\}\; )\; \backslash times\; (\; \backslash text\{Ret\}\_\{xyz\}\; -\; \backslash text\{Avg\}\_\{xyz\}\; )\; \}\{\; \backslash text\{Sample\; Size\}\; -\; 1\; \}\; \backslash \backslash \backslash textbf\{where:\}\; \backslash \backslash \backslash text\{Ret\}\_\{abc\}\; =\; \backslash text\{Day\text{'}s\; return\; for\; ABC\; stock\}\; \backslash \backslash \backslash text\{Avg\}\_\{abc\}\; =\; \backslash text\{ABC\text{'}s\; average\; return\; over\; the\; period\}\; \backslash \backslash \backslash text\{Ret\}\_\{xyz\}\; =\; \backslash text\{Day\text{'}s\; return\; for\; XYZ\; stock\}\; \backslash \backslash \backslash text\{Avg\}\_\{xyz\}\; =\; \backslash text\{XYZ\text{'}s\; average\; return\; over\; the\; period\}\; \backslash \backslash \backslash text\{Sample\; Size\}\; =\; \backslash text\{Number\; of\; days\; sampled\}\; \backslash \backslash \backslash end\{aligned\}$Covariance=∑Sample Size−1(Retabc−Avgabc)×(Retxyz−Avgxyz)where:Retabc=Day’s return for ABC stockAvgabc=ABC’s average return over the periodRetxyz=Day’s return for XYZ stockAvgxyz=XYZ’s average return over the periodSample Size=Number of days sampled

## Types of Covariance

The covariance equation is used to determine the direction of the relationship between two variables—in other words, whether they tend to move in the same or opposite directions. A positive or negative covariance value determines this relationship.

### Positive Covariance

A positive covariance between two variables indicates that these variables tend to be higher or lower at the same time. In other words, a positive covariance between stock one* *and two is where stock one is higher than average at the same points that stock two is higher than average, and vice versa. When charted on a two-dimensional graph, the data points will tend to slope upwards.

### Negative Covariance

When the calculated covariance is less than negative, this indicates that the two variables have an inverse relationship. In other words, a stock one* *value lower than average tends to be paired with a stock two value* *greater than average, and vice versa.

## Applications of Covariance

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 compared 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.

## Covariance vs. Variance

Covariance is related to variance, a statistical measure for the spread of points in a data set. Both variance and covariance measure how data points are distributed around a calculated mean. However, variance measures the spread of data along a single axis, while covariance examines the directional relationship between two variables.

In a financial context, covariance is used to examine how different investments perform in relation to one another. A positive covariance indicates that two assets tend to perform well at the same time, while a negative covariance indicates that they tend to move in opposite directions. Investors might seek investments with a negative covariance to help them diversify their holdings.

## Covariance vs. Correlation

Covariance is also distinct from correlation, another statistical metric often used to measure the relationship between two variables. While covariance measures the direction of a relationship between two variables, correlation measures the strength of that relationship. This is usually expressed through a correlation coefficient, which can range from -1 to +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.

A correlation is considered strong if the correlation coefficient has a value close to +1 (positive correlation) or -1 (negative correlation). A coefficient that is close to zero indicates that there is only a weak relationship between the two variables.

## Example of Covariance Calculation

The capital sigma symbol (Σ) signifies the summation of all of the calculations. So, you need to calculate for each day and add the results. For example, to calculate the covariance between two stocks, assume you have the stock prices for a period of four days and use the formula:

$\begin{array}{cc}& \text{Covariance}=\sum \frac{({\text{Ret}}_{abc}-{\text{Avg}}_{abc})\times ({\text{Ret}}_{xyz}-{\text{Avg}}_{xyz})}{\text{SampleSize}-1}\end{array}\backslash begin\{aligned\}\backslash text\{Covariance\}\; =\; \backslash sum\; \backslash frac\{\; (\; \backslash text\{Ret\}\_\{abc\}\; -\; \backslash text\{Avg\}\_\{abc\}\; )\; \backslash times\; (\; \backslash text\{Ret\}\_\{xyz\}\; -\; \backslash text\{Avg\}\_\{xyz\}\; )\; \}\{\; \backslash text\{Sample\; Size\}\; -\; 1\; \}\; \backslash \backslash \backslash end\{aligned\}$Covariance=∑Sample Size−1(Retabc−Avgabc)×(Retxyz−Avgxyz)

Day | ABC | XYZ |
---|---|---|

1 | 1.2% | 3.1% |

2 | 1.8% | 4.2% |

3 | 2.2% | 5.0% |

4 | 1.5% | 4.2% |

You would find the Day 1 average return for ABC (1.675%) and XYZ (4.125%), subtract them from the corresponding term, and multiply them. Do this for each day:

$\begin{array}{cc}& \text{Day1}=(1.2\%-1.675\%)\times (3.1\%-4.125\%)=0.487\end{array}\backslash begin\{aligned\}\backslash text\{Day\; 1\}\; =\; (1.2\backslash \%\; -\; 1.675\backslash \%)\; \backslash times\; (3.1\backslash \%\; -\; 4.125\backslash \%)\; =\; 0.487\; \backslash \backslash \backslash end\{aligned\}$Day 1=(1.2%−1.675%)×(3.1%−4.125%)=0.487

$\begin{array}{cc}& \text{Day2}=(1.8\%-1.675\%)\ast (4.2\%-4.125\%)=0.009\end{array}\backslash begin\{aligned\}\backslash text\{Day\; 2\}\; =\; (1.8\backslash \%\; -\; 1.675\backslash \%)\; *\; (4.2\backslash \%\; -\; 4.125\backslash \%)\; =\; 0.009\; \backslash \backslash \backslash end\{aligned\}$Day 2=(1.8%−1.675%)∗(4.2%−4.125%)=0.009

$\begin{array}{cc}& \text{Day3}=(2.2\%-1.675\%)\ast (5.0\%-4.125\%)=0.459\end{array}\backslash begin\{aligned\}\backslash text\{Day\; 3\}\; =\; (2.2\backslash \%\; -\; 1.675\backslash \%)\; *\; (5.0\backslash \%\; -\; 4.125\backslash \%)\; =\; 0.459\; \backslash \backslash \backslash end\{aligned\}$Day 3=(2.2%−1.675%)∗(5.0%−4.125%)=0.459

$\begin{array}{cc}& \text{Day4}=(1.5\%-1.675\%)\ast (4.2\%-4.125\%)=-0.013\end{array}\backslash begin\{aligned\}\backslash text\{Day\; 4\}\; =\; (1.5\backslash \%\; -\; 1.675\backslash \%)\; *\; (4.2\backslash \%\; -\; 4.125\backslash \%)\; =\; -0.013\; \backslash \backslash \backslash end\{aligned\}$Day 4=(1.5%−1.675%)∗(4.2%−4.125%)=−0.013

Add each day's result to the previous result:

$\begin{array}{cc}& 0.487+0.009+0.459-0.013=0.943\end{array}\backslash begin\{aligned\}\&0.487\; +\; 0.009\; +\; 0.459\; -\; 0.013\; =\; 0.943\; \backslash \backslash \backslash end\{aligned\}$0.487+0.009+0.459−0.013=0.943

Your sample size is four, so subtract one from four and divide the previous result by it:

$\begin{array}{cc}& \frac{0.943}{3}=.314\end{array}\backslash begin\{aligned\}\&\backslash frac\{\; 0.943\; \}\{\; 3\; \}\; =\; .314\; \backslash \backslash \backslash end\{aligned\}$30.943=.314

This sample has a covariance of .314, a positive number, suggesting that the two stocks are similar in returns.

## What Does a Covariance of 0 Mean?

**VIDEO: The Covariance Explained in One Minute: Definition, Formula and Examples**

A covariance of zero indicates that there is no clear directional relationship between the variables being measured. In other words, a high value for one stock is equally likely to be paired with a high or low value for the other.

## What Is Covariance vs. Variance?

**VIDEO: Covariance Clearly Explained!**

Covariance and variance are used to measure the distribution of points in a data set. However, variance is typically used in data sets with only one variable and indicates how closely those data points are clustered around the average. Covariance measures the direction of the relationship between two variables. A positive covariance means that both variables tend to be high or low at the same time. A negative covariance means that when one variable is high, the other tends to be low.

## What Is the Difference Between Covariance and Correlation?

**VIDEO: Covariance and Correlation - Example**

Covariance measures the direction of a relationship between two variables, while correlation measures the strength of that relationship. Both correlation and covariance are positive when the variables move in the same direction and negative when they move in opposite directions. However, a correlation coefficient must always be between -1 and +1, with extreme values indicating a strong relationship.

## How Is a Covariance Calculated?

**VIDEO: Covariance, Clearly Explained!!!**

For a set of data points with two variables, the covariance is measured by taking the difference between each variable and their respective means. These differences are then multiplied and averaged across all of the data points. In mathematical notation, this is expressed as:

Covariance = Σ [ ( Return_{abc} - Average_{abc} ) * ( Return_{xyz} - Average_{xyz} ) ] ÷ [ Sample Size - 1 ]

## The Bottom Line

Covariance is an important statistical metric for comparing the relationships between multiple variables. In investing, covariance is used to identify assets that can help diversify a portfolio.

Author: Michelle Miller

Last Updated: 1704382082

Views: 821

Rating: 4 / 5 (48 voted)

Reviews: 93% of readers found this page helpful

Name: Michelle Miller

Birthday: 2000-01-16

Address: 1792 Ryan Locks Apt. 978, Brownberg, DC 45173

Phone: +4701840440812180

Job: Radiologist

Hobby: Fishing, Backpacking, Calligraphy, Surfing, Playing Guitar, Scuba Diving, Coffee Roasting

Introduction: My name is Michelle Miller, I am a brilliant, venturesome, proficient, accessible, ingenious, enterprising, apt person who loves writing and wants to share my knowledge and understanding with you.