AI for Data Analysis & Decision MakingStatistical traps, experiments and forecasting · Lesson 14 of 16

Forecasting with AI: useful, with caveats

Article · 11 min · 8 min lecture

Video lecture

Forecasting with AI: useful, with caveats

15 chapters · about 8 min · full transcript

Coming soon

Chapter 1 of 15

Forecasting with caveats

  • What forecasts can and can't do
  • Main approaches
  • Beat the baseline
  • Intervals and scenarios
  • A backtest

The narrated lecture is in production

Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.

Chapters

What forecasting can and cannot do

A forecast estimates future values based on past patterns and assumptions. AI assistants can quickly build forecasts, from simple trend lines to established time-series methods, and explain them. Forecasts are useful for planning stock, staffing, budgets and targets. But every forecast assumes the future resembles the past in specific ways, and it is only as good as those assumptions.

Common approaches (conceptually)

  • Naive and seasonal naive: next period equals the last period, or the same period last year. Surprisingly hard to beat for some series, and an essential baseline.
  • Moving averages and exponential smoothing: weight recent data more heavily; some variants handle trend and seasonality.
  • Classical time-series models such as ARIMA-family models: capture autocorrelation patterns.
  • Regression with drivers: relate the target to factors such as price, marketing spend or holidays.
  • Machine learning and foundation models for time series: can capture complex patterns when there is enough data; not automatically better.

Always compare any sophisticated forecast against a simple baseline. If it doesn't beat seasonal naive on held-out data, it isn't adding value.

How to ask for a forecast

Using Python on the attached weekly sales (3 years), forecast the next
12 weeks.
1. Hold out the last 12 weeks, fit on the rest, and compare at least
   two methods against a seasonal-naive baseline using mean absolute
   percentage error or mean absolute error.
2. Account for Ramadan and Eid timing (dates differ each year) and
   Black Friday; tell me how you handled them.
3. Give the forecast with 80% and 95% prediction intervals.
4. List the assumptions and the events that would invalidate the forecast.

Key ingredients: backtesting on held-out data, a baseline, handling of known events (including moving holidays), prediction intervals, and explicit assumptions.

Prediction intervals, not just point forecasts

A single number ("we'll sell 4,200 units") hides uncertainty. A range ("likely between 3,700 and 4,800; very likely between 3,400 and 5,100") supports better decisions: how much safety stock to hold, what budget contingency to keep. Be aware that intervals from many methods are often too narrow because they assume the model is correct and conditions are stable; treat them as a minimum estimate of uncertainty.

Caveats to state every time

  • Structural breaks: pandemics, new competitors, price changes, regulation or platform algorithm changes can make history a poor guide.
  • Limited history: a year or two of data barely captures seasonality.
  • Feedback effects: forecasts can change behavior (a sales target affects sales effort).
  • Data issues: stock-outs make sales data understate demand.
  • Horizon: accuracy usually deteriorates the further ahead you forecast.

Worked example: stock planning

An online retailer in Saudi Arabia forecasts demand for a gift product ahead of the holiday season. The AI's first forecast uses a simple trend, missing that Ramadan shifted by roughly eleven days between years. After adding holiday calendar features and backtesting, the model beats the seasonal-naive baseline modestly. The team orders to the upper part of the 80% interval for high-margin items and the middle for low-margin ones, a decision rule that uses the uncertainty rather than ignoring it. They also note last year's stock-out weeks, which understated demand, and adjust.

Using forecasts in decisions

  • Pair forecasts with scenarios (best, base, worst) and decision rules.
  • Monitor forecast vs actual and update regularly.
  • Record the forecast and its assumptions, so you can learn from misses rather than rewriting history.

Hands-on: always beat a seasonal-naive baseline

A minimal backtest you can ask the assistant to extend:

import pandas as pd
import numpy as np
from statsmodels.tsa.holtwinters import ExponentialSmoothing

y = pd.read_csv("weekly_sales.csv", parse_dates=["week"], index_col="week")["units"].asfreq("W-MON")
train, test = y[:-12], y[-12:]

naive = y.shift(52)[-12:]                                   # same week last year
ets = ExponentialSmoothing(train, trend="add", seasonal="add", seasonal_periods=52).fit()
ets_fc = ets.forecast(12)

mae = lambda a, f: float(np.mean(np.abs(a - f)))
print("seasonal naive MAE:", round(mae(test, naive), 1))
print("Holt-Winters MAE:  ", round(mae(test, ets_fc), 1))

If the model does not beat seasonal naive on held-out weeks, use the simpler method. Add holiday indicators (Ramadan, Eid, Black Friday or White Friday, school terms) as explicit features when the method supports them, because moving holidays break "same week last year" logic.

Prediction intervals in practice

Ask for 80% and 95% intervals and check their coverage in the backtest: roughly how many actual values fell inside? If far fewer than 80% landed inside the 80% interval, the intervals are too narrow and should be widened or treated as a minimum estimate of uncertainty.

Second worked example: a Karachi school-supplies wholesaler

A wholesaler forecasts demand for the back-to-school season. The first forecast, trained on two years of data, misses that one year's school reopening date moved by several weeks. The analyst adds a "weeks to school reopening" feature, backtests against seasonal naive, and uses the 80% interval's upper range for fast-moving items where stock-outs are costly. A scenario table (early, normal, late reopening) goes to the purchasing team with an explicit decision rule for each.

Going further

Measure forecast accuracy across many periods and items, not one headline number. Different products may need different methods. And remember that forecasting market-wide or macroeconomic outcomes is much harder than forecasting your own operational series; treat AI-generated macro predictions with particular caution.

Key takeaways

  • Forecasts assume the future resembles the past; state the assumptions.
  • Backtest on held-out data and always compare against a simple baseline such as seasonal naive.
  • Use prediction intervals and scenarios; intervals are often too narrow, so treat them as minimum uncertainty.
  • Handle known events (including moving holidays), stock-outs and structural breaks; monitor forecast vs actual.

Check your understanding

Quick questions to lock in the lesson. They don’t count towards your certificate.

  1. A sophisticated model does not beat seasonal naive on held-out data. What should you conclude?
  2. Why might past sales understate true demand?
  3. What is the main value of prediction intervals?

Put it into practice

Ask an AI assistant to forecast one of your time series with a held-out backtest, a seasonal-naive baseline and 80% intervals. Write down three assumptions that would break it.

Enrol for free to save your progress

Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.