Skip to content
Noether Analytics

Forecast first, then optimize: a worked example

A forecast does not tell you what to do. This example shows the step from one to the other with the smallest model that still makes the point: how much of one product to order for one selling period.

The setting

A product is bought at 30 per unit and sold at 100. Whatever is left at the end of the period is cleared at 10. The order has to be placed before demand is known.

The forecast says demand will be about 940 units. Most plans stop here and order 940.

What the single number leaves out

The model behind the forecast also knows how uncertain it is. Suppose its range is roughly symmetric around 940 with a standard deviation of 150 units. Demand will then be below 940 about half the time and above it the other half.

Now compare the two ways of being wrong.

  • One unit too many costs 20: it was bought at 30 and cleared at 10.
  • One unit too few costs 70: the margin of 100 minus 30 that was not earned.

Running short is three and a half times as expensive as having a unit left over. An order of 940 runs short in half of all periods. That cannot be the best choice.

The decision as a model

The decision is one number, the order quantity Q. The objective is expected profit over all the demand levels the forecast considers possible. There are no constraints in this small version.

Raising Q by one unit earns 70 if that unit sells and loses 20 if it does not. It pays to keep adding units as long as the chance of selling the next one, times 70, exceeds the chance of not selling it, times 20. The best quantity is reached when the probability that demand stays below Q equals

70 / (70 + 20) ≈ 0.78

So the order should cover demand in 78% of cases. For this forecast, that is 1,055 units.

What it is worth

Order 940Order 1,055
Probability of running short50%22%
Expected units sold880921
Expected units cleared60134
Expected profit60,41461,780

The larger order earns about 1,370 more per period on average, a gain of 2.3%, from the same forecast. Nothing about the prediction improved. The gain comes from using the range and the costs instead of the middle value alone.

What changes in real projects

Three things change, and the logic stays.

The forecast range is rarely a tidy symmetric curve. For parts that sell twice a year it looks nothing like one, which is why we want the whole distribution from the model and not a mean with a standard deviation.

There are many products and they compete for the same budget, warehouse space and production time. Those limits are constraints, and with them the problem can no longer be solved product by product with a formula. It needs an optimization model.

The costs of being wrong are seldom as clear as 70 and 20. What does a missed delivery cost when the customer is on a framework contract? Agreeing those numbers with the people who know the business is part of the work, and often the most useful part.

All writing