Fin Maverick
Foundations VocabularyAccounting & ReportingEconomics & MacroQuant Methods & ProgrammingBusiness & Company AnalysisCorporate Finance & ValuationBehavioural Finance
Banking & Market InfrastructureFixed Income & RatesDerivatives & Structured ProductsPublic EquitiesTransactions & DealsPortfolio ConstructionFunds & AMCs
Private Markets & AlternativesRisk, Treasury & ControlAI & Digital FinanceStochastic Calculus & PricingWealth & Personal FinanceIndian Markets & RegulationProfessional Practice
CalculatorComparison
Frameworks
Explore Bootcamps
Equity ResearchPortfolio ManagementMutual Fund MasteryFinancial LiteracyInvestment Banking Analyst
Private Equity AnalystHedge Funds AnalystBreaking Into VCBreaking Into QuantsAI For Finance
Financial Analyst ProgramRisk Management ProgramPrivate Wealth ManagementDebt Capital MarketsDerivatives Foundation
Explore Internships
Equity Research InternMutual Fund Intern
Portfolio Management InternFinancial Literacy Intern
Explore Micro Courses

Equity Research6

Writing an Investment ThesisBuilding a Discounted Cash FlowReading an Annual Report FastReading a Sector Before a CompanySpotting Quality of Earnings Red FlagsBuilding a Revenue Forecast From Drivers

Portfolio Management3

Rebalancing: When, Why and What It CostsStrategic and Tactical Asset AllocationMeasuring Risk in a Portfolio

Mutual Fund Mastery3

Comparing Funds Without Being FooledHow a NAV Is Struck and Which Day You GetReading a Fund Factsheet Properly

Derivatives Unlocked4

Hedging a Real ExposureThe Greeks, PracticallyFutures, the Basis and What Moves ItReading an Option Payoff

AI For Finance2

Retrieval and Grounding for FinanceDocument Extraction in Finance

Breaking Into Quants4

Backtesting a StrategyHypothesis TestingCleaning Financial DataRegression for Finance

Breaking Into VC3

Sizing a MarketReading a Term Sheet as a FounderHow a Venture Round Actually Works

Financial Analyst Program4

Common Size and Trend AnalysisReading a Cash Flow StatementRatio Analysis That Says SomethingBuilding a Working Capital Schedule

Risk Management Program2

Credit Exposure and How It Is ReducedValue at Risk and What It Hides

Investment Banking Analyst3

Precedent Transactions and Why They DifferReading a Term Sheet StructurallyBuilding a Comparable Companies Table

Private Wealth Management3

Tax Aware Portfolio DecisionsBuilding a Client Risk ProfileGoal Based Planning Arithmetic

Debt Capital Markets3

Analysing an Issuer's CreditDuration and What It Does Not Tell YouBond Pricing and Yield Mechanics

Private Equity Analyst2

Fund Waterfalls and CarryThe LBO in Structure

Hedge Funds Analyst2

Short Selling MechanicsLong Short Mechanics
Courses
Explore Career Roadmaps
Investment Banking AnalystEquity Research AnalystVC AnalystPrivate Equity AnalystHedge Funds Analyst
Quant AnalystAI For FinanceFinancial Analyst ProgramPrivate Wealth ManagementDebt Capital Markets
Risk Management ProgramDerivatives FoundationPortfolio ManagementMutual Fund Mastery
PartnershipsShowdown
Log inSign up
Quantitative Methods, Financial Data & Programming
1Probability
Probability in FinanceRandom VariableProbability DistributionsThe Normal DistributionNormal Distribution ProbabilityThe Lognormal DistributionRandomness vs Uncertainty
2Statistics and Inference
Population and SampleMean, Median and ModePrecision and AccuracyVariable TypesVariance, Standard Deviation and…Dispersion MeasuresStatistical BiasEffect SizeHypothesis TestingThe Sampling DistributionSkewnessKurtosisCovarianceConfidence IntervalArithmetic Mean vs Geometric MeanStatistical Significance vs Economic…Confidence Interval vs Prediction IntervalHow to Summarise a…
3Correlation and Regression
RegressionCorrelation and CausationOrdinary Least SquaresInteraction TermsRegression CoefficientsRegression vs ClassificationHow to Build a…Spurious CorrelationRegression, Correlation and FitResidualsMulticollinearityAutocorrelation and Partial Autocorrelation
4Time Series
Time Series in FinanceSimple, Weighted and Exponential…Moving Average CalculatorPrice, Return and Level SeriesHow to Prepare Time-Series…LagFrequencySeasonalityTimestampsTrendStationarity and the Unit RootHeteroskedasticityLeadRolling WindowsDifferencing
5Simulation and Numerical Methods
SimulationMonte Carlo SimulationHow to Run a…Numerical MethodsIterationResampling and the BootstrapPseudorandom Numbers and the SeedConvergence and ToleranceNumerical Stability
6Optimisation
OptimisationLocal and Global OptimaConstraintsConvex OptimisationThe SolverLinear ProgrammingThe Objective FunctionConstraint ViolationThe Feasible SetLagrange MultipliersQuadratic Programming
7Modelling Practice
Linear, Logistic, Ridge and…Training, Validation and Test…The ModelModel ErrorDependent and Independent VariablesThe ROC Curve and AUCWhat a Model HoldsMSE, RMSE, MAE and MAPEPrecision and RecallCross Validation and RegularisationOverfitting and UnderfittingReturn Series MeasuresSimple, Compound and Log Return
8Backtesting and Research Integrity
BacktestingBacktest vs Live PerformanceHow to Document a…How to Prevent Backtest…Out-of-Sample TestingWalk-Forward AnalysisMultiple TestingP-HackingData Snooping
9Data Quality and Structure
Data QualityThe DatasetSelection and Survivorship BiasVersioned DatasetsData Structures in FinanceData CleaningMissing Data and Null ValuesStructured Data vs Unstructured DataMissing Data vs ZeroData Validation vs Data CleaningOutliersDuplicate Records
10Programming for Finance
Data PipelinesAPIs for Financial DataAPI vs CSV FileDatabases in FinancePython for FinanceJoinsSQL for FinanceThe Analysis Workflow
11Quantitative Research
Research DesignThe Data Generating ProcessReproducibilityPeer Review in Analytical WorkThe Research HypothesisRobustness and Sensitivity

Rolling Windows: Recomputing a Figure as Time Moves On

A rolling window recomputes a figure over the last fixed number of observations, then moves one step and does it again. A twelve month window over the Nakshatra unit's 72 months gives 61 readings, the first at December 2019, and its rolling spread runs from 2.0548 per cent to 6.9462 per cent. When the record changes, the first reading free of the old stretch arrives eleven months later.

Almost every figure anyone meets about a record over time is a rolling figure. The twelve month average, the three year volatility, the rolling correlation, the moving average drawn across a chart: all of them are the same manoeuvre. A length is fixed, something is computed over that many observations, the window slides along by one, and the computation runs again. The output is not a number. The output is a whole new series, one reading per position, and that new series has habits of its own that have nothing to do with the record it was computed from.

The habits of that new series are the subject here. A rolling figure arrives late by an amount that can be worked out exactly. A rolling figure moves when the record underneath it has not moved at all. And it is dated in a way that quietly changes what it is describing. None of that is a flaw in the arithmetic. The arithmetic behaves that way by construction. Knowing how it behaves is the difference between reading one of these lines and being led by it.

Everything below is worked on one invented record. The Nakshatra unit is a traded something with a price and nothing else decided about it. Its six year record holds 72 dated monthly changes. The earliest belongs to the month that closed on 31 January 2019 and the latest to the month that closed on 31 December 2024, and all of them run against an opening markA starting price fixed one period ahead of a record's earliest observation. No measurement is taken on that day at all. The figure is there purely so that observation number one has a level to be compared against. of Rs 100.00/- set on the final day of 2018. Taken together those 72 months carry a mean of 1.00 per cent and a spread of 5.00 per cent. The 72 months were written down rather than gathered, and they stand for no security and no market.

What is taken as already settled?

Three things, each built elsewhere and used here without being rebuilt.

  • The mean and the standard deviation. Those are the two figures being recomputed here. The spread throughout is always the standard deviation on the n denominatorDividing the summed squared distances by the number of observations rather than by that number less one. It is the choice that fits describing a complete set of figures rather than estimating from a sample of them. Covered separately., because a window of twelve months is a complete set of twelve months being described, not a sample of some larger thing.
  • The moving average. That is one particular thing computed over a rolling window, and how the three kinds of moving average differ, and how far behind the price each of them sits, is covered separately. The window itself is the subject, not the averages that can be put inside it.
  • The record's two stretches. Over its first three years the six year record's spread is 3.00 per cent. Over its last three it is 6.4031 per cent. Both stretches have a mean of exactly 1.00 per cent. That the change exists, and what one spread figure for the whole record costs, is covered separately. That change is taken as given, and a window is watched crossing it.

What is a rolling window, and what does recomputing over one produce?

Here is the whole manoeuvre in four steps. Fix a length. Take the last that many observations. Compute something over them. Move one step forward and do all of it again. Those four steps are the whole of it, and the manoeuvre is genuinely no more complicated.

The part that is not obvious is what comes out the other end. Recomputing over a rolling window does not produce a number, it produces a new series, with one reading for each position the window can occupy, and that new series has to be dated. The convention is to date each reading to the last month of the window that produced it, and once that convention is accepted, every difficulty below follows from it.

Think about a food stall outside one office building. A single week is too jumpy to tell the owner anything, so every Friday she writes down what the last twelve weeks took. The number she writes down on Friday is labelled with Friday's date. But eleven of the twelve weeks inside it are already over, and some of them are nearly three months over. The label says today. The contents are mostly history. Nobody is being dishonest and the arithmetic is correct; it is just that a figure dated to today can be almost entirely about a period that has finished.

ONE WINDOW, FOUR POSITIONS, FOUR READINGSThe window keeps its length of twelve months and its answer is dated to the month at its right hand edge.1Dec 20192.0548 per cent2Dec 20213.4359 per cent3Dec 20225.7319 per cent4Dec 20246.9462 per cent2345671234the rolling spread, per cent, one reading per month from Dec 2019Each dashed droplands under thewindow's lastmonth, never itsmiddle.Jan 2019Dec 2024
The same twelve month window sits in four places along the record and each position hands its answer down to the month at the window's right hand edge, which is why every reading describes a stretch that has largely finished.

The Nakshatra unit's record behaves the same way. The reading dated December 2022 in the picture above was computed from January 2022 through December 2022, so eleven of its twelve inputs are from months that were already in the past when it was published. A rolling figure is always a report about a stretch, wearing the date of the stretch's last day.

Breaking Into Quants Bootcamp — Fin Maverick

How many readings does a twelve month window give on 72 months?

Sixty one, and the first of them falls at December 2019. The count is worth doing slowly. The arithmetic is easy and the mistake is common.

January 2019 cannot carry a reading. Neither can February, and so on through November. A twelve month window needs twelve months, and for January 2019 there are no earlier months in the record at all. The first month that has eleven months in front of it inside the record is the twelfth month, December 2019. From there every remaining month carries a reading, right through to December 2024.

WHY 61 AND NOT 72One block for each month. A block carries a reading only if the eleven months before it are also in the record.JFMAMJJASOND20192020202120222023202411 shaded blocks61 blocks carrying a reading72months in the recordless12months in the windowplus1equals61readingsThe first of the 61 falls at Dec 2019 and the last at Dec 2024.
Eleven of the seventy two months have too little history in front of them to fill a twelve month window, which is what leaves sixty one months carrying a reading.

The count is the record length, less the window length, plus one: 72 less 12 plus 1 gives 61. The plus one catches people out, so check it on something small. On a record of five observations with a window of three, the readings fall at the third, fourth and fifth observations. Three readings, and 5 less 3 plus 1 is 3. The rule holds.

The consequence is worth taking seriously before a length is chosen. A long window on a short record leaves almost nothing to look at. A thirty six month window on this same record yields 37 readings instead of 61. A sixty month window yields 13. Seventy two yields exactly one. One reading is not a series at all. It is the whole record computed once. And the frequencyHow often a record records something: daily, weekly, monthly, yearly. Changing it changes how many observations a given stretch of calendar time contains, and a good deal else besides. Covered separately. of the record decides how much calendar time a window of twelve actually covers. Twelve on this monthly record is a year. Twelve on a daily record is under a fortnight.

Try it out

A record holds 120 monthly observations and a twenty four month rolling window is wanted. How many readings does it yield?

Breaking Into VC Bootcamp — Fin Maverick

What does the six year record's rolling spread actually do?

The rolling spread climbs, roughly, and wobbles the whole way. At December 2019 it reads 2.0548 per cent, the lowest of all 61 readings. At December 2021 it reads 3.4359 per cent. At December 2022, 5.7319 per cent. At December 2024 it reads 6.9462 per cent, the highest of all 61.

Now put those beside what the record's spread actually is. The record's spread takes two values and only two: 3.00 per cent for the first thirty six months, 6.4031 per cent for the last thirty six. Not one of the 61 rolling readings lands on either of those two numbers. Thirteen of them fall below 3.00 per cent, four rise above 6.4031 per cent, and the other forty four land somewhere between the two, including a long run through the middle where the record's spread is not anywhere near the middle at all.

THE ROLLING SPREAD NEVER SITS ON EITHER ACTUAL LEVEL61 readings, Dec 2019 to Dec 2024. The two flat levels are what the record's spread actually is in each stretch.2345673.006.4031Dec 2019 2.0548Dec 2021 3.4359Dec 2022 5.7319Dec 2024 6.9462Dec 2019Dec 2020Dec 2021Dec 2022Dec 2023Dec 2024Lowest reading 2.0548 per cent at Dec 2019Highest reading 6.9462 per cent at Dec 202413 readings sit below 3.00 per cent4 readings sit above 6.4031 per cent, and 44 sit between
Across its sixty one readings the rolling spread works its way up from 2.0548 per cent to 6.9462 per cent, and not once does it settle on either of the two values the record's spread actually takes.

Why does a correct calculation miss the correct answer sixty one times out of sixty one? Because twelve months is a small number of months. A spread computed from twelve figures is not the spread of the process that produced them; it is what those particular twelve happened to do. Roll the window on by one, drop the oldest month, add a new one, and the answer moves whether or not anything about the record changed. The wobble in that line is the window's own noise, not the record's news.

Notice also the shape of the climb. The climb is not a step. The record steps, at January 2022, from one spread to the other in a single month. The rolling line ramps upward across most of 2022 instead.

Try it out

The record's spread only ever takes the values 3.00 per cent and 6.4031 per cent, and yet the twelve month rolling spread reads anywhere from 2.0548 per cent to 6.9462 per cent and never lands on either. What is the best explanation?

Why does the rolling figure arrive late when the record changes?

Because a window that straddles a change point is computing over both stretches at once, and it goes on doing that until the change point has passed clean out of the back of the window.

Follow it month by month. The six year record's spread changes at January 2022. The reading dated December 2021 covers January to December 2021, all of it inside the calm stretch. The reading dated January 2022 covers February 2021 to January 2022: eleven calm months and one wide one. February 2022 gives ten and two. The mixture keeps shifting, one month at a time, and the reading keeps drifting upward as it does. The reading dated December 2022 is the first one that covers January to December 2022, twelve months all from the new stretch, with no trace of the old one left in it.

THE DELAY IS THE WINDOW LENGTH LESS ONEJan 2021 to Dec 2023. The record's spread changes at Jan 2022; a twelve month window is clear of the old stretch at Dec 2022.the record changes here, Jan 2022the first clear reading, Dec 2022spread 3.00 per centspread 6.4031 per centJan 2021Dec 2023ELEVEN MONTHSwholly in the calm stretch6 calm months and 6 wide oneswholly in the wide stretch12 month windowless 1 equals a delay of 11 months.3 month windowless 1 equals 2 months. A 24 month window gives 23.The subtraction does not change with the record, only with the window.
A window straddling January 2022 mixes the two stretches together, so no reading is free of the calmer one until December 2022, which sits exactly eleven months later.

The delay is the window length less one, eleven months here. That is arithmetic, not an observation about this particular record. A three month window would be clear of the change in two months. A twenty four month window would take twenty three. A thirty six month window on this record would not be clear of it until December 2024, the last month there is. Change the record and the number does not change; change the window and it does.

One sentence is worth carrying away. A rolling window is a lag in disguise. It looks like a smooth line describing now, and it is a report about a period that is mostly over, arriving a known number of months after the fact. How far behind a smoothed line sits, and why, is worked through in detail separately. The lateness is not a side effect. Lateness is what a window is.

Try it out

A record's behaviour changes in a particular month, and a six month rolling figure is being watched on it. How long before a reading exists that was computed entirely from the new behaviour?

Why does a rolling mean move when nothing underneath it moved?

The next point is the most useful of the lot, and most treatments of rolling figures stop before they reach it.

Take the six year record's average monthly change. Over the first three years it is exactly 1.00 per cent. Over the last three years it is exactly 1.00 per cent. Over all six it is exactly 1.00 per cent. The centre of this record does not move. Not a little; not at all. The record was built with a flat centre on purpose, so that anything the rolling mean does can only have come from the window.

Now compute the twelve month rolling mean over it. At December 2019 it reads 0.3333 per cent. At December 2021, 1.1667 per cent. At December 2024, minus 1.5000 per cent. Across all 61 readings the rolling mean ranges from minus 2.9167 per cent at November 2024 up to 3.0833 per cent at October 2022, a swing of exactly 6.0000 percentage points.

A FIGURE THAT MOVES SIX POINTS ON A CENTRE THAT NEVER MOVESThe dark line is the twelve month rolling mean. The flat red line is the record's actual mean, 1.00 per cent in both halves.minus 3minus 2minus 101231.00Dec 2019 0.3333Dec 2021 1.1667Oct 2022 3.0833Nov 2024 minus 2.9167Dec 2024 minus 1.5000Dec 2019Dec 2020Dec 2021Dec 2022Dec 2023Dec 2024Highest 3.0833 at Oct 2022. Lowest minus 2.9167 at Nov 2024. A swing of exactly 6.0000 points.The record's own mean over the same span: 1.00 per cent, then 1.00 per cent. It never moved once.
Twelve months averaged together swing across six percentage points while the quantity being averaged holds a mean of 1.00 per cent from the first month to the last.

Not one point of that six point swing is a change in the record. It is twelve months of scatter added up and divided by twelve, and that is all it is. In the second stretch the individual months have a spread of 6.4031 per cent, so a twelve month average of them carries scatter of its own of roughly 1.8484 per cent, that being 6.4031 taken over the square root of twelve. Two of those either side of 1.00 per cent covers roughly minus 2.70 per cent to 4.70 per cent, and every one of the observed readings is inside or barely outside that. The line is doing what a twelve month average of noisy months does.

A household version makes this concrete. A small shop's takings vary a lot week to week for reasons nobody controls: weather, a festival, a wedding down the road, a road being dug up. Take a twelve week average of them and it will rise and fall in long smooth waves. The waves look enormously meaningful. The waves are twelve weeks of weather, added up and divided by twelve. The shop is doing exactly what it was doing before.

Two things make this trap worse than it sounds. First, a rolling line looks convincing in a way a scatter of raw months does not: smooth things read as trends. Second, consecutive rolling readings share eleven of their twelve inputs, so they cannot help moving in gentle runs rather than jumping about. A rolling series manufactures the appearance of persistence out of nothing but overlap. The overlap is also why a memory measurement taken on a rolling series is not measuring the record, a point handled where autocorrelationA measure of how much a reading resembles the reading a fixed number of steps earlier in the same record. More than one recipe carries this name and they do not all give the same answer, so a quoted figure is only readable if the recipe is named beside it. Covered separately. is built.

Try it out

Both halves of the six year record carry a mean of exactly 1.00 per cent, and yet the twelve month rolling mean reaches minus 2.9167 per cent at November 2024. What is that movement made of?

AI For Finance Bootcamp — Fin Maverick

What do the two rolling series read on the same four dates?

One record, two rolling series, 61 readings each, computed the same way over the same twelve month blocks. Reading them side by side is the fastest way to see that they report two different kinds of thing.

The twelve month rolling spread and the twelve month rolling mean of the six year record, at four dated readings. Every value below was recomputed from the 72 monthly changes.
Reading datedWindow it coversRolling spreadRolling mean
December 2019Jan 2019 to Dec 20192.0548 per cent0.3333 per cent
December 2021Jan 2021 to Dec 20213.4359 per cent1.1667 per cent
December 2022Jan 2022 to Dec 20225.7319 per cent2.2500 per cent
December 2024Jan 2024 to Dec 20246.9462 per centminus 1.5000 per cent
Across all 61 readingsDec 2019 to Dec 20242.0548 to 6.9462minus 2.9167 to 3.0833

The two columns behave completely differently, and the record explains why. The rolling spread climbs because the record's spread genuinely changed, from 3.00 per cent to 6.4031 per cent at January 2022, so the climb is late and wobbly but it is reporting something real. The rolling mean swings because the record's mean did not change at all, so every point of its six point swing is the window's own noise. The same calculation, on the same record, over the same blocks of twelve months, and one of them is news while the other is not.

The difference is why the four items further below are worth writing beside any rolling figure. Nothing about the shape of a rolling line settles which of these two cases is in front of the reader. Only the record settles that, and only if somebody goes and asks it.

How is a window length chosen?

By deciding which of two errors is the better one to make. Both cannot be avoided.

A short window reacts quickly. A short window is also jumpy, and a jumpy line reports changes that are not there. Compute the rolling spread on this record over a three month window and, across the calm first stretch alone, where the spread is a flat 3.00 per cent throughout, the readings run from 0.4714 per cent to 3.3993 per cent. The high reading is more than seven times the low one, on a stretch where nothing whatsoever changed.

A long window is steady. A long window is also late, and a late line misses changes that are there. Compute the same rolling spread over a thirty six month window and it is beautifully behaved. Its lowest reading is exactly 3.0000 per cent and its highest is exactly 6.4031 per cent, precisely the record's two true values. But it only gives 37 readings, its first does not arrive until December 2021, and it does not become clear of the January 2022 change until December 2024, the last month in the record.

SHORT WINDOW, JUMPY. LONG WINDOW, LATE. NO LENGTH AVOIDS BOTH.The same 72 months and the same calculation in all three panels. Only the window length changes.05103monthwindow70 readingsfirst at Mar 2019clear at Mar 2022delay 2 monthsreads 0.4714 to 9.4634051012monthwindow61 readingsfirst at Dec 2019clear at Dec 2022delay 11 monthsreads 2.0548 to 6.9462051036monthwindow37 readingsfirst at Dec 2021clear at Dec 2024delay 35 monthsreads 3.0000 to 6.4031The dashed red levels are the record's two actual spreads. The dashed grey line is Jan 2022, where the record changes.
Shorten the window and the line jumps about reporting changes nobody made; lengthen it and the line steadies but shows up long after the event, with fewer readings either way.

There is no length that is both quick and steady, and choosing a window is choosing which of the two errors is tolerable. A shorter window if a real change would be expensive to miss and a false alarm is cheap to check. A longer window if the reverse. The choice and its reason belong in writing, before anything is computed.

And one honest addition that costs nothing to state. A window length chosen after looking at what each length produces is not a choice, it is a result. Where nine lengths are tried and the one whose line tells the tidiest story is kept, the line is now partly a picture of the searching. Searching does not make the line useless. It makes the search something to declare. Whoever reads the line should know how many lengths were tried.

Try it out

An answer is worth settling on first, then the panel underneath. The window widens from twelve months to twenty four. Will the rolling spread arrive at the new stretch sooner or later, and by how much?

Play with it

Change the window length and watch the count, the delay and the wobble all move together.

One control moves: the length of the window, from 3 months to 36. A rolling window does not edit anything, so nothing about the six year record changes at any setting. The top panel is the rolling spread with the record's two actual spreads drawn behind it as flat levels. The bottom panel is the rolling mean, with the record's actual mean of 1.00 per cent drawn behind it as a level that never moves at any point in the record. Watch the two panels disagree. As the window lengthens, the top line settles onto something true. Nothing was ever there for the bottom line to find, and it collapses towards a flat 1.00 per cent. The opening setting is a window of 12 months. That setting gives 61 readings running from 2.0548 per cent to 6.9462 per cent and a first clear reading at December 2022, eleven months after the record changed, and every one of those figures also stands as static text in the table above.

Jump to a length:
Readings
61
First reading
Dec 2019
First clear reading
Dec 2022
Delay
11 months
Rolling spread runs
2.0548 to 6.9462
Rolling mean swings
6.0000 points

Educational illustration. The Nakshatra unit's 72 dated monthly changes were written down rather than observed, so nothing in this panel stands for a security, a company, an index or a market. Changing the window length never changes the record. Whichever length is picked, all 72 monthly changes stay exactly as they were, and the one quantity altered is how many of them the calculation looks at. The change point at January 2022 is marked because it is a property of how this record was built, not because anything on this panel detected it.

Risk Management Program Bootcamp — Fin Maverick

What is the difference between a rolling window and an expanding one?

A rolling window keeps its length. Every time it moves forward it takes one new observation in at the front and drops the oldest one out of the back. An expanding window keeps everything: it starts at the beginning of the record and grows by one observation each step, so by the end it holds the lot.

On this record the two part company. Both are computing the spread. At December 2019 twelve months is everything there is, so the two agree exactly, at 2.0548 per cent. By December 2021 the rolling figure reads 3.4359 per cent and the expanding one reads exactly 3.0000 per cent, the true spread of everything so far. Then the record changes, and the two go different ways. At December 2024 the rolling figure reads 6.9462 per cent and the expanding one reads exactly 5.0000 per cent. Five per cent is the spread of the whole six years, and not the spread of anything the record is currently doing.

ONE KEEPS ITS LENGTH. THE OTHER KEEPS EVERYTHING.The same four dates, read two ways. Underneath, what each one reports as the spread.ROLLINGDec 2019Dec 2021Dec 2022Dec 2024EXPANDINGDec 2019Dec 2021Dec 2022Dec 202424686.4031Jan 2022rollingexpandingAt Dec 2024 the rolling figure reads 6.9462 and the expanding figure reads 5.0000,which is the whole record's spread. Over the last twelve months the rolling figuremoved 1.2435 points and the expanding figure moved 0.6583.
Keeping the window's length lets old months fall out of the back, while letting it grow keeps every month forever, so the growing figure hardens and stops reacting.

Each new observation is a smaller and smaller share of what an expanding figure holds, so the figure gets steadier and steadier and less and less able to notice anything new. Over the last twelve months of this record the rolling spread moved 1.2435 points while the expanding spread moved 0.6583. By the end, the expanding figure is understating the current stretch by 1.4031 percentage points and will keep understating it for years, quietly, without ever being wrong enough to look wrong.

Neither is right in general. An expanding figure is the honest one where the question is everything known so far and there is no reason to think the record has changed its behaviour. A rolling figure is the honest one where there is such a reason. The same word, the same units and the same chart shape can come out of either, so saying which of the two produced the number is never optional.

Try it out

Something changes in the last third of a long record. Which figure notices it, and why?

Futures, the Basis and What Moves It — free micro-course from Fin Maverick

What does an analyst state beside a rolling figure?

Four things, and none of them takes more than a line. The four turn the arithmetic into working practice, and the list is the same whether the reader is a credit analyst looking at a borrower's rolling revenue, a research team publishing a rolling volatility, or a household treasurer tracking a twelve month average of the electricity bill.

  1. The window length. Without it the figure cannot be reproduced, compared with anything, or interpreted. A rolling spread of 6.9462 per cent is a different statement at twelve months than at thirty six.
  2. Which end of the window it is dated to. Almost always the last observation. Every reading above is dated that way. Occasionally the middle, which is a perfectly ordinary way to describe history and a serious problem if the result is then treated as though it had been available on that date. That specific dating error is covered separately.
  3. How many readings the record produced. Sixty one is a series. Thirteen is a handful. One is not a rolling figure at all. Stating the count tells a reader immediately how much room there was for the line to have a shape.
  4. Whether the movement is bigger than the window's own noise. This is the one that does real work. Before a move in a rolling figure is called a change, the distance that figure travels on a stretch where nothing changes has to be worked out and compared. On this record it is one division: the second stretch's spread of 6.4031 per cent divided by the square root of twelve gives 1.8484 per cent, and a rolling mean that has wandered less than a couple of those has said nothing yet.

The fourth check costs one calculation and would have stopped the failure below. It is not a formal test but a rough size comparison, and it settles whether a movement is even in the range where a question is worth asking.

The report that a unit had turned, on a record that never turned

An analyst follows the Nakshatra unit's twelve month rolling mean. Through 2024 it falls, and by November it reads minus 2.9167 per cent. Having sat near 1.00 per cent for years and then run negative for months, it looks unmistakable. The analyst writes that the unit has turned.

Nothing turned. Both halves of the six year record carry a mean of exactly 1.00 per cent: 1.00 across the thirty six months to December 2021, and 1.00 across the thirty six after it. The centre of this record did not move in any month of it. A twelve month window moved, sitting over a stretch whose individual months have a spread of 6.4031 per cent, and a twelve month average of months like that swings between minus 2.9167 per cent and 3.0833 per cent with nothing underneath it changing at all.

The expensive part is not the mistake, it is that the mistake cannot be caught. An average of scattered months drifts back, so the reading will return towards 1.00 per cent on its own within a year. When it does, the drift back will read as the turn having reversed, and the original report will look as though it caught something real and early. A claim that cannot fail is not a strong claim, it is an unfalsifiable one, and a rolling line produces them steadily.

Treat the following as a working step rather than as a caution. The step is the fourth item on the list above. Before calling a movement in a rolling figure a change, work out how far that figure moves on a record where nothing changes, and compare the two. Had the analyst divided 6.4031 by the square root of twelve, the answer of 1.8484 per cent would have said, immediately, that a reading of minus 2.9167 per cent sits about two of those away from 1.00 per cent, roughly what noise does anyway.

Try it out

A rolling mean has fallen for four months in a row. What is the first thing to compute?

Try it out

A rolling volatility figure arrives with no window length attached. Which pair of things can now not be worked out?

Try it out

Why is a window length picked after seeing what each length produces not really a choice?

A rolling figure carries a window length or nothing. See what goes beside it.

What a rolling window covers, and what it does not

Settled above: what a rolling window is, how many readings it yields, how late it arrives, how much it moves on its own, how a length is chosen, and how it differs from an expanding window.

The moving averages themselves are one particular thing computed over a rolling window, and they are compared and built separately. The name for a spread that changes part way through a record, and the cost of quoting a single spread figure for the whole record, are covered separately. Setting a record beside an earlier copy of itself is covered separately. A computed column dated to a month in which it could not have been calculated is a different problem, a lookaheadLetting a calculation draw on something that had not happened by the date its answer is filed under. The sum itself comes out right; the date attached to it does not. Covered separately. error and is covered separately. A rolling window does not test whether a record wanders without returning to a level. That is a unit rootThe condition in which a level wanders freely rather than being tugged back towards any settled value, so that a single push into it never wears off. Covered separately. question, covered separately. A rolling window does not remove the repeating calendar pattern this record carries. Removing it is seasonal adjustmentTaking out the part of a record that recurs on the same calendar rhythm year after year, and keeping whatever did not recur. Covered separately. and is covered separately. Turning levels into changes, whether in rupees, in per cent or as a log differenceThe change from one observation to the next taken as the difference of their logarithms rather than as a percentage. A log difference adds up over time in a way that percentage changes do not. Covered separately., also covered separately.

A rolling line describes a stretch that has largely finished. It is not a procedure for reaching a decision, and reading somebody else's rolling line means telling what part of it is the record and what part of it is the window.

On sources

Sliding a fixed length window along a list and recomputing is arithmetic, and it behaves identically in any currency, any market and any century. Nothing about it is set by anybody. There is no permitted length, no prescribed frequency, no return anyone files and no product it applies to. No supervisor, marketplace or vendor holds a document that could sit beside it. Naming an authority here would lend borrowed weight to something that stands up perfectly well on its own, and the borrowed weight is the part a reader would remember instead of the arithmetic.

What might be expected in this positionWhat is actually here
A rule being restated, with whoever made the ruleNo rule. Counting how many twelve month blocks fit inside seventy two months is not anybody's regulation.
A live series, with the day somebody last looked at itNo series. Seventy two months composed for teaching were never current on any date, so there is no as of date to give.
An author whose idea this isNo author. Recomputing over a moving stretch is old, ordinary working practice and predates any one book about it, so the mechanism is stated and attributed to nobody.
A figure taken on trust from elsewhereNone. All 61 rolling readings, both of the record's spreads and every dated value quoted above were recomputed from the record itself.
Something that would have to be fetched to check the figuresNothing. Seventy two numbers and a way of adding them up is the entire equipment needed to doubt anything written here.

The Nakshatra unit and its six year record are invented.
Educational material. Not advice on any investment, tax, budget or market position.

← PreviousNext →
Fin Maverick Micro CoursesExplore Micro Courses
Fin Maverick BootcampsExplore Bootcamps
Fin Maverick

Finance education that ends in a job, not a certificate that gathers dust. Built for young India.

LEARN
CalculatorsFrameworksComparisonsCareersShowdown
RESOURCES
All CoursesMicro CoursesBootcampsInternships
COMPANY
AboutJob openingPartnership
LEGAL
Privacy PolicyTerms & ConditionsContent LicenseReturn & Refund Policy
© 2026 FIN MAVERICK / BUILT FOR INDIA.DO FINANCE, DO NOT JUST READ ABOUT IT.