Covariance

Covariance measures joint variation between two variables and supplies the cross-asset terms used in portfolio risk and factor models.

Covariance measures whether two variables tend to be above or below their respective means at the same time. In finance, covariance is commonly calculated between asset returns and is a direct input into portfolio variance, factor models, hedging analysis, and risk aggregation.

Positive covariance indicates same-direction variation; negative covariance indicates offsetting variation; covariance near zero indicates little linear co-movement. Its magnitude depends on the variables’ units and volatility, so it is harder to compare across pairs than correlation.

Key Takeaways

  • Covariance captures the direction and amount of joint linear variation.
  • Its sign is interpretable, but its magnitude depends on scale and measurement units.
  • Correlation standardizes covariance by the two variables’ standard deviations.
  • Portfolio variance includes covariance terms for every pair of holdings.
  • A covariance estimate is historical and sample-dependent, not a permanent property.
  • Zero covariance does not establish independence or eliminate nonlinear and tail dependence.

Sample Covariance Formula

For paired observations ((X_i,Y_i)), sample covariance is:

$$ s_{XY}=\frac{\sum_{i=1}^{n}(X_i-\bar X)(Y_i-\bar Y)}{n-1} $$

The calculation centers each observation around its sample mean and multiplies the deviations:

  • two positive deviations or two negative deviations produce a positive product
  • deviations with opposite signs produce a negative product
  • averaging those products estimates the direction and amount of joint variation

Using (n-1) is the conventional sample estimator. A population covariance calculated from the complete population uses the population mean and commonly divides by (n).

Covariance vs. Correlation

Correlation is covariance divided by the product of standard deviations:

$$ \rho_{XY}=\frac{\operatorname{Cov}(X,Y)}{\sigma_X\sigma_Y} $$
FeatureCovarianceCorrelation
RangeUnbounded-1 to +1
UnitsProduct of the variables’ unitsUnitless
SignShows direction of linear co-movementShows direction of linear co-movement
MagnitudeDepends on scale and volatilityStandardized for easier comparison
Portfolio useEnters the variance-covariance matrix directlyOften converted back to covariance with volatilities

If two assets have annual volatilities of 12% and 8% and correlation of 0.25, their covariance in decimal-return units is:

$$ \operatorname{Cov}(A,B)=0.25\times0.12\times0.08=0.0024 $$

The same relationship can be reported as 0.25 correlation, which is easier to compare with another pair. The covariance value is still the number used in portfolio-variance calculations.

Worked Example: Covariance in a Two-Asset Portfolio

Assume a portfolio holds 60% in Asset A and 40% in Asset B. Their estimated annual volatilities are 12% and 8%, and covariance is 0.0024.

$$ \sigma_p^2=w_A^2\sigma_A^2+w_B^2\sigma_B^2+2w_Aw_B\operatorname{Cov}(A,B) $$
ComponentCalculationVariance contribution
Asset A(0.60^2\times0.12^2)0.005184
Asset B(0.40^2\times0.08^2)0.001024
Joint covariance(2\times0.60\times0.40\times0.0024)0.001152
Portfolio varianceSum of components0.007360
Portfolio volatility(\sqrt{0.007360})8.58%

If the covariance were higher, the joint contribution would increase. If it were negative, the joint term would reduce modeled variance. The estimate does not capture every risk: credit events, liquidity gaps, option-like payoffs, and changing dependence can produce losses not summarized by variance.

The Variance-Covariance Matrix

For more than two assets, analysts organize variances and covariances in a matrix:

$$ \Sigma= \begin{bmatrix} \sigma_1^2 & \sigma_{12} & \cdots \\ \sigma_{21} & \sigma_2^2 & \cdots \\ \vdots & \vdots & \ddots \end{bmatrix} $$

The diagonal contains each asset’s variance. Off-diagonal entries contain pairwise covariances, with (\sigma_{ij}=\sigma_{ji}). Portfolio variance is compactly written as:

$$ \sigma_p^2=\mathbf{w}^{\mathsf T}\Sigma\mathbf{w} $$

As the number of assets increases, the number of pairwise estimates grows rapidly. Estimation error can make an empirical matrix unstable or unsuitable for optimization. Analysts may use longer samples, shrinkage, factor structures, constraints, or stress matrices, but each introduces assumptions that should be documented.

Finance Uses

  • Portfolio construction: estimate how positions combine rather than evaluating each volatility independently.
  • Risk decomposition: attribute risk to individual variances and cross-position covariance terms.
  • Factor models: estimate how security or portfolio returns vary with market, sector, rate, or style factors.
  • Hedging: assess whether a proposed hedge tends to offset the target exposure.
  • Asset-liability management: measure interaction between asset values, funding costs, and liability movements.
  • Scenario design: compare ordinary estimated dependence with adverse common-movement assumptions.

Measurement Choices That Matter

Return Definition

Use consistently measured total returns, excess returns, price changes, yield changes, or other variables appropriate to the question. Mixing a price level with a return usually produces a result that is difficult to interpret.

Frequency and Alignment

Daily, weekly, and monthly estimates can differ. Market holidays, time zones, closing times, stale marks, and nonsynchronous trading can bias covariance.

Annualization

Under simplifying assumptions, a covariance estimated from periodic returns may be annualized by multiplying by the number of periods per year. Serial dependence and changing volatility can make that scaling unreliable.

Sample Window

A longer window supplies more observations but may combine incompatible regimes. A shorter window may adapt faster but produce noisier estimates.

Common Mistakes

  • Comparing raw covariance values across pairs with different units or volatilities.
  • Calculating covariance on unadjusted price levels instead of appropriate returns or changes.
  • Combining observations from mismatched dates or market closes.
  • Treating a sample estimate as known without uncertainty.
  • Ignoring outliers, stale prices, and missing observations.
  • Assuming covariance remains stable during a liquidity or funding shock.
  • Feeding a noisy covariance matrix into an optimizer without stability checks.
  • Treating zero covariance as proof that variables are independent.

How to Evaluate a Covariance Estimate

  1. Confirm that both series use aligned dates, frequency, units, and currency.
  2. Plot the series and inspect outliers and stale observations.
  3. Compare covariance with the corresponding correlation and volatilities.
  4. Test alternative windows and market regimes.
  5. Check whether the matrix is internally consistent and usable for the intended calculation.
  6. Stress dependence rather than assuming historical covariance covers adverse conditions.
  7. Explain how estimation uncertainty affects allocation, hedge, or risk conclusions.

Authoritative Sources

  • Correlation: Standardized measure of linear co-movement.
  • Portfolio Variance: Risk measure calculated from portfolio weights and the variance-covariance matrix.
  • Standard Deviation: Square root of variance and a scale input for converting covariance to correlation.
  • Diversification: Combination of exposures to reduce concentration in common outcomes.
  • Portfolio Optimization: Selection of weights using estimated returns, covariances, and constraints.
  • Regression Analysis: Method that uses covariance relationships when estimating linear coefficients.

FAQs

Can covariance be negative?

Yes. Negative covariance means the two variables tend to have deviations from their means in opposite directions. In a portfolio, a negative covariance term reduces modeled variance when position weights have the same sign.

Why is correlation easier to interpret than covariance?

Correlation scales covariance by both variables’ standard deviations, creating a unitless measure between -1 and +1. Covariance retains the variables’ scale and is therefore less comparable across pairs.

Is zero covariance the same as independence?

No. Independence implies zero covariance when the relevant moments exist, but zero covariance does not generally imply independence. Nonlinear or tail dependence can remain.

This article provides general financial education. Covariance estimates do not guarantee diversification, hedge effectiveness, or future risk and are not personalized investment advice.

Browse Valuation and Analysis