Risk and stochastic optimisation
A plan built on one forecast fails when the forecast is wrong. Stochastic optimisation finds the plan that still works across the futures that could happen.
- Free 30-minute call
- No commitment
- You own the code
In short: Stochastic optimisation plans with values you don’t know exactly, such as next month’s demand. Instead of one forecast, the model considers many ways the future could develop and how likely each one is. It finds the plan that does best on average across all of them, not just in the case you expect.
The problem
Next quarter’s plan assumes the forecast is right. Demand matches it, suppliers deliver on time and machines don’t break. Then, in week three, a supplier misses a delivery just as a demand spike arrives. The item sells out, and you miss a delivery date you promised a key customer. The plan was the best one possible, for a future that didn’t happen.
Why a plan for one future is fragile
Most plans are deterministic: they treat every number you type in as certain. The result is the best plan for one future, where every input turns out right. That world doesn’t exist. A plan that’s optimal there often fails as soon as things turn out a little different. If demand is a bit higher, the item sells out. One late shipment costs you a promised delivery date.
Why a safety buffer doesn’t fix it
The usual repair is a safety buffer, a little more stock than the plan needs. You size it by rule of thumb, often right after the last stockout, when the shelf ran empty. Then you add it to a plan built on the average forecast. That plan assumes demand is exactly average. And in exactly that case, a stockout never happens. Nobody can say how many stockouts the buffer prevents, or what it costs to hold.
What changes
Today, the plan follows the forecast and carries a buffer you guessed after the last stockout. With our model, the plan takes many possible futures into account at once. Each future has a probability, the chance that it happens. You set the service level you need, say on-time delivery in 95 of 100 weeks. The model finds the cheapest plan that reaches it. When the supplier misses its delivery in week three, the plan already says which other supplier or warehouse fills in.
Stochastic optimisation: risk built into the plan
Stochastic means “depending on chance”. Stochastic optimisation asks which decision is best across the futures that could happen. It treats uncertain numbers, such as demand and supplier lead times, as ranges with probabilities attached. Say demand next month is 800 units with a 25% chance, 1000 with 50% and 1200 with 25%. Stock is sized to how far demand swings. When a transport lane closes, the backup route is already in the plan. You see what extra safety costs, such as a second supplier on standby, before you commit.
What you get
We turn your forecast and disruption history into a set of possible futures. Then we choose the method that fits your data and how much risk you’re willing to carry. You see three things: the average cost across all possible futures, the service level the plan reaches and the least favourable case in which you can still deliver. We replay your past demand and disruption history through the plan before anything is committed.
- A model written around your own risk and stochastic optimisation rules.
- Results measured in the numbers you already track.
- It slots into how you already work, and you can check every answer it gives.
How it works
We write your resources, the work they have to cover and your rules into one model. You get a plan that says which resource does what and when. It’s the plan that fits your goals best, such as the lowest cost or the shortest waiting time. Every rule is kept at the same time, and that’s the part a spreadsheet can’t do.
Why the right order is rarely the forecast
A small example. You sell a seasonal item for 10 francs and buy it for 6. Leftovers are worthless after the season. Each unit you’re short costs you 4 francs of profit. Each unit left over costs you the 6 francs you paid. The classic answer is the newsvendor model, named after a news seller deciding each morning how many papers to buy. The model adds up both losses: 4 francs plus 6 francs makes 10. A missing unit accounts for 4 of those 10, which is 40 percent. So stock enough to cover demand in 40 of 100 cases. A leftover costs you more than a missed sale, so you stock on the lean side.
For a forecast that’s as likely to miss high as low, that’s less than the forecast itself. Raise the price to 20, and stock should cover demand in 70 of 100 cases. So you stock more than the forecast. The forecast tells you what’s likely. The costs on each side tell you how much to stock. A model that only sees the forecast never asks about those costs.
Two-stage stochastic programming
Two-stage stochastic programming means deciding some things now and adjusting the rest later. Programming here just means planning with a mathematical model. Some decisions come first: where to build capacity, how much stock to place early, which suppliers to sign. Others wait until demand and disruptions are revealed.
The model picks the first-stage choice with the best expected outcome. That’s the average result across all futures, each weighted by how likely it is. Say a plan costs 100 if things stay calm and 200 if a disruption hits. With a 70% chance of calm and 30% of disruption, its expected cost is 70% of 100 plus 30% of 200, which is 130. The model also counts what you can still correct in the second stage. Stock placed early at a site where it isn’t needed is expensive. So the model favours placements that let you send the right amount to the right place later.
Robust optimisation: planning for the worst case
Robust optimisation is for when you don’t have reliable probabilities. Instead, you set a range, for example: demand lies somewhere between 800 and 1200 units. This range is called the uncertainty set. Robust here means the plan stays workable for every value in that range, including the least favourable one. If the model plans capacity for 1200 units, you deliver even when demand lands at the top. If only 800 come, part of that capacity sits idle. So on average the plan costs a little more. In return, you know in advance that you can deliver as long as demand stays between 800 and 1200. That suits you when you have little data. It also suits you when you must never run short, such as a hospital that must not run out of beds.
Chance-constrained programming
Chance-constrained programming handles targets stated as probabilities. One example is the fill rate: the share of orders you ship straight from stock. Another is an on-time delivery target. A chance constraint is a rule that must be kept in at least a set share of futures, say 95 in 100. Keeping it in every single future is usually impossible. You set the service level, and the model finds the cheapest plan that hits it. You no longer guess a buffer after the last stockout.
Scenario trees
All of these need a description of possible futures. A scenario tree lays out how demand and supply might unfold, branch by branch. Say demand is high or low in month one, each with a 50% chance. Each branch splits again in month two. That gives four possible futures, each with a 25% chance. A well-built tree includes the combinations where plans with fixed numbers fail. One example is a demand spike and a supply delay in the same week.
Is the stochastic model worth it?
Birge and Louveaux wrote a standard textbook on stochastic programming. It offers a yardstick called the value of the stochastic solution. We take the plan built on the average forecast and run it through all the scenarios. Then we do the same with the stochastic plan. The difference in expected cost is what planning for uncertainty earns you. Say the average-forecast plan costs 130 on average across the scenarios and the stochastic plan costs 118. Then planning for uncertainty earns you 12. If the difference is small, the simple plan was fine, and we’ll tell you so.
Supply chain, manufacturing and energy
In the supply chain, demand is uncertain, suppliers miss deliveries and lanes close. A plan built on the average runs out of stock in the week it matters. A supply chain risk optimisation model plans for those weeks from the start. Our page on inventory optimisation shows how it sizes the stock. Manufacturing runs the same risk when a component arrives late just as demand jumps. Energy and utilities plan generation and maintenance against weather and demand they can’t pin down.
Common questions.
Something else? Ask us directly.
Stochastic programming needs probabilities. It finds the plan with the best average result across scenarios, each weighted by its likelihood. Robust optimisation needs only a range of possible values. Its plan stays workable for every value in that range, including the least favourable one. Trust your probabilities, and stochastic programming gives the cheaper plan. Doubt them, or fear the bad case, and robust optimisation is the safer pick.
There’s no fixed number. The standard method is called sample average approximation. We draw a number of scenarios at random and calculate the best plan for them. Then we draw a new, larger set of scenarios. We check whether the decisions you have to take now stay the same. Once they stop changing, more scenarios only cost computing time. With too few scenarios, the plan is only good for those few cases.
From three places. Your past forecasts show how far actual demand usually was from the forecast. Your delivery records show how often suppliers and transports arrive late. Where data is missing, your own estimates help. For each uncertain figure, such as demand, you name three values: a low one, a likely one and a high one. If even that feels shaky, robust optimisation needs no probabilities at all, only the range.
Sometimes it can, and if that’s the case, we’ll tell you. Standard software is built for an average operation, though. Yours runs on its own rules: your contracts, your exceptions, the things you know by heart. A custom model writes those rules in, and that’s where the better plan comes from.
You don’t need either to start. We build the model from the data you’ve already got, even if it lives in three spreadsheets and one person’s head. You get a system you run yourself. We train your team until they no longer need us.
You see a first result with the prototype, before you commit to anything bigger. We start with a free 30-minute call about your operation and the model that would fit it. Then we build a working prototype and run it on your numbers.
Similar pages.
Terms on this page
Every abbreviation explained in plain words, in our article “Metrics and methods”.
Tell us what you’re planning.
In a free 30-minute call with a specialist, you find out whether optimisation can help.
- Free, no commitment
- You talk to a specialist directly
- A clear go or no-go