Correlation and covariance are two of the most important statistical measures in finance. They quantify how two assets move in relation to each other — information that is essential for building diversified portfolios, managing risk, and understanding asset pricing models like the CAPM. This guide covers both concepts, their formulas, how they differ, and how they’re used in practice.

What Are Correlation and Covariance?

Covariance measures the directional relationship between the returns of two assets. A positive covariance means the assets tend to move in the same direction, while a negative covariance means they tend to move in opposite directions.

Correlation is the standardized version of covariance. It scales the covariance to a value between -1 and +1, making it easy to compare the strength of relationships across different asset pairs.

Key Concept

Covariance tells you the direction two assets move together. Correlation tells you the direction and the strength, on a standardized scale from -1 to +1. Both are critical inputs to portfolio variance calculations and beta.

Video: How to Create a Covariance Matrix In Excel

The Covariance Formula

Covariance measures how two assets’ returns deviate from their respective means at the same time:

Sample Covariance Formula
Cov(RA, RB) = Σ[(RA,i – R̄A)(RB,i – R̄B)] / (n – 1)
Sum of the products of each period’s deviations from the mean, divided by n – 1

Where:

  • RA,i and RB,i — returns of asset A and asset B in period i
  • A and B — mean (average) returns of each asset
  • n — number of return observations

The formula uses n – 1 (Bessel’s correction) for sample data, which provides an unbiased estimate when working with a subset of all possible returns. Population covariance uses n instead.

The result is expressed in product-of-return units (e.g., %2), which makes covariance difficult to interpret on its own. A covariance of 4.5 between two stocks doesn’t tell you whether the relationship is strong or weak — that’s where correlation comes in.

The Correlation Formula

Correlation standardizes covariance by dividing it by the product of both assets’ standard deviations:

Pearson Correlation Coefficient
ρA,B = Cov(RA, RB) / (σA × σB)
Covariance divided by the product of each asset’s standard deviation

Where:

  • Cov(RA, RB) — covariance between the two assets’ returns
  • σA and σBstandard deviations of each asset’s returns

This division removes the scale effect, producing a unitless number that always falls between -1 and +1. This makes correlation directly comparable across any pair of assets, regardless of their individual volatilities.

Video: Create a Correlation Matrix in Excel In 4 Minutes!

Interpreting Correlation Values

Correlation values fall on a spectrum from -1 to +1. Here’s what each range means for investors:

Correlation Range Interpretation Example
ρ = +1 Perfect positive — move in lockstep Two S&P 500 index funds
+0.5 ≤ ρ < +1 Strong positive correlation Apple and Microsoft (~0.7–0.8)
0 < ρ < +0.5 Weak positive correlation U.S. stocks vs. commodities
ρ = 0 No linear relationship Theoretically uncorrelated assets
-0.5 < ρ < 0 Weak negative correlation U.S. stocks vs. Treasury bonds
-1 < ρ ≤ -0.5 Strong negative correlation Stock index vs. inverse ETF
ρ = -1 Perfect negative — mirror image Rare in practice
Pro Tip

When building a diversified portfolio, look for assets with low or negative correlations. The lower the correlation between your holdings, the greater the diversification benefit — meaning you can often reduce portfolio risk without proportionally reducing expected return.

Correlation and Covariance Example

Let’s calculate both covariance and correlation for two stocks in different sectors — Apple (AAPL) and ExxonMobil (XOM) — using five months of simplified monthly returns.

Calculating Covariance and Correlation: Apple vs. ExxonMobil
Month AAPL Return XOM Return
1 5% 3%
2 -3% -2%
3 4% 1%
4 -1% 2%
5 5% 1%

Step 1: Calculate mean returns

Mean AAPL = (5 + (-3) + 4 + (-1) + 5) / 5 = 2.0%

Mean XOM = (3 + (-2) + 1 + 2 + 1) / 5 = 1.0%

Step 2: Calculate deviations and their products

Month AAPL Deviation XOM Deviation Product
1 3.0 2.0 6.0
2 -5.0 -3.0 15.0
3 2.0 0.0 0.0
4 -3.0 1.0 -3.0
5 3.0 0.0 0.0

Step 3: Calculate covariance

Sum of products = 6.0 + 15.0 + 0.0 + (-3.0) + 0.0 = 18.0

Cov(AAPL, XOM) = 18.0 / (5 – 1) = 4.50

Step 4: Calculate standard deviations and correlation

σAAPL = √(56 / 4) = √14.00 ≈ 3.74%

σXOM = √(14 / 4) = √3.50 ≈ 1.87%

ρ = 4.50 / (3.74 × 1.87) = 4.50 / 6.99 ≈ 0.64

A correlation of 0.64 indicates a moderate positive relationship — Apple and ExxonMobil tend to move in the same direction, but not closely. This makes intuitive sense: both are affected by broad economic conditions, but technology and energy have different sector-specific drivers that create divergence.

Difference Between Correlation and Covariance

While both metrics measure co-movement, they serve different purposes. Here’s when to use each:

Correlation (ρ)

  • Unitless — always between -1 and +1
  • Easy to compare across different asset pairs
  • Used to assess diversification potential
  • Appears in the alternative beta formula: β = ρ × (σi / σm)
  • Best for: communication and comparison

Covariance

  • Product-of-return units — unbounded scale
  • Cannot directly compare across asset pairs
  • Used directly in portfolio variance formula
  • Appears in the primary beta formula: β = Cov(Ri, Rm) / Var(Rm)
  • Best for: mathematical models and optimization

The two measures are directly convertible. You can always recover covariance from correlation (and vice versa) using: Cov(RA, RB) = ρA,B × σA × σB. In practice, correlation is used more often for communication and quick assessment, while covariance does the heavy lifting inside portfolio variance calculations, beta estimation, and optimization models.

Role in Portfolio Diversification

Correlation and covariance are the mathematical foundation of portfolio diversification. The variance of a two-asset portfolio depends directly on how the two assets co-move:

Two-Asset Portfolio Variance (Covariance Form)
σp2 = wA2σA2 + wB2σB2 + 2wAwBCov(RA, RB)
Portfolio variance is the weighted sum of individual variances plus a covariance term
Equivalent Correlation Form
σp2 = wA2σA2 + wB2σB2 + 2wAwBσAσBρA,B
Substituting Cov = ρ × σA × σB makes the role of correlation explicit

The key insight: when correlation is less than +1, the portfolio’s risk is less than the weighted average of the individual risks. The lower the correlation, the greater this risk reduction — which is exactly why diversification works.

For portfolios with more than two assets, pairwise covariances form a variance-covariance matrix (or equivalently, a correlation matrix). This matrix is a required input for constructing the efficient frontier and running portfolio optimization.

Pro Tip

Estimation choices matter. Return frequency (daily vs. monthly), lookback window (1 year vs. 5 years), and whether you use simple or log returns all affect the correlation and covariance output. Monthly returns over 3-5 years is a common convention in practice. Learn more about building diversified portfolios in our Portfolio Analytics & Risk Management course.

How to Calculate Correlation and Covariance

To calculate correlation and covariance for any two assets:

  1. Gather historical return data — download monthly or daily returns for both assets over the same time period
  2. Calculate the mean return for each asset
  3. Compute deviations — subtract the mean from each period’s return
  4. Multiply the deviations pairwise and sum the products
  5. Divide by n – 1 to get sample covariance
  6. Divide covariance by the product of standard deviations to get correlation

Or skip the manual work and use our calculators to get instant results:

Common Mistakes

These are the most frequent errors investors and students make when working with correlation and covariance:

1. Confusing correlation with causation — Two assets can have a high correlation without one causing the other to move. Both may be responding to the same underlying economic factor. Always look for the fundamental reason behind a correlation before acting on it.

2. Assuming correlations are stable over time — Correlations between risky assets often rise during market crises, reducing diversification benefits exactly when you need them most. A correlation that was 0.3 in calm markets may jump to 0.8 during a sell-off.

3. Using too-short data windows — Calculating correlation or covariance from just a few months of data produces noisy, unreliable estimates. As a common convention, at least 36 months of data is typically recommended for a reasonably stable estimate.

4. Comparing covariances across asset pairs — Because covariance is scale-dependent (affected by the magnitude of returns), you cannot compare the covariance of Stock A vs. Stock B with Stock C vs. Stock D. Use correlation instead for cross-pair comparisons.

5. Using price levels instead of returns — Correlation and covariance must be computed on returns, not raw prices. Stock prices are non-stationary (they trend upward over time), which produces misleading correlations that reflect the shared trend rather than the actual co-movement of returns.

Limitations of Correlation and Covariance

While correlation and covariance are fundamental tools, they have important limitations:

Important Limitation

Correlation only captures linear relationships. Two assets can have a strong nonlinear relationship — for example, one asset’s returns may depend on the magnitude of the other’s moves, regardless of direction — yet show a correlation near zero.

1. Time-varying — Correlation regimes shift over time. Assets that were weakly correlated during calm markets may become highly correlated during crises. This means historical correlations may not hold in the future.

2. Sensitive to outliers — A single extreme return period can significantly distort both covariance and correlation estimates, especially with small sample sizes.

3. Less informative with non-normal returns — While correlation and covariance can be computed on any return data, non-normal distributions with fat tails make these measures less stable and less informative about tail dependence. Two assets may have low correlation overall but crash together during extreme events.

4. Cannot distinguish upside from downside — Correlation treats co-movement symmetrically. It doesn’t tell you whether two assets tend to move together specifically during gains or during losses. For tail-risk analysis, consider downside correlation or copula-based methods.

Bottom Line

Correlation and covariance are essential building blocks for portfolio construction and risk management. Use them alongside other risk metrics — like beta, standard deviation, and maximum drawdown — for a complete picture of how your investments interact.

Frequently Asked Questions

Covariance measures the direction of co-movement between two assets’ returns, but its value is unbounded and expressed in product-of-return units, making it hard to interpret alone. Correlation standardizes covariance to a scale from -1 to +1 by dividing by the product of both assets’ standard deviations. This makes correlation easy to interpret and directly comparable across different asset pairs. The formula connecting them is: Cov(RA, RB) = ρA,B × σA × σB.

Yes. Correlations are not constant — they shift due to changing economic conditions, market regimes, and structural changes in industries. Most notably, correlations among risky assets often rise during market crises and recessions, reducing diversification benefits exactly when investors need them most. This is why portfolio managers regularly re-estimate correlations and stress-test their portfolios under different correlation scenarios.

A correlation of zero means there is no linear relationship between two assets’ returns. However, zero correlation does not mean the assets are statistically independent — they could still have a nonlinear relationship. In portfolio management, assets with zero or near-zero correlations are highly valuable because they provide significant diversification benefit, allowing you to reduce portfolio risk substantially.

Both metrics are essential inputs to portfolio risk calculations. Covariance appears directly in the portfolio variance formula, which determines how much risk a combination of assets carries. Correlation is used to assess diversification potential, construct the efficient frontier, and calculate beta. Portfolio managers seek assets with low correlations to reduce overall portfolio risk while maintaining expected returns.

As a general rule of thumb, lower correlations provide better diversification benefits. A correlation below roughly 0.5 tends to offer meaningful risk reduction, while negative correlation provides the strongest benefit. However, reliably negative correlations between asset classes are rare. In practice, combining assets with correlations in the range of roughly 0.2 to 0.6 — such as domestic stocks and international equities, or stocks and bonds — is a realistic and effective approach. The key is to avoid concentrating in highly correlated assets (ρ > 0.8), which provides little diversification benefit.

Disclaimer

This article is for educational and informational purposes only and does not constitute investment advice. Correlation and covariance values cited are approximate and may differ based on the data source, time period, and methodology used. Always conduct your own research and consult a qualified financial advisor before making investment decisions.