AI for Data Analysis & Decision MakingStatistical traps, experiments and forecasting · Lesson 14 of 16
Forecasting with AI: useful, with caveats
Video lecture
Forecasting with AI: useful, with caveats
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
Transcript of the narration, chapter by chapter.
0:00 Forecasting with caveats
We'll sell forty-two hundred units next month. It sounds like a fact. It's actually a forecast, built on assumptions that nobody wrote down. AI assistants can now produce forecasts in seconds, from trend lines to established time-series methods, complete with charts that look authoritative. In this lecture you'll learn what forecasting can and can't do, the main approaches, why every forecast must beat a simple baseline, how to use prediction intervals and scenarios, the caveats to state every time, and a backtest you can run yourself.
0:37 Why it matters
Why does this matter? Because forecasts drive stock, staffing, budgets and targets. A forecast presented as a single number hides uncertainty, and decisions made on false certainty either over-order or under-deliver. And every forecast assumes the future resembles the past in specific ways. If those assumptions break, because of a new competitor, a price change or a moving holiday, the forecast breaks with them. Knowing that isn't pessimism. It's professionalism.
1:07 Main approaches
Here are the main approaches, conceptually. Naive and seasonal naive: next period equals the last period, or the same period last year. Moving averages and exponential smoothing, which weight recent data more and can handle trend and seasonality. Classical time-series models like the ARIMA family. Regression with drivers, like price, marketing spend or holidays. And machine learning or foundation models for time series, which can capture complex patterns when there's enough data, but aren't automatically better.
1:40 Beat the baseline
Here's the key idea: always compare any sophisticated forecast against a simple baseline on held-out data. Seasonal naive, same week last year, is surprisingly hard to beat for many series. Think of it like a new route suggested by a navigation app. Before you trust it, you'd want to know it's actually faster than the route you already know. If a clever model doesn't beat seasonal naive in a backtest, it isn't adding value, and the simpler method wins.
2:14 Prediction intervals
Now prediction intervals. A range like likely between thirty-seven hundred and forty-eight hundred supports better decisions than a single number: how much safety stock to hold, what budget contingency to keep. But beware: intervals from many methods are too narrow, because they assume the model is right and conditions are stable. So check coverage in your backtest. If far fewer than eighty percent of actuals fell inside your eighty percent intervals, widen them, or treat them as a minimum estimate of uncertainty.
2:50 Caveats every time
And caveats to state every time. Structural breaks: new competitors, price changes, regulation or platform algorithm changes can make history a poor guide. Limited history: a year or two barely captures seasonality. Feedback effects: a sales target changes sales effort. Data issues: stock-outs make sales data understate demand. And horizon: accuracy usually deteriorates the further ahead you forecast. Moving holidays deserve special mention in our markets. Ramadan and Eid shift by roughly eleven days each year, which breaks same-week-last-year logic.
3:25 A good forecast prompt
How should you ask the AI? Using Python on three years of weekly sales, forecast the next twelve weeks. Hold out the last twelve weeks, fit on the rest, and compare at least two methods against a seasonal-naive baseline using mean absolute error. Account for Ramadan, Eid and Black Friday, and tell me how. Give eighty and ninety-five percent prediction intervals. And list the assumptions and the events that would invalidate the forecast. Backtest, baseline, known events, intervals, assumptions: five ingredients.
4:00 Example 1: KSA gift product
First example, a business case. 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 and misses that Ramadan shifted by about eleven days between years. After adding holiday calendar features and backtesting, the model beats seasonal naive modestly. The team orders to the upper part of the eighty percent interval for high-margin items and the middle for low-margin ones, a decision rule that uses the uncertainty instead of ignoring it. They also correct for last year's stock-out weeks.
4:41 Example 2: Karachi school supplies
Second example. A Karachi school-supplies wholesaler forecasts back-to-school demand. The first forecast misses that one year's school reopening moved by several weeks. The analyst adds a weeks to reopening feature, backtests against seasonal naive, and uses the upper part of the eighty percent interval for fast-moving items where stock-outs are costly. A scenario table, early, normal and late reopening, goes to purchasing, with a decision rule for each. Forecasting became a decision tool, not a number.
5:14 Watch me do it, part 1
Watch me run a backtest. I load weekly sales, set the frequency, and split: everything except the last twelve weeks for training, the last twelve for testing. The seasonal-naive forecast is simply the same week last year. Then I fit Holt-Winters exponential smoothing with additive trend and seasonality over fifty-two weeks, and forecast twelve weeks. I compute the mean absolute error for both. If Holt-Winters doesn't beat seasonal naive, I use the simpler method and say so.
5:47 Watch me do it, part 2
Then I check interval coverage. I ask for eighty percent intervals over the backtest period and count how many actual weeks fell inside. If only six of twelve did, the intervals are far too narrow, and I widen them before anyone uses them for stock decisions. Finally, I write the forecast up as scenarios with a decision rule, plus the list of assumptions and breakers, and I save the forecast so we can compare it with actuals later and learn from misses.
6:23 Using forecasts
And use forecasts in decisions properly. Pair them with scenarios, best, base and worst, and decision rules. Monitor forecast versus actual and update regularly. Record the forecast and its assumptions, so you learn from misses rather than rewriting history. And be especially cautious with AI-generated forecasts of market-wide or macroeconomic outcomes, which are far harder than forecasting your own operational series.
6:50 Measuring forecast quality
How do you measure forecasting quality over time? Track accuracy across many periods and items, not one headline number, because different products may need different methods. Keep a forecast log with the date, the method, the point forecast, the interval and the assumptions. Every month, compare with actuals, and ask whether misses came from bad assumptions, a structural break, or plain noise inside the interval. That habit improves your forecasts faster than any new model.
7:23 Common mistakes
Common mistakes. Presenting point forecasts without ranges. No baseline comparison. Ignoring moving holidays. Training on stock-out periods as if they showed true demand. Trusting intervals without checking coverage. And never comparing forecasts with what actually happened. Each of these is easy to prevent with the checks you've just seen, and each one, left unchecked, eventually reaches a decision-maker.
7:48 Recap and try this now
Recap. Forecasts assume the future resembles the past, so state the assumptions. Backtest on held-out data and always compare with a simple baseline like seasonal naive. Use prediction intervals and scenarios, and treat intervals as minimum uncertainty. Handle moving holidays, stock-outs and structural breaks, and monitor forecast versus actual. Try this now: forecast one of your time series with a twelve-period backtest, a seasonal-naive baseline, eighty percent intervals with a coverage check, and three written assumptions that would break it.
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.
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.