Quant500 Academy

7. Rolling windows: every metric has an expiry date

Level 5: Time series: why the past does not repeat itself the same way

A manager looks at a share's volatility, sees a number and sizes the position with it. The number is correctly computed. The decision can still be a bad one.

It all depends on how much history that number was computed over, and on whether that history resembles the present.

No historical figure is a law

The six previous modules of this level all converge on a single practical conclusion, which this last module makes explicit.

Financial data is not strictly stationary. Its mean, its variance, its correlation with other series and its cointegration hedge ratio can all shift over time:

That is why any statistic computed from historical data is, strictly speaking, an estimate valid for a particular window of history, not a universal law guaranteed for the future.

The rolling windows technique is the standard methodological answer to this limitation.

What exactly a rolling window is

The starting point is what is usually done and is worth ceasing to do: computing a single fixed number using the entire available history in one go.

It does not matter which number it is. It may be the historical volatility of a share, the correlation between two assets, the hedge ratio of a cointegrated pair or the Sharpe ratio of a strategy.

The rolling window technique consists of repeatedly recomputing that same statistic over a window of fixed length that shifts one period at a time:

The result is no longer a single number, but a new time series: the evolution of that statistic over time.

That derived series reveals something a single aggregate number hides completely. It shows whether the volatility, the correlation or the relationship between two assets has stayed reasonably stable, or whether it has instead been drifting substantially.

Choosing the length is choosing which error you prefer

The choice of window length involves a genuine trade-off between two kinds of error. There is no universally correct length, only one that is more appropriate depending on the objective.

A short window, say 20 or 30 days, reacts quickly to recent regime changes. But its estimate is noisy: being based on few observations, it is very sensitive to one or two extreme days that can distort the result disproportionately, the same problem of a large standard error with a small sample seen in the inferential statistics levels.

A long window, say 500 or 1,000 days, produces a more stable and less noisy estimate, precisely because it averages over more information. But it pays the price of becoming out of date:

Choosing the window is, at bottom, deciding how much short-term noise one is willing to tolerate in exchange for how much capacity to react to real changes one needs. It is a trade-off very similar in spirit to the sample size decisions you already saw when dealing with confidence intervals.

The arithmetic of two windows on the same share

A concrete numerical example illustrates the value of this technique compared with using a single number.

Suppose that the annualized volatility of a share computed with a 30-day rolling window is currently 15%, whereas the same metric computed with a 252-day window, a full year, stands at 22%, dragged upwards by an episode of turbulence that occurred several months ago and is now over.

A manager looking only at the 252-day figure would conclude, incorrectly for the present moment, that the position's current risk is substantially greater than it really appears to have been over the last few weeks.

That said, neither of the two windows is the only truth. They are two different lenses on the same asset, one more sensitive to the present and the other more representative of typical behavior over a full cycle.

And the comparison between the two, not just each one separately, is in itself useful information about whether the asset is currently in an unusual regime.

The correlation that vanishes when it is needed most

This same reasoning applies directly to the two central tools of this level.

The correlation between two assets used to justify diversification in the previous level is not a fixed number carved in stone.

Two assets with a historical correlation of 0.2 measured over five years may see that correlation shoot up to 0.8 within a short rolling window during a market crisis.

That is, precisely at the moment when the benefit of diversification was needed most, and when, perversely, it most tends to disappear. It is a well documented phenomenon known as correlation breakdown in crises.

The cointegrated pair comes with no guarantee either

The hedge ratio and the spread behavior of a cointegrated pair, the subject of the previous module, are not permanent guarantees either.

The fact that the spread was stationary and reverted consistently between 2019 and 2023 does not certify that it will go on behaving the same way in 2026.

The relationship must be checked again on recent data periodically. It must not be assumed indefinitely on the basis of a single historical study.

The lesson that closes the level

We come to the lesson that gives retrospective meaning to the level's own title.

No figure estimated from historical data — a mean, a volatility, a correlation, a Sharpe ratio computed on a ten-year backtest — should be treated as a fixed law of the market.

It should be treated as a snapshot of how that asset or that relationship behaved during a particular window of the past.

That snapshot is useful, often the best information available. But it carries an implicit condition: it is only as reliable as the assumption that the near future will resemble the recent past.

And that assumption is reasonable most of the time. It fails precisely at the moments — regime changes, crises, structural breaks — when it matters most that it should not fail.

Measuring continuously, with rolling windows, instead of trusting a number computed once and for all, is the statistical discipline that acknowledges that limitation instead of ignoring it.

The rest of Quant500

What you are learning, applied to the index every day:

The model portfolio, weekly in your inbox

Every Saturday, its week in one minute: how it went, the best and the worst, and which insiders bought with their own money. Plus, the day the model is rebuilt, which stocks come in and which go out. A simulation, not advice. At most one email a week, no ads, no account; one-click unsubscribe. Made by one person: Pol Gracia.

A model portfolio with simulated results, not a personalized recommendation. Your email is used for this only: privacy.

Behind the Academy and the rest of Quant500 there is one person: Pol Gracia Serrahima.