Correlation between assets: what it measures and why it changes

On this page

Key takeaways

  • Correlation measures how closely two holdings move together, on a scale from −1 (opposite directions) through 0 (unrelated) to +1 (in lockstep), whatever the size of their swings.
  • The lower the correlation, the more two holdings offset each other's swings; unless they move in perfect lockstep, a mix is always calmer than the average of its parts.
  • Correlation is not constant. Measured over trailing windows it drifts, and between stocks and government bonds it has changed sign: positive through much of the 1990s, negative for about two decades from 2000, positive again from 2022.
  • Correlations measured in calm periods tend to understate those in sell-offs, when many risky assets fall together; a full-window number can hide both regimes.
  • MarketHeist measures it on monthly total returns, both over the full shared history and over rolling three-year windows.

Definition

Correlation is a number between −1 and +1 that measures how closely two assets' returns move together: +1 means they rise and fall in lockstep, 0 means no linear relationship, and −1 means one rises when the other falls. It is what decides how much combining two assets reduces the swings of the combination, and it changes over time.

Also known as: correlation coefficient, Pearson correlation, rolling correlation, stock-bond correlation, asset correlation, correlation of returns.

How it works

For each month, note whether each asset's return was above or below its own average, and by how much. When both tend to be above average in the same months and below in the same months, the products of those distances are mostly positive and the correlation is positive. When one tends to be above while the other is below, the products are mostly negative. Dividing by both volatilities strips out the size of the swings, leaving only how consistently they line up.

Correlation is what makes diversification work. The volatility of a two-asset mix depends on each asset's volatility, on the weights, and on one more term that carries the correlation. At +1 the mix is exactly as volatile as the weighted average of its parts; anything below +1 brings it down, and a negative correlation brings it down the most.

The number describes a relationship, not a law. Stocks and government bonds are the classic case. When inflation and interest rates drive both markets, as in the 1990s, a rate rise hurts both and they move together. When growth scares dominate and inflation is quiet, investors sell stocks and buy safe bonds at the same moments, and the correlation turns negative. That was the pattern of the 2000s and 2010s. Inflation's return in 2022 flipped it back.

Correlation is like the relationship between two dancers: over a whole evening they may seem to move independently, while in each song they are clearly together or clearly apart. A full-window correlation averages the evening; a rolling correlation follows the songs.

That is why MarketHeist shows both. The full window gives a stable estimate from many months; a trailing window shows what the relationship has been lately, at the cost of fewer observations and more noise.

Formula

Pearson correlation of two return series
ρ=∑t=1N(xt−x¯)(yt−y¯)∑t=1N(xt−x¯)2∑t=1N(yt−y¯)2
ρ
correlation, between −1 and +1
xₜ, yₜ
the two assets' returns in month t
x̄, ȳ
their average monthly returns over the window
N
number of months in the window

Equivalently, covariance divided by the product of the two standard deviations; the divisor of the covariance (N or N − 1) cancels.

Rolling correlation over a trailing window
ρt(W)=ρ(xt−W+1…xt,yt−W+1…yt)
ρₜ(W)
correlation over the W months ending in month t, plotted at month t
W
window length in months (36 by default)
Why it matters: volatility of a two-asset mix
σp2=w12σ12+w22σ22+2w1w2ρσ1σ2
σₚ
volatility of the mix
w₁, w₂
the two weights
σ₁, σ₂
the two assets' volatilities
ρ
their correlation

At ρ = 1 the mix's volatility is exactly w₁σ₁ + w₂σ₂; every lower ρ shrinks the last term and the volatility with it.

How noisy a window's correlation is (Fisher's z)
z=artanh(ρ^),SE(z)≈1W−3
ρ̂
correlation measured in a window
z
its Fisher transform, roughly normally distributed
SE(z)
standard error of z
W
number of months in the window

For a 36-month window the standard error of z is about 0.17, so a measured correlation of zero is consistent with a true value from about −0.33 to +0.33 at 95% confidence, before allowing for fat tails. Swings smaller than that between neighbouring windows can be noise.

Worked example

The S&P 500 (SPY) and long-term US Treasuries (TLT), monthly returns from Jun 1986 to Sep 2026, correlated over the whole window and over each of the 449 trailing 36-month windows.

Over the whole window the correlation was -0.02: judged by that one number, stocks and long Treasuries were unrelated.

The trailing windows tell another story. The 36-month correlation ranged from -0.79, in the window ending Jan 2013, to 0.69, in the window ending Oct 1992. It was positive in 40.8% of the windows and at 0.5 or above in 24.3% of them.

The sign flipped twice. Through the 1990s the trailing correlation was mostly positive. From 2000 it turned negative and, apart from a few months in 2009, stayed negative for about two decades: in sell-offs, investors bought Treasuries, and long bonds cushioned stock losses. In 2022, with inflation back and interest rates rising fast, both fell together and the correlation turned positive again; the latest reading is 0.49.

For a stocks-and-bonds portfolio, that separates 2008 and early 2020, when long Treasuries rose while stocks dropped, from 2022, when both dropped together. The full-window figure averages those regimes into a number that described neither.

Data through Sep 2026. Reproduce id 857316cf9019792f (this guide, its lab setup and the data month).

Interactive lab

The trailing 36-month correlation of the two picks' monthly returns, with the full-window correlation as a reference line. Switch either asset to see which pairs keep a stable relationship and which drift.

Rolling 36-month correlation: SPY and TLTPearson correlation of monthly returns over each trailing 36-month window, 449 windows, dated at the last month of the window; Jun 1986 to Sep 2026. Whole-window correlation -0.02; lowest -0.79 (window ending Jan 2013), highest 0.69 (window ending Oct 1992), latest 0.49.-0.60-0.40-0.200.000.200.400.601989199419992004200920142019202400.536-month correlation
Correlation of the two series' monthly returns over each trailing 36-month window. Dashed lines: 0 and 0.5. Jun 1986 to Sep 2026.
MeasureSPY and TLT
Correlation over the whole window-0.02
Trailing windows of 36 months449
Lowest 36-month correlation-0.79 (window ending Jan 2013)
Highest 36-month correlation0.69 (window ending Oct 1992)
Latest window0.49
Windows above 041%
Windows at or above 0.524%

Pearson correlation of monthly returns. Each window ends at the month shown and covers the 36 months up to and including it. Jun 1986 to Sep 2026.

How MarketHeist computes it

Every choice an implementation has to make, as the code makes it today. The page is checked against the code each time it is built.

ChoiceHow it is computedIn the code
DataMonthly total returns (dividends reinvested). Funds younger than the period shown are extended backward with older funds, spliced on returns, not prices.
WindowThe worked example and the lab use the common window of the two series, Jun 1986 to Sep 2026 (484 months), ending at the data month of this page; each rolling point uses the trailing window ending that month.
Portfolio streamsA fund is its proxy-extended monthly return stream. A built-in portfolio is read as the MarketHeist MCP reads it: its composed stream with its own rebalancing rule and overlay. A custom mix is rebalanced yearly.
Rolling correlationThe Pearson correlation of the two series' monthly returns over every trailing window of the chosen length, each point dated at the last month of its window; the full-window figure uses every month of the common window.
CorrelationPearson correlation: the sum of cross-products of deviations from each series' mean, divided by the square root of the product of the two sums of squared deviations. NaN when either series is constant or has fewer than two months.pearsonpackages/portfolio/engine/correlation.ts
Returns and windowMonthly total returns (dividends reinvested), over the months both assets have data, ending at the latest data month. Rolling values use every trailing window of the chosen length that fits, plotted at the window's last month.
Correlation heatmap in the appThe matrix of pairwise correlations of a portfolio's holdings over their full common window, with exactly 1 on the diagonal.correlationMatrixpackages/portfolio/engine/correlation.ts
Average correlation over time in the appThe portfolio app's over-time view averages the pairwise correlations of the holdings over trailing 36-month windows, computed from each window's covariance matrix.rollingRiskDecompositionpackages/portfolio/engine/risk.ts
Co-movement groupsHoldings whose clusters have an average cross correlation of at least 0.5 are treated as one group when counting independent bets.exposureOverlappackages/portfolio/engine/overlap.ts
BacktesterThe backtester's correlation matrix compares the position series of several backtests (whether they tend to be invested at the same times), not their returns.CorrelationModalapps/backtest/src/ui/CorrelationModal.tsx
Engine functionsThe functions the portfolio app and the MarketHeist MCP tools run, called here on the same monthly returns.pearsonpackages/portfolio/engine/correlation.ts

Correlation between assets compared with its neighbours

Correlation and related measures of co-movement
MeasureWhat it capturesScaleSensitive to outliers
Pearson correlationLinear co-movement of returns−1 to +1Yes
Rolling correlationThe same, over a trailing window−1 to +1Yes, and noisier
CovarianceCo-movement in units of return squaredUnboundedYes
BetaHow much one asset moves per unit of another's moveUnboundedYes
Rank (Spearman) correlationWhether the two rise and fall in the same order−1 to +1Less
Downside or tail correlationCo-movement in bad months only−1 to +1Built around them

Limitations

  • Correlation captures only linear co-movement. Two assets can be unrelated most of the time and crash together, which an average over all months understates.
  • A trailing window of a few years is a small sample. Neighbouring windows share most of their months, so a rolling line looks smoother and more certain than it is.
  • Measured correlations depend on frequency. Monthly correlations can differ from daily or quarterly ones, especially for assets that trade in different time zones or price with a lag.
  • Past correlation is not a forecast. The stock-bond relationship has changed sign more than once with the inflation regime, and diversification planned on one regime can fail in the next.
  • Long histories are extended backward with older funds or indexes where a fund is younger than the window, so early months approximate the fund rather than reproduce it.

Frequently asked questions

What is a good correlation for diversification?
Lower is more useful: anything below +1 reduces a mix's volatility, a correlation near zero reduces it substantially, and a negative one most. What matters is the correlation in the months when protection is needed, which can differ from the long-run average.
Why did stocks and bonds fall together in 2022?
Inflation rose sharply and central banks raised interest rates quickly. Higher rates lower bond prices directly and also lower the value of future company earnings, so both fell at once. When inflation is the main risk, the stock-bond correlation has tended to be positive; when growth scares dominate, negative.
What does a rolling correlation show?
The correlation measured over a fixed number of recent months, recomputed every month. It shows how the relationship has drifted, which a single full-period number hides, at the cost of more noise from the shorter sample.
What window length is used for rolling correlation?
MarketHeist uses 36 months by default, the same window as the portfolio app's risk-over-time view. Shorter windows react faster and are noisier; longer windows are steadier and slower to show a change.
Is correlation the same as causation?
No. Two assets can move together because a third force drives both, such as interest rates, or by coincidence in a short sample. Correlation measures co-movement, not why it happens.

References

  1. Pearson, K. (1895) Notes on Regression and Inheritance in the Case of Two Parents. Proceedings of the Royal Society of London 58. The product-moment correlation coefficient.
  2. Fisher, R. A. (1921) On the "Probable Error" of a Coefficient of Correlation Deduced from a Small Sample. Metron 1. The z-transform used to judge sampling error.
  3. Longin, F. and Solnik, B. (2001) Extreme Correlation of International Equity Markets. Journal of Finance 56(2). Correlation rises in bear markets, not in bull markets.
  4. Ilmanen, A. (2003) Stock-Bond Correlations. Journal of Fixed Income 13(2). How inflation and growth regimes drive the sign of the correlation.
  5. Campbell, J. Y., Sunderam, A. and Viceira, L. M. (2017) Inflation Bets or Deflation Hedges? The Changing Risks of Nominal Bonds. Critical Finance Review 6(2).

Try it on your own holdings

See how the 60/40 portfolio's stock-bond risk split moved over time →

Or ask an assistant connected to the MarketHeist MCP server (https://marketheist.io/mcp), which computes the same figures:

Using MarketHeist.io, show the correlation between SPY and TLT monthly returns over the full history and over rolling 36-month windows, and explain when and why it changed sign

Ask an AI assistant

The prompt opens in a new tab, already filled in. An assistant without the MarketHeist connector answers from its own knowledge, not from the figures on this page.

Historical simulation, not advice. Computed by the MarketHeist portfolio engine from monthly total returns, data through Sep 2026. Markdown version of this page: correlation.md.