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, and how far off could that be? 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, and each would look different at the pantry. A trend is a steady drift up or down, like demand growing as more families hear about the pantry. A seasonal pattern is a regular within-year cycle, like a spike every December. A cycle is a longer, multi-year swing tied to the economy, like demand rising through a recession and easing after it. Random variation is noise around a stable level: demand hovering near 28 (hundred) meals, a little up one month and a little down the next. The method you choose depends on which of these you see. Plain moving averages and exponential smoothing are built for that last case, flat-plus-noise, which is exactly why they will lag on the pantry’s actual data: 22 climbing to 35 in eight months is a trend. 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 month as the average of the last k actual values; each month it drops the oldest value and takes in the newest. The pantry’s 3-month average uses the last three actuals, 27, 32 and 35: \((27+32+35)/3 = 31.3\). The 5-month average reaches two months further back: \((28+30+27+32+35)/5 = 30.4\). On rising demand the 5-month forecast (30.4) lands lower and smoother than the 3-month (31.3), because the wider window keeps dragging in older, smaller months, here the 28 and 30 from months 4 and 5.

“Moving” refers to the history window, not to averaging forecasts. Follow one shift before jumping to month 9:

Forecast being made Actuals available in its 3-month window Arithmetic Forecast
Month 4 Months 1–3: 22, 25, 24 \((22+25+24)/3\) 23.67
Month 5 Months 2–4: 25, 24, 28 \((25+24+28)/3\) 25.67
Month 9 Months 6–8: 27, 32, 35 \((27+32+35)/3\) 31.33

The second row drops 22 and adds the newly observed 28. Month 5’s actual value is not yet known when its forecast is made. This timing rule applies to every forecast column you build.

That is the trade the window makes. A wider window smooths more noise: a month that runs 6 (hundred) above normal lifts a 5-month average by 1.2 but a 3-month average by 2. The same averaging makes it slower to follow a real change, and the rule of thumb fits in one line: a longer window reacts more slowly. Drag the window slider and watch the dashed orange forecast line and the dot where it ends, the forecast for month 9: at k = 2 the line follows the data closely and ends at 33.5; at k = 5 it runs flatter and lower and ends at 30.4. The readout also scores each window with a MAD, which is the next skill; leave that number for now.

Build the skill 3: is the forecast any good? (MAD)

To evaluate the method, pretend you are standing just before each past month. Forecast with only the history available then; compare with the actual value afterward. For month 4, the 3-month forecast was 23.67 and demand was 28, so it came in low by \(28-23.67=4.33\) hundred meals.

A forecast error is actual minus forecast, \(e_t=A_t-F_t\). Positive means the forecast was too low; negative means it was too high. To measure typical miss size, take each error’s absolute value and average those sizes. That is mean absolute deviation (MAD):

\(\text{MAD}=\frac{1}{n}\sum |A_t-F_t|\).

Here \(n\) counts the months being scored, not the moving-average window \(k\). A smaller MAD means smaller past misses on the same evaluation months. Here are the 2-month and 3-month windows over months 4 to 8, the months both can forecast (a 3-month window needs three months of history, so its first forecast is month 4):

Month Actual 2-month forecast Error 3-month forecast Error
4 28 24.5 3.5 23.67 4.33
5 30 26.0 4.0 25.67 4.33
6 27 29.0 −2.0 27.33 −0.33
7 32 28.5 3.5 28.33 3.67
8 35 29.5 5.5 29.67 5.33
MAD     3.70   3.60

Drop the signs, add the five sizes and divide by \(n = 5\): the 3-month window has missed by 3.60 (hundred meals) on average and the 2-month window by 3.70, so the 3-month window wins, narrowly. Set the slider above to 2 and then to 3, and the readout, scored over months 4 to 8, says the same.

That verdict is fair because both windows are graded on the same five months. Score each from its own first forecast and the 2-month window is also graded on month 3, an easy miss of 0.5 (it forecast 23.5 and 24 arrived) that the 3-month window never faced; its MAD drops to 3.17 and it looks like the winner. That is why the widget scores every window from month 4 and names the months it scored. A window of 4 or more has no forecast for month 4, so its readout starts later; compare the two over the wider window’s months (over months 6 to 8, 3.11 against the 5-month window’s 4.40) and the 3-month window still wins, as it does against every width on the slider. There is no formula for the best k: you try a few windows and let MAD, scored over the same months, 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 large misses harder, and the two measures can disagree: on the table above MSE prefers the 2-month window, 14.95 against 15.91, because squaring magnifies the 3-month window’s two misses of 4.33, in months 4 and 5. Pick the measure before you score. This course referees with MAD, which stays in the data’s own units (hundreds of meals); MSE is in squared units.

Now read the signs. Four of the 3-month window’s five errors are positive: on a rising series it keeps averaging older, lower months, so it comes in low. Add the signed errors and they do not cancel: they sum to \(+17.3\), the cumulative error, where a forecast that missed both ways about equally would sit near 0. That lag is the moving average’s weakness. Session 2 tries weighting the recent months more heavily, and Week 15 fits the climb itself.

In practice: forecasts are only as good as the past they assume

  • Trends and seasonality. A plain moving average ignores both. If the pantry’s demand keeps climbing, or spikes every December, you need a trend or seasonal method, not just a longer window.
  • Outliers. One freak month (a storm that closes the pantry for a week, a holiday rush) drags the average, and keeps dragging it for as many months as the window is long. 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. The pantry’s MAD of 3.6 is 360 meals a month, and whether that is a lot depends on how many meals it serves. The mean absolute percent deviation (MAPD) puts the misses on that scale: \(\text{MAPD} = \sum|\text{actual}-\text{forecast}| / \sum \text{actual}\). For the 3-month window over months 4 to 8 it is \(18/152 = 11.8\%\): the misses add up to about 12% of demand over those five months. A raw MAD with no scale attached is close to meaningless.

Back to the puzzle

Use 31.3 hundred meals (about 3,130) as the baseline demand forecast, with a past MAD of 360 meals. The 3-month moving average forecasts \((27+32+35)/3 = 31.3\), and it earned the job fairly: over months 4 to 8 its MAD of 3.6 beat the 2-month window’s 3.7, and no other window on the slider beats it over the months both can forecast. That MAD describes past miss size: the 3-month average missed by 3.6 (hundred) meals on average. It is not a prediction interval, and it gives no probability that next month will fall within 3.6 of the forecast. Four of its five misses came in low on this rising series. Before placing an order, consider the cost of running short, spare storage, and whether growth is continuing. Those choices determine an ordering cushion; MAD alone does not.

In-class group practice (wrap-up)

To close Session 1, work a moving-average forecast by hand in your group: the forecasts, their MAD, and their cumulative error.

Write every member’s name on the sheet. You have 15 minutes for the practice, then two minutes to photograph your group’s own attempt before the solutions are shown. One member uploads the photo to Canvas by the end of class; participation credit is for attempting the work.

The instructor uses the final eight minutes to demonstrate the handout’s method, check the main results with units, and explain a common mistake. This demonstration closes the session.

Session 2: Wed, Nov 18 · Exponential smoothing (TBD)

🧩 Puzzle

Same pantry, same eight months: 22, 25, 24, 28, 30, 27, 32, 35. Monday’s 3-month average forecast 31.3 for next month by giving each of the last three months an equal third and ignoring everything older. But 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?

A plain moving average weights every month in its window equally: Monday’s forecast gave 27, 32 and 35 a third each. 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 pantry that is \(0.5(35) + 0.3(32) + 0.2(27) = 32.5\), pulled toward the newest month, 1.2 (hundred) above the plain average’s 31.3, without ignoring the older two. 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 keeps a running forecast and corrects it after each new actual arrives. It needs a first forecast to start from. Taylor’s convention, which the widget below also uses, is the first actual: the forecast for month 2 is month 1’s 22. Month 2 then brought 25, a miss of 3, so at \(\alpha = 0.3\) the forecast for month 3 moves three-tenths of the way: \(22 + 0.3(25 - 22) = 22.9\).

The general update follows the same calculation: \(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: each month the forecast moves the fraction \(\alpha\) of the way toward the actual it just missed. Big \(\alpha\) chases recent data; small \(\alpha\) stays smooth.

Repeat the update through month 8 and the forecast for month 9 is 30.2. Drag \(\alpha\) and watch the dashed orange line and the forecast for month 9; the readout scores MAD over months 4 to 8, the same months as Monday’s table:

Keep the timing explicit as the update repeats. All values below are in hundreds of meals.

Actual just observed Forecast for that month Error just learned Next forecast at \(\alpha=0.3\)
Month 2: 25 22.00 \(25-22=3\) Month 3: \(22+0.3(3)=22.90\)
Month 3: 24 22.90 \(24-22.9=1.10\) Month 4: \(22.9+0.3(1.1)=23.23\)
Month 4: 28 23.23 \(28-23.23=4.77\) Month 5: \(23.23+0.3(4.77)=24.661\)

Each next forecast becomes the old forecast on the following row. Keep full precision in the spreadsheet; round the displayed results only.

Why “exponential”? Unrolling the update shows the weight each past actual carries: the newest gets \(\alpha\), the one before it \(\alpha(1-\alpha)\), and the one \(j\) months before the newest \(\alpha(1-\alpha)^{j}\), 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, though he advises a larger \(\alpha\) when demand is trending. 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, scored fairly: here are Monday’s 3-month average and two smoothing constants, all scored over months 4 to 8, the months the moving average can forecast. You can check every row by hand with the formulas above, or on the two widgets:

Method Forecast for month 9 MAD, months 4–8
3-month moving average 31.3 3.60
Exponential smoothing, α = 0.3 30.2 4.64
Exponential smoothing, α = 0.5 32.4 3.82

Monday’s 3-month average keeps the smallest MAD, 3.60, with \(\alpha = 0.5\) close behind at 3.82 and \(\alpha = 0.3\) last at 4.64. The low constant smooths too hard for a climbing series: at \(\alpha = 0.3\) the last three months carry only 0.657 of the weight (\(0.30 + 0.21 + 0.147\)), the other third sits on months 1 to 5, which averaged just 25.8, and the forecast lands at 30.2, below even the 3-month average. At \(\alpha = 0.5\) the last three months carry 0.875 (\(0.5 + 0.25 + 0.125\)) and the forecast rises to 32.4, as Taylor’s advice predicts.

Keep sliding and MAD keeps falling, past the 3-month average’s at 0.7 (3.58) and down to 3.46 at 0.9, the lowest on the slider. That makes \(\alpha = 0.9\) another candidate, but the lowest error on these same five months is not enough to establish its future accuracy. At 0.9 the forecast is nine-tenths last month’s actual, so it has nearly stopped smoothing, and it benefits here because the pantry’s demand rose in five of its seven month-to-month steps: when each month tends to top the last, the forecast that leans hardest on the newest month misses least. The referee is rewarding the trend, not the smoothing, and a constant that high would chase every noisy month once the climb stopped. Notice, too, that all three forecasts sit below the latest actual, 35, as they sat below the actual in most past months; the next section measures that lean.

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. Monday’s cumulative error summed the signed errors, \(E=\sum e_t\); Taylor divides it by the number of periods to get the average error (bias), \(\bar E=E/n\). Near 0, the misses mostly cancel; a large positive value means the forecast is consistently too low, a large negative one that it is consistently too high. At \(\alpha = 0.3\) all five of the pantry’s misses over months 4 to 8 are positive, from 0.74 in month 6 to 6.86 in month 8, so \(E = 23.2\) and \(\bar E = 23.2/5 = 4.64\), exactly its MAD: MAD says “off by about 4.6 a month,” and bias adds “always too low.” The other two rows lean the same way, with four positive misses out of five and average errors of 3.47 (the 3-month average) and 3.45 (\(\alpha = 0.5\)), not far below their MADs. Report both measures.
  • A point forecast is not an ordering guarantee. Report its past MAD as a measure of miss size. A probability interval or a safety-stock decision needs additional assumptions and costs.
  • Garbage in, garbage out. If the pantry logs meals served rather than meals requested, a month it ran out records less than the real demand, and smoothing that 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, which is what the pantry’s positive errors are saying. Two of Taylor’s fixes, both in Week 15: adjusted (trend-adjusted) exponential smoothing adds a second factor \(\beta\) that tracks the trend, and a linear trend line is fitted straight through the data instead of smoothing it.
  • No history at all. Every time-series method assumes the past repeats. If the pantry opened a second site across town, that site would have no history to smooth, so you would turn to qualitative methods instead: a Delphi survey of people who know the neighborhood, or the pantry’s own managers as a jury of executive opinion.

Back to the puzzle

One constant does it. Exponential smoothing gives last month the most weight and every older month a smaller share that never reaches zero, so nothing is thrown away. At \(\alpha = 0.5\) last month carries half the weight, the month before a quarter and the one before that an eighth, and the pantry’s forecast for month 9 is 32.4 (hundred) meals, with a MAD of 3.82 over months 4 to 8. Of the two constants it is the one to use; \(\alpha = 0.3\) smooths too hard and trails even Monday’s average (30.2, MAD 4.64).

Among the three settings in our comparison table, the 3-month average has the smallest MAD, 3.60. Higher smoothing constants did better on these five months, so test them on additional months before choosing a long-term rule. For the three-setting comparison, start from a demand forecast of 31.3 hundred meals, with a past MAD of 360 meals. What Wednesday adds is proof that the lag is not one window’s quirk: all three average errors are positive and close to their MADs, so all three methods have tended to underforecast. Set an ordering cushion using the shortage and storage costs, rather than treating MAD as a guaranteed range. No window or \(\alpha\) removes that lean; Week 15 fits the trend itself.

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 a small MAD can hide a forecast that leans 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.