Skip to main content

14. Statistical Forecasting

Teaching rewrite — the Baseline model step. Original wording; illustrative numbers.

Introduction​

The baseline model does the bulk of the work in a good process (lesson 12). Statistical models come in two broad families — the split is a simplification, since one model can combine both:

FamilyLooks atExample question
Time seriesPast demand only (univariate) — level, trend, seasonality“What does the demand pattern say about next month?”
Predictive (causal)Demand drivers — prices, promotions, weather, events…“What happens to demand if we run a 20% promotion?”

This lesson covers:

  • Level, trend, seasonality and how time series models use them
  • How much history you need, and the risk of overfitting
  • Demand drivers — internal and external — and their pitfalls
  • Time series vs predictive: how to choose or combine
  • A 4-step model-building loop: visual analysis → selection → fitting → error analysis

14.1 Time series forecasting​

Demand components​

ComponentMeaningExample
LevelThe average around which demand fluctuates (a smoothed demand)“We sell about 10 books a day.”
TrendConsistent change in level per period — prefer additive (units/period) over multiplicative (growth %), which is risky to extrapolate“+100 units each month.”
SeasonalityHow demand is distributed within a recurring cycle (day, week, year); over a full cycle, seasonal effects net to zero“+30% in Q2, −20% in Q3, −10% in Q4.”

Planners like this decomposition because they can read how the model interprets history and why it forecasts what it does.

Worked example: building a forecast from components​

Level 1,000/month, trend +20/month, additive seasonal effects: Q1 0, Q2 +300, Q3 −200, Q4 −100 (they sum to 0 over the year).

Month aheadLevel + trendSeasonal effect (quarter)Forecast
+1 (Q2)1,000 + 20 = 1,020+3001,320
+4 (Q3)1,000 + 80 = 1,080−200880
+7 (Q4)1,000 + 140 = 1,140−1001,040

Worked example: simple exponential smoothing​

Exponential smoothing updates the level with each new observation: level = α × demand + (1 − α) × previous level. With α = 0.3 and starting level 100:

DemandNew level
1000.3×100 + 0.7×100 = 100.0
1200.3×120 + 0.7×100 = 106.0
900.3×90 + 0.7×106 = 101.2
1100.3×110 + 0.7×101.2 = 103.8

Higher α reacts faster; lower α smooths more. Trend and seasonal versions (Holt, Holt-Winters) add components the same way. ARIMA is the other classical family. Both can be tuned automatically.

How much history?​

  • Seasonal models need several cycles — roughly 3–5 — to separate seasonality from noise. For monthly seasonality, 3–4+ years.
  • Rules like “always use exactly three years” invite overfitting: the model treats random wiggles as trend or seasonality, looks great on history, and fails on the future.
Pro tip — don’t over-model

Many engines assume a seasonal product also has a trend. Often it doesn’t. A model too complex for the pattern overfits; with little history, a simple moving average often beats sophisticated models.


Checkpoint: time series​

Quiz

Checkpoint — section 14.1

1 / 4

A univariate model uses…

Pick an answer to see if you are right.


14.2 Predictive analytics and demand drivers​

Demand drivers (a.k.a. explanatory or exogenous variables) influence buying behaviour. Ice cream next Monday depends on the weather forecast, school holidays, a match, and whether the waffle truck is parked nearby.

DriverInternal / externalHistory available?Future known?Notes
PromotionsInternal✅Usually (medium term)Big impact; watch pre-/post-promo dips
EventsInternal✅✅Planned months ahead; often paired with promotions
MarketingInternal✅SometimesHard to link to specific products; lagged effect
PricingInternal✅Often unclearLittle variation in many B2C shops; B2B customer-specific prices; sensitive
ShortagesInternal✅Short termEssential for censoring (lesson 3)
HolidaysExternal✅✅Moving holidays (e.g. school breaks, Ramadan) complicate monthly buckets
WeatherExternal✅Only ~2 weeksVery short-term only
MacroeconomicsExternal✅Usually notUse leading indicators instead
CompetitionExternalRarelyRarelyHard to obtain

Notes by driver​

  • Promotions — model each promotion type separately or model the actual discounted price. Expect self-cannibalisation: customers wait for announced sales and buy less before/after. Rare events (e.g. once-a-year sales) give the model few examples. Promotions added at short notice can’t be forecast in time. Don’t manually clean promotions out of history — it’s slow and invites data hacking; use a tool that flags promotions or models uplift directly.
  • Pricing — announced price increases often cause a pre-buy spike then a dip; announcements can be modelled even when detailed future prices aren’t known. Without future prices, use the model for price scenarios.
  • Shortages — without them the model falls into the sales-forecasting vicious circle. With monthly buckets, a few stock-out days have unclear impact. Retailers may need to infer shortages from runs of zero sales.
  • Leading indicators — drivers that move before demand: building permits → construction demand; an order book of pre-orders → near-term demand.

Worked example: a leading indicator​

Building permits lead demand for window frames by about 6 months, and history suggests ~12 frames per permit. Permits issued this month: 850 → expected frame demand in six months ≈ 850 × 12 = 10,200.

Challenges​

ChallengeExample
Data gatheringKey data in spreadsheets; months of work to collect; weigh cost vs expected gain
Non-linear effectsIce cream rises with temperature — but not below zero sales when freezing, and drops when it’s too hot to go out
Cross effectsThis weekend’s barbecue demand depends on this and next weekend’s weather
Lagged effectsAdvertising today, purchase in two weeks

Checkpoint: demand drivers​

Quiz

Checkpoint — section 14.2

1 / 4

Why is weather useful only for short-term forecasts?

Pick an answer to see if you are right.


14.3 Time series vs predictive — and how to choose​

Time seriesPredictive
ComplexitySimple to set upNeeds advanced analytics
Scenario planningNoYes (“what if we run a promotion?”)
DataDemand history onlyDrivers — often hard to collect

There is no universal winner. Approach:

  1. Check data availability before debating models.
  2. Try several approaches and inputs; always compare with benchmarks (lesson 10) and your current engine.
  3. Select or combine — keep a clear winner; if several are close, averaging them often adds accuracy (at the cost of transparency).

Within the 5-step framework​

  • Objective — make sure you forecast the right level (lesson 5) and horizon (lesson 6) first. A great monthly-by-market model is wasted if logistics then flat-splits it into weeks and warehouses.
  • Data — bad data beats a good model every time. Forecast demand, not sales. Start with the data you have; add drivers later. Be wary of opaque, delayed, expensive third-party data.
  • Metrics — make sure success is measured with MAE + bias (value-weighted for wide price ranges), not MAPE. Projects fail when management’s metric isn’t aligned with business value.

The 4-step model-building loop​

flowchart LR
A[1. Visual data analysis] --> B[2. Model selection] --> C[3. Model fitting] --> D[4. Error analysis] --> A
  1. Visual data analysis — plot demand with prices, promotions, holidays; look for trend, seasonality, odd promotions, similarities across items.
  2. Model selection — pick a model that can capture what you saw (machine learning handles many interacting drivers better — next lesson).
  3. Model fitting — let an optimiser find parameters. Ask your software vendor which horizon and metric it optimises — and align them with yours.
  4. Error analysis — plot the biggest offenders. Usual root causes:
CauseFix
Wrong dataFix the root cause at the source — don’t hand-smooth outliers
Missing driver (e.g. an unmodelled price rise)Collect it and make sure the model can use it
Badly tuned optimisationWatch for overfitting (inventing seasonality that isn’t there) and underfitting (missing real seasonality)

Rank: model building​

Quiz

Model building

1 / 2

Rank the 4-step model loop.

OrderDrag the handle to rearrange — top should be first.

  1. 1Error analysis
  2. 2Visual data analysis
  3. 3Model selection
  4. 4Model fitting

Drag items into the correct order (or use ↑↓), then check.


Check: statistical forecasting​

Quiz

Statistical forecasting

1 / 5

Over a full seasonal cycle, additive seasonal effects should sum to…

Pick an answer to see if you are right.


Takeaways​

Remember
  • Time series models decompose demand into level, trend, seasonality — easy to set up and read
  • Prefer additive trends; need several cycles for seasonality; beware overfitting; simple often wins
  • Predictive models use drivers: promotions, events, pricing, shortages, holidays, weather, leading indicators
  • Drivers bring data, non-linear, cross, and lagged challenges — and you need their future values
  • Check data, try several models, compare with benchmarks, select or combine
  • Build models in a loop: visualise → select → fit → analyse errors

Further Reading​