Covariance is a statistic that measures whether two investments’ returns tend to move above and below their averages at the same time. A positive covariance means they have tended to move together, a negative covariance means they have tended to move in opposite directions, and a value near zero means no consistent relationship.
Covariance rarely appears on fund fact sheets, yet it is the raw ingredient behind correlation, beta and every estimate of portfolio risk. This article works through a full calculation, explains why the result is awkward to interpret alone, and shows exactly how covariance enters the math that determines how volatile a combined portfolio may be.
The Hidden Ingredient in Diversification Math
When investors talk about diversification, they usually mention correlation. Behind each correlation figure, though, sits a covariance calculation. Covariance is the measure that portfolio formulas actually use, and correlation is a rescaled version designed to be easier to read.
The reason covariance matters so much is that portfolio risk depends on more than the risk of each holding. It also depends on how holdings interact. Two volatile funds can produce a fairly calm portfolio if their swings tend to offset each other, and covariance is the statistic that captures that offsetting.
Understanding covariance helps explain why combining investments can lower risk, why some combinations work better than others, and why risk estimates can change when relationships between holdings shift.
The concept may sound technical, but the underlying idea is simple. It asks, period by period, whether two investments were both above average, both below average, or on opposite sides. The calculation then averages those patterns into a single number.
What the Sign of Covariance Reveals
The sign of covariance carries most of its everyday meaning. A positive covariance means that when one investment returned more than its average, the other also tended to return more than its average, and when one fell short, the other tended to fall short as well.
A negative covariance means the opposite pattern. Periods when one investment beat its average tended to be periods when the other lagged its average. This is the kind of relationship that can steady a portfolio, because gains in one holding partly cushion losses in another.
A covariance near zero means no consistent pattern. Sometimes the two investments were on the same side of their averages and sometimes on opposite sides, with neither pattern dominating.
The size of the number is much harder to interpret than the sign. A covariance of 4 might indicate a strong relationship between two calm assets or a weak relationship between two very volatile ones. Making sense of the size requires the extra step described later in this article.
Calculating Covariance Step by Step
Suppose hypothetical Fund A returned 6%, 2%, 8% and 4% over four periods, while Fund B returned 3%, 1%, 5% and 3% over the same periods. The calculation follows three steps.
Find Each Fund’s Average
Fund A’s returns add up to 20, and 20 ÷ 4 = 5%. Fund B’s returns add up to 12, and 12 ÷ 4 = 3%.
These averages are the reference points. Covariance looks at how far each return sits from its own fund’s average, not at the raw returns themselves. Two funds with very different average returns can still have a strong covariance if their deviations line up period by period.
Multiply the Paired Deviations
Fund A’s deviations from its average are 1, -3, 3 and -1. Fund B’s deviations are 0, -2, 2 and 0.
Multiply each pair from the same period: 1 × 0 = 0, -3 × -2 = 6, 3 × 2 = 6, and -1 × 0 = 0.
When both deviations share a sign, the product is positive. When they have opposite signs, it is negative. Here, the two large products are both positive, because both funds fell short together in period two and beat their averages together in period three.
Average the Products
The products add up to 12. Treating the data as a sample, divide by one less than the number of periods: 12 ÷ 3 = 4. The sample covariance is 4, measured in percent squared.
Treating the data as a complete population instead, the division is by four, giving a covariance of 3. As with variance, the sample version is more common when working with investment returns, since past periods are only a sample of possible outcomes.
Why the Size of Covariance Is Hard to Read
The covariance of 4 in the example is expressed in percent squared, because it multiplies one percentage deviation by another. Like variance, this unit has no everyday meaning, which makes it difficult to judge whether 4 is large or small.
The scale also depends on how returns are written. If the same returns are entered as decimals, such as 0.06 instead of 6%, the covariance becomes 0.0004 instead of 4. The relationship is identical, but the number looks completely different.
More importantly, covariance grows with the volatility of the assets involved. Two highly volatile stocks with a loose relationship can show a larger covariance than two calm bond funds with a tight relationship. Comparing covariances across different pairs of investments can therefore mislead.
These quirks explain why covariance is rarely shown to individual investors. It is a working figure for calculations rather than a figure for communication. To compare relationships fairly, covariance needs to be rescaled, and that rescaled figure is correlation.
Converting Covariance Into Correlation
Correlation divides covariance by the product of the two standard deviations. In plain text: correlation = covariance ÷ (standard deviation of A × standard deviation of B). This removes the units and the effect of each asset’s volatility, leaving a number between -1 and +1.
Continuing the example, Fund A’s squared deviations are 1, 9, 9 and 1, which add up to 20. The sample variance is 20 ÷ 3, or about 6.67, so the standard deviation is about 2.58.
Fund B’s squared deviations are 0, 4, 4 and 0, which add up to 8, giving a variance of about 2.67 and a standard deviation of about 1.63.
The product of the standard deviations is about 2.58 × 1.63, or roughly 4.22. Dividing the covariance by this figure gives 4 ÷ 4.22, or about 0.95.
A correlation near 0.95 shows that the two funds moved together very consistently, something the raw covariance of 4 could not reveal on its own. The same conversion works for any pair, which is why correlation is the figure usually reported.
The Covariance Matrix
A portfolio with more than two holdings has a covariance for every pair. These are arranged in a table called a covariance matrix, where each row and column represents one holding and each cell shows the covariance between the corresponding pair.
The matrix has a few features worth knowing:
- The cells on the diagonal, where a holding meets itself, contain each holding’s variance.
- The table is symmetrical, since the covariance of A with B equals the covariance of B with A.
- The number of distinct pairs grows quickly as holdings are added. Five holdings produce 10 pairs, and ten holdings produce 45 pairs.
- Each cell can be converted to a correlation, producing a correlation matrix that is easier to read.
Portfolio software works from this matrix when estimating risk. The rapid growth in the number of pairs also explains why estimates for large portfolios depend on many inputs, each of which may contain some error. Small errors across many cells can add up to a noticeably different result.
How Covariance Drives Portfolio Variance
The variance of a two-asset portfolio is calculated with this plain-text formula: portfolio variance = (wA² × varA) + (wB² × varB) + (2 × wA × wB × covAB). The last term is where covariance enters, and it can raise or lower the total.
Suppose a portfolio holds 50% in Fund X, with a variance of 0.04, and 50% in Fund Y, with a variance of 0.01. The first two terms are 0.25 × 0.04 = 0.01 and 0.25 × 0.01 = 0.0025, which sum to 0.0125.
The covariance term is 2 × 0.5 × 0.5 × covariance, or half the covariance.
If the covariance is 0.01, the portfolio variance is 0.0125 + 0.005 = 0.0175, giving a standard deviation of about 13.2%. If the covariance is zero, the variance is 0.0125, and the standard deviation is about 11.2%.
If the covariance is -0.004, the variance is 0.0125 – 0.002 = 0.0105, and the standard deviation is about 10.2%. The holdings and weights are identical in all three cases. Only the covariance changed, yet portfolio volatility moved by several percentage points.
Covariance and Beta
Covariance is also the numerator in the formula for beta, the measure of how sensitive an investment is to market movements. In plain text: beta = covariance of the investment with the market ÷ variance of the market.
Suppose a stock’s covariance with a market index is 0.018 and the index’s variance is 0.015. Beta is 0.018 ÷ 0.015 = 1.2, suggesting the stock has tended to move about 1.2 times as much as the market, on average.
This relationship shows that beta is essentially covariance scaled by the market’s own variability. A stock with a large positive covariance with the market will tend to have a high beta, while one with a covariance near zero will have a beta near zero.
Seeing beta, correlation and portfolio variance as offshoots of covariance ties these measures together. Each one rescales or combines the same raw information about co-movement to answer a slightly different question about risk.
Estimation Problems to Keep in Mind
Covariance is calculated from historical data, and several practical issues affect how reliable the result is.
- Short histories. A few observations, as in this article’s example, can produce extreme or unstable figures.
- Changing relationships. Covariance between two assets can shift as economic conditions, interest rates or company strategies change.
- Stress periods. Relationships that look loose in calm markets may tighten during sharp sell-offs, which can raise portfolio risk when it matters most.
- Mismatched data. Returns must be measured over exactly the same periods for both assets, or the result is meaningless.
- Outliers. A single extreme period can dominate the products of deviations and distort the result.
Because of these issues, analysts often compare covariance estimates across different time windows and treat a single figure with caution. For individual investors, the key point is that any portfolio risk estimate is only as dependable as the covariance inputs behind it.
Making Covariance Useful in Your Own Analysis
Most investors will not calculate covariance by hand, but the concept can sharpen how they read portfolio information. When a tool reports that a portfolio’s volatility is lower than the average of its holdings, covariance is the reason, and it is worth asking whether the relationships behind that result are likely to hold.
Spreadsheet programs include covariance functions that make it easy to experiment. Comparing the covariance and correlation of two holdings over different periods can reveal whether their relationship has been stable.
When reviewing a portfolio, the correlation matrix, which is the readable form of the covariance matrix, can highlight pairs that move almost identically and pairs that offset each other. That view often explains more about overall risk than the volatility of individual holdings.
Investors who want to understand how these relationships affect their own plans may benefit from speaking with a qualified, fiduciary financial professional who can run portfolio-level analysis and explain the assumptions in plain language.