Week 13: Forecasting I: Moving Average & Exponential Smoothing
This week’s big question: you have months of past data and need to predict what comes next. How do you turn a wiggly history into a sensible forecast, and how do you know whether your forecast is any good?
Before the week
- Read: Taylor, Introduction to Management Science (13e): Chapter 15, “Forecasting,” pp. 727–737 and 742–750 (focus: moving averages, exponential smoothing, and forecast accuracy / MAD). The chapter’s order is not ours, so skip forward over pp. 737–742; Week 15 comes back for them.
- Warm-up self-check, averages and reading a time series:
Session 1: Mon, Nov 16 · Moving averages (TBD)
🧩 Puzzle
The food pantry. Monthly meal demand (in hundreds) over the past eight months was 22, 25, 24, 28, 30, 27, 32, 35. What should the pantry order for next month? The history jumps around, so neither “last month” nor “the long-run average” feels right.
Build the skill 1: first, name the pattern (then pick the method)
Before reaching for a formula, look at the shape of the series. A time series can show four kinds of behavior: a trend (a steady drift up or down), a seasonal pattern (a regular within-year cycle, like a December spike), a longer cycle (multi-year ups and downs tied to the economy), and random variation (noise around a stable level). The method you choose depends on which of these you see. A coffee shop whose sales climb every month is trend; a stapler that sells about the same each week with random wiggle is random variation around a flat mean. Plain moving averages and exponential smoothing are built for that second case (flat-plus-noise) which is exactly why they will lag on the pantry data, where demand is clearly drifting upward. Keep that caveat in your pocket; it is the central lesson of the week.
The four shapes, side by side, learn to spot them at a glance before you reach for a method:
Build the skill 2: smooth the noise with a moving average
A moving average forecasts the next period as the average of the last k actual values. A bigger window k smooths out more noise but reacts more slowly to change. Drag the window slider and watch the forecast line (orange) track the data, and the next-month forecast at the end:
Worked example (campus bike-share). Monthly rentals (in hundreds) ran 42, 55, 48, 60, 52, 68, 61, 73, 70, 66 and you want next month. The 3-month average uses the last three actuals: \((73+70+66)/3 = 69.7\). The 5-month average uses the last five: \((68+61+73+70+66)/5 = 67.6\). On rising demand the 5-window forecast (67.6) lands lower and smoother than the 3-window (69.7), because the wider window keeps dragging in older, smaller months. That is the rule of thumb in one line: a longer window reacts more slowly.
Build the skill 3: is the forecast any good? (MAD)
A forecast you cannot grade is just a guess. The mean absolute deviation (MAD) averages how far each forecast missed the actual: \(\text{MAD} = \frac{1}{n}\sum |{\text{actual} - \text{forecast}}|\). Smaller is better. Slide the window above and watch MAD change. There is usually a k that balances “too jumpy” against “too sluggish.” There is no formula for the best k: you experiment with a few windows and let MAD pick the winner.
Taylor pairs MAD with mean squared error (MSE): \(\text{MSE}=\frac{1}{n}\sum(\text{actual}-\text{forecast})^2\). Squaring makes a miss of 10 count four times as much as a miss of 5, so MSE punishes occasional large misses more aggressively. Compare methods with the same measure on the same periods: the smaller MAD or MSE wins, but MAD stays in the data’s original units while MSE is in squared units.
Notice the forecast lags when the data trends upward (it is always averaging older, lower months). That lag is the moving average’s weakness, and the reason for exponential smoothing (Session 2) and trend models (Week 15).
In practice: forecasts are only as good as the past they assume
- Trends and seasonality. A plain moving average ignores both. If demand is climbing or has a December spike, you need a trend or seasonal method, not just a longer window.
- Outliers. One freak month (a storm, a holiday) drags the average. Ask whether a spike is signal or noise before you let it move your forecast.
- How much history? Too little is noisy; too much drowns out recent change. There is no universal “right” window, you tune it (and measure with MAD).
- MAD only makes sense next to the magnitude. A MAD of 6 is excellent when demand averages ~600 but terrible when it averages ~12. To compare across series, convert to a percent. The mean absolute percent deviation (MAPD). \(\text{MAPD} = \sum|\text{actual}-\text{forecast}| / \sum \text{actual}\), which is ~1% in the first case and ~50% in the second. A raw MAD with no scale attached is close to meaningless.
Back to the puzzle
A 3-month moving average forecasts about 31 (hundred) meals for next month (the last three actuals, 27, 32 and 35, average to \((27+32+35)/3 = 31.3\)). It is defensible and easy to explain, but it trails the upward trend, so the pantry might round up. Forecasting gives you a number and an honest error bar (MAD), which is more than a gut guess.
In-class group practice (wrap-up)
To close Session 1, compute a moving-average forecast by hand in your group. Write your group’s names on the sheet and hand it to your TA before you leave. It counts toward participation.
- Download: Week 13 group practice (Word)
Session 2: Wed, Nov 18 · Exponential smoothing (TBD)
🧩 Puzzle
The pantry’s demand is drifting upward, and last month’s number feels more relevant than one from half a year ago. How can a forecast weight recent months more heavily, without throwing away the older data entirely?
Build the skill 1: a weighted average is the missing link
A plain moving average weights every month in the window equally. Each of three months gets a third. But last month is usually more relevant than the one before. A weighted moving average fixes that by hand: put 50% on last month, 30% on the month before, 20% on the one before that. For the bike-share series the last month is 66, the one before it 70, and the one before that 73, so the weighted average is \(0.5(66) + 0.3(70) + 0.2(73) = 68.6\), pulled toward the recent month without ignoring the older ones. Choosing those weights by hand is fiddly, and it gets worse the more months you keep. Exponential smoothing replaces them: instead of three hand-picked weights, one number \(\alpha\) sets a whole fading schedule.
Build the skill 2: weight recent data with a smoothing constant
Exponential smoothing updates the forecast a little toward each new actual: \(F_{t} = F_{t-1} + \alpha\,(A_{t-1} - F_{t-1})\), where the smoothing constant \(\alpha\) (between 0 and 1) sets how fast it reacts. Big \(\alpha\) chases recent data; small \(\alpha\) stays smooth. Drag \(\alpha\) and watch:
Why “exponential”? Unrolling the update shows the weight on the data point k periods back is \(\alpha(1-\alpha)^{k}\), a geometric decay. At \(\alpha = 0.3\), last month gets weight 0.30, the month before 0.21, then 0.147, then 0.103, and so on. Every past month still counts, but its influence shrinks geometrically the older it gets. That is exactly the “recent matters more, old still matters a little” intuition, and it is why the word exponential is earned, not just asserted.
Build the skill 3: choosing α (responsive vs. stable) and the MAD referee
There is a trade-off: a large \(\alpha\) tracks turns quickly but jitters with noise; a small \(\alpha\) is calm but slow. Taylor notes the most commonly used values fall in the range 0.01 to 0.50, and the choice is judgmental. There is no closed-form “best” \(\alpha\) (the widget’s slider tops out at 0.9, an unusually aggressive setting). Use MAD as the referee. Here is an original head-to-head on a clearly rising help-desk ticket series (31, 34, 33, 30, 38, 42, 37, 40, 47, 44). You can verify every number by hand with the formulas above:
| Method | Next-period forecast | MAD |
|---|---|---|
| 3-period moving average | 43.7 | 4.00 |
| Exponential smoothing, α = 0.30 | 41.4 | 4.35 |
| Exponential smoothing, α = 0.50 | 43.5 | 3.68 |
Exponential smoothing with α = 0.50 wins. It has the smallest MAD (3.68), because the higher \(\alpha\) chases the climb harder. But notice all three still forecast below where the next value is heading: on rising demand every plain forecast lands a bit low. That sets up the diagnostic in the next section.
In practice: tuning isn’t the same as truth
- Don’t over-tune to noise. The \(\alpha\) that minimizes MAD on past data can be overfit; sanity-check it on a held-out month.
- MAD measures size, not direction. Use signed error for bias. Taylor first sums signed errors as cumulative error, \(E=\sum e_t\), then divides by the number of periods to obtain average error (bias), \(\bar E=E/n\). The scaling changes the size, not the diagnosis: a value near 0 means positive and negative misses mostly cancel, a large positive value means the forecast is consistently too low, and a large negative value means it is consistently too high. On the rising help-desk series, exponential smoothing accumulates positive errors, so MAD says “off by about 4 on average” while bias adds “and usually too low.” Report both.
- A forecast is a point on a distribution. Report it with its error (MAD), and remember surprises happen.
- Garbage in, garbage out. Smoothing a biased or mismeasured series gives a smooth wrong answer.
Looking ahead: when simple smoothing is the wrong tool
- Trends. Simple exponential smoothing has no trend term, so it always lags a rising series. Two of Taylor’s fixes: adjusted (trend-adjusted) exponential smoothing adds a second factor \(\beta\) that tracks the trend, and (the route Week 15 takes) you fit a linear trend line straight through the data instead of smoothing it.
- No history at all. Every time-series method assumes the past repeats. For a brand-new product with no sales history there is nothing to smooth, so you turn to qualitative methods instead, asking experts through a Delphi survey or a jury of executive opinion.
Back to the puzzle
With \(\alpha \approx 0.3\), exponential smoothing forecasts about 30 (hundred) meals and reacts to the recent climb faster than a long moving average. The pantry now has a transparent, tunable forecast, and a number for how often it has been wrong, plus a sign on that error telling it which way it tends to miss.
After-class check
Questions spanning moving averages, exponential smoothing, the smoothing constant, and forecast error (MAD, MAPD, and cumulative error). Retry freely; nothing is submitted.
Weekly take-home (graded: submit on Canvas)
Everything for this take-home lives in one Excel workbook, and this week you make the modeling choices. A counseling center needs a week-9 forecast; nobody tells you how long a moving average to use, how heavily to weight recent weeks, or which weeks to score the two methods over. You choose all three in the Your model block and then have to stay consistent with them. Three of the eight weeks arrive on the wrong basis and have to be put right first. You then build both forecast columns, measure the error three ways, and discover that the method with the smaller average error is the one leaning consistently in one direction. One short response plus the required AI-use disclosure go on the Free responses sheet. Upload the completed .xlsx on Canvas. That one file is your entire submission.