Prof. Polly

Data Analytics / Module 2 / Topic 8

Topic 8 · Marketing Decisions

Forecasting Demand

How much will we sell next month? Learn to read the pattern, make a simple forecast, and measure how far to trust it.

Tiggie the tiger cub, thinking
Your sales lineAnswer Tiggie to add a point
0 of 8
Meet Sprout & Stem. It is a small plant shop (made up for this guide). The owner orders plants a month ahead, so every order is a forecast. Order too few and customers leave empty-handed. Order too many and plants wilt on the shelf. Eight short stops.
STOP 1 OF 8

Demand is a time series

Before you forecast, look at the pattern.

The idea

Sales recorded month by month (or week by week) form a time series: numbers in time order. Two patterns show up again and again.

  • Trend: a long, slow drift up or down. Example: a growing shop sells a little more each month.
  • Seasonality: a pattern that repeats on a fixed schedule. Example: higher sales every December.

Try it: trend or season?

STOP 2 OF 8

Putting a number on a season

A seasonal index says how far a month usually runs above or below an average month.

The idea

Take a garden center whose sales swing with the seasons. An index of 1.4 for May means May usually runs 40 percent above an average month. An index of 0.8 for February means February usually runs 20 percent below.

Divide a month's sales by its index and the season is taken out. This is the basic idea behind the "seasonally adjusted" numbers you see in the news. You can forecast the adjusted numbers, then multiply by the index to put the season back.

Try it: move the index

Try it: take the season out

MonthPlants soldSeasonal indexSeason taken out
May2381.4?
February1320.8?
STOP 3 OF 8

The moving average

The simplest forecast: average the most recent months.

The idea

A forecast is a careful estimate of future values based on past patterns. A three-month moving average forecasts next month as the average of the last three months. Each month, the window slides forward by one.

Months 7, 8, 9 sold 185, 200, 214. Forecast for month 10 = (185 + 200 + 214) ÷ 3 = 199.7 plants. Month 10 actually sold 211.

Try it: slide the window

STOP 4 OF 8

Exponential smoothing

Also uses the past, but gives the newest month the most weight.

The idea

New forecast = α × (latest actual) + (1 − α) × (old forecast)

α (alpha) is a number between 0 and 1 that you choose. It sets how much the latest month counts.

Old forecast 190, actual sales 214, α = 0.3: (0.3 × 214) + (0.7 × 190) = 64.2 + 133 = 197.2 plants.

The forecast moved toward the new actual, but only part of the way.

Try it: change α

STOP 5 OF 8

How far off? MAPE

No forecast is exact, so always measure the error.

The idea

For each month, the absolute percentage error is the size of the miss divided by the actual sales. MAPE (mean absolute percentage error) is the average of those. Because it is a percentage, you can compare accuracy across products of very different sizes.

% miss = |actual − forecast| ÷ actual

Try it: tap each row

MonthForecastActual% miss
Tap each row to work out its % miss.

One caution

MAPE breaks down when sales are zero or close to zero, because you divide by a tiny number. A rare plant sells 2 in a month and the forecast was 5. The miss is only 3 plants, but the % miss is 150 percent.

STOP 6 OF 8

Which way do the misses lean?

MAPE shows the size of the misses, not their direction.

The idea

Also check whether the misses lean one way. If the forecast lands below actual month after month, the method is biased low, even when each miss is small. On a rising series, a plain moving average looks backward, so it tends to come in low.

Try it: count the misses

Actual sales3-month moving averageMiss (forecast below actual)
STOP 7 OF 8

Spot the mistake

Six quick cases. Four are common forecasting mistakes, and two are fine.

Try it: mistake or fine?

STOP 8 OF 8

Pick a method that fits

Look at the pattern first, then choose the tool.

The idea

  • Flat, steady demand: a moving average works well.
  • A clear trend: a plain moving average tends to lag behind. Give recent months more weight (a larger α), or use a method built to follow a trend.
  • A clear season: take the season out with an index, forecast, then put the season back.

What happened at Sprout & Stem

Method (months 4 to 12)MAPEForecast for month 13
3-month moving average8.5%221.7
Exponential smoothing, α = 0.312.3%212.5
Exponential smoothing, α = 0.76.2%227.4

Nice work. Your sales line is complete!

Now try the forecasting tool on Sprout & Stem's numbers, or on your own.

Compare a moving average and exponential smoothing on the same months. Change the settings and watch the forecast and the error move. The data are made up.

Settings

Moving average: months in the window

Exponential smoothing: α = 0.3

Data (one number per month)

Sprout & Stem, plants sold per month.

ActualMoving averageExponential smoothing

Moving average

Next month:
MAPE:

Exponential smoothing

Next month:
MAPE:

Do it in Excel

Type the months in A2 to A13 and Sprout & Stem's sales in B2 to B13 (row 1 holds the labels). Each step says what you should see, so you can check your work.

  1. Look first. Select B1 to B13 and choose Insert, Line. Sales climb with small dips: a trend.
  2. Moving average. In C5 type =AVERAGE(B2:B4), the forecast for month 4 from months 1 to 3. Copy it down to C14. C14, the forecast for month 13, shows about 221.7.
  3. Error. In D5 type =ABS(B5-C5)/B5 and copy it down to D13. Then =AVERAGE(D5:D13) gives the MAPE: about 8.5%.
  4. Direction. In all 9 months the forecast is below actual. =AVERAGE(B5:B13)-AVERAGE(C5:C13) returns about 16.6: the moving average runs about 16.6 plants low.
  5. Exponential smoothing. Type 0.3 in H1. In E3 type =B2 to start. In E4 type =$H$1*B3+(1-$H$1)*E3 and copy it down to E14. The forecast for month 13 is about 212.5.
  6. Compare over the same months. In F5 type =ABS(B5-E5)/B5, copy it down to F13, and average it: about 12.3%, worse than the moving average.
  7. Change α. Type 0.7 in H1. The MAPE falls to about 6.2% and the month 13 forecast rises to about 227.4. On a rising series, more weight on recent months helps the forecast keep up.

Try it yourself

1. A moving-average forecast

Sales for the last three months were 117, 124, and 136 units.

a) What is the three-month moving-average forecast for next month?

b) Next month, 140 units actually sold. What is the % miss? %

a) (117 + 124 + 136) ÷ 3 = 125.7 units.
b) |140 − 125.7| ÷ 140 = 10.2%. The forecast came in low because sales are rising.

2. An exponential-smoothing forecast

Last month's forecast was 46 units and actual sales were 57. Use α = 0.4. What is the new forecast?

(0.4 × 57) + (0.6 × 46) = 22.8 + 27.6 = 50.4 units. It moved toward the actual, but only part of the way.

3. Small misses, all one way

A forecast came in below actual sales in all eight months. Each miss was only 2 to 4 percent. Is this a good forecast?

Questions to discuss

  1. What is the difference between a trend and seasonality? Give a business example of each.
  2. Why should every forecast come with an error measure? What does MAPE tell a manager?
  3. When is MAPE a poor choice, and what could you use instead?
MAPE is a poor choice when sales are zero or close to zero, because dividing by a tiny number blows up the percentage. One option is the average size of the miss in units (the mean absolute error), which does not divide by the actual sales.

Practice quiz

Score: 0 of 10

An AI assistant can set up a forecast fast. You still supply the judgment: does the method fit the pattern, and is the math right? If your class has an AI policy, follow it.

It can help with

  • Drafting a moving-average or smoothing calculation
  • Computing MAPE and explaining what it means
  • Describing the trend and seasonality in a series

Always check

  • Recompute the forecast and the MAPE yourself
  • Check that the method fits the pattern and is not lagging a trend
  • Check that two methods are compared over the same months

Watch out for

  • MAPE breaks down when sales are near zero
  • A smooth-looking forecast can still be biased
  • AI can sound sure and still get arithmetic or cell references wrong

Prompts that help you learn

The best prompts make you do the thinking, with AI as a coach.

How to check any AI answer

  1. Compare it with a result you already know, such as the tool on this page.
  2. Test one number yourself with a calculator.
  3. Ask the AI to explain each step. If a step does not make sense, do not use it.
  4. If the AI and your own work disagree, find out why before you trust either one.

Check the AI: a challenge

Give an AI assistant Sprout & Stem's twelve months: 140, 154, 151, 160, 174, 188, 185, 200, 214, 211, 223, 231. Ask for the three-month moving-average forecast for month 13 and the MAPE over months 4 to 12. Then compare.

Forecast for month 13: about 221.7. MAPE over months 4 to 12: about 8.5%. If the AI got something else, find the step where it went wrong. A common slip is putting the month being forecast into its own average.
1 / 8