Skip to content
Glossary

Covariance

Updated 28 November 2026 · 3 min read · Reviewed against our editorial policy

In brief

Covariance measures how two quantities move together over the same periods. A positive value means they tend to rise and fall in the same direction, while a negative value means they tend to move in opposite directions. It feeds directly into portfolio variance, which is why it matters whenever two or more assets are held together.

  • Covariance is positive when two assets tend to move in the same direction, negative when they tend to move in opposite directions, and near zero when their movements show no linear pattern.
  • Because covariance is expressed in squared units, its size is hard to judge on its own, so it is usually read alongside correlation.
  • Portfolio variance is built from each asset's variance plus a covariance term for every pair, so covariance determines how much diversification actually reduces risk.

Covariance is a statistical measure of how much two variables change together over the same periods, where a positive value means they tend to move in the same direction and a negative value means they tend to move in opposite directions.

How it works

For two series of returns, covariance compares each observation with the series' average. In each period, take asset A's return minus its average and asset B's return minus its average, multiply the two deviations, and then average the products across periods. If both assets sit above their averages in the same periods, the products are positive and covariance rises. If one sits above its average while the other sits below, the products are negative and covariance falls.

For a sample of n periods, the formula is:

Cov(A,B) = sum of (Aᵢ − Ā)(Bᵢ − B̄) ÷ (n − 1)

Covariance is measured in squared units of the underlying variable. Returns measured in percentage points therefore produce covariance in percentage points squared, which is difficult to interpret directly. This is the reason analysts often rescale it into correlation, which always falls between −1 and +1.

Worked example

Consider two hypothetical assets, Asset A and Asset B, whose annual returns have the following illustrative statistics:

  • Variance of A's returns: 83.3 (%²), a standard deviation of about 9.1%
  • Variance of B's returns: 38.7 (%²), a standard deviation of about 6.2%
  • Covariance of A and B: 56.67 (%²)

Suppose a portfolio holds 50% in each asset. The two-asset portfolio variance is:

Portfolio variance = w_A² × Var(A) + w_B² × Var(B) + 2 × w_A × w_B × Cov(A,B)

With weights of 0.5 each, the three terms are:

  • 0.25 × 83.3 = 20.825
  • 0.25 × 38.7 = 9.675
  • 2 × 0.5 × 0.5 × 56.67 = 28.335

The total is 20.825 + 9.675 + 28.335 = 58.835, which rounds to 58.8 (%²). The portfolio standard deviation is the square root of that figure, about 7.7%.

Now change only the covariance to zero, meaning the two assets show no linear co-movement. Portfolio variance falls to 30.5 (%²), and the standard deviation falls to about 5.5%. The same two assets, held in the same proportions, produce a noticeably smaller risk figure purely because of how they move together. This is a hypothetical illustration, not a forecast for any real holdings.

Reading the sign

  • A positive covariance means the assets tend to move together, so holding both offers limited smoothing of risk.
  • A negative covariance means they tend to offset one another, which lowers portfolio variance for a given mix of weights.
  • A value near zero means there is no consistent linear relationship, though the assets may still be related in non-linear ways.

A negative covariance does not guarantee a gain in any particular period, and it does not mean the combined portfolio will earn more. It describes only how the two return series have moved relative to each other in the sample used.

Why it feeds portfolio variance

For a portfolio of many assets, the variance is built from one variance term per asset and one covariance term for every pair. With 10 assets there are 10 variance terms and 90 off-diagonal covariance terms, so covariances dominate the calculation. This is why adding holdings that are weakly correlated with existing ones can reduce risk even when the new holdings are individually volatile. It is the mechanism behind diversification in Modern Portfolio Theory.

Common mistakes

  • Judging the size of a covariance without considering its units. A number of 56.67 is only meaningful relative to the variances involved.
  • Estimating covariance from a short history. Estimates are unstable, and relationships between assets often shift over time.
  • Assuming that zero covariance means independence. Covariance captures only linear co-movement, so two series can be strongly dependent in other ways.
  • Expecting covariance to stay constant in a crisis. Assets that looked weakly linked in calm markets have often moved together more closely during sharp sell-offs.

Related concepts

Correlation rescales covariance into a unit-free measure. Standard deviation and volatility describe the risk of each asset on its own, while diversification and Modern Portfolio Theory explain how the covariance terms combine into the risk of a whole portfolio.

Frequently asked questions

Is a negative covariance always better for an investor?

A negative covariance tends to reduce portfolio variance when the assets are combined in a given proportion, which is often desirable. However, it is not a guarantee of profit, and a pair with negative covariance can still lose money together over a given period. Negative covariance can also come with lower expected returns, so the trade-off needs to be judged alongside the return expectations of each holding.

How does covariance differ from correlation?

Both measure how two variables move together, but covariance is expressed in the product of the two units, such as percentage points squared, which makes its size hard to compare across pairs. Correlation divides covariance by the two standard deviations, producing a value between −1 and +1 that shows both direction and strength. For that reason, correlation is easier to interpret, while covariance is the quantity that enters the portfolio variance formula directly.

Can covariance be estimated from past returns, and how reliable is it?

Yes, covariance is commonly estimated from a historical series of returns for each pair of assets, using the sample formula with n minus 1 in the denominator. The estimate depends heavily on the period chosen, the frequency of the data and the number of observations, so results from different windows can differ materially. Investors should treat historical covariance as an approximation, since the relationship between two assets can change over time, particularly during periods of market stress.

Continue learning

Educational content only — not investment, tax or legal advice. See our disclaimer.