What is stochastic optimization?
Stochastic optimization is optimization that accounts for randomness. In business planning, the randomness sits in the inputs. Standard optimization treats demand, prices, travel times, and lead times as known values, usually the forecast. Stochastic optimization represents each uncertain input with a probability distribution or a set of scenarios. It then looks for the decision with the best expected result, or the best result in bad cases, across all of them. It is one of the methods behind prescriptive analytics.
The term has a second meaning in machine learning, where it describes search methods that use randomness to find a solution. The best known is stochastic gradient descent, which trains neural networks on small random batches of data instead of the full dataset at each step. In planning and operations, the term almost always carries the first meaning.
How stochastic optimization works
The most common business form is two-stage stochastic programming. First-stage decisions must be made before the uncertainty resolves, such as how much stock to order or how many trucks to contract. Second-stage decisions, called recourse, are made once the outcome is known, such as expediting an order, transferring stock, or buying capacity at spot prices. The model chooses the first-stage decisions that minimize their own cost plus the expected cost of recourse across hundreds or thousands of scenarios. Those scenarios are often generated by Monte Carlo simulation from forecast distributions. Risk-averse versions give the worst scenarios extra weight.
Stochastic optimization in practice
A credit union decides each week how much cash to load into each of its sixty automated teller machines (ATMs). Loading too little forces an unscheduled armored car visit and leaves members without cash. Loading too much leaves idle cash sitting in the machines. A deterministic plan loads each machine for its forecast withdrawals and comes up short whenever withdrawals are high. A stochastic model uses the full distribution of withdrawals at each machine, including paydays and holiday weekends. It sets loads and visit schedules that minimize expected total cost. Machines with volatile demand get a larger buffer, and steady ones carry less.
What to watch for
- Check that the scenarios include bad but plausible outcomes, since small variations around the forecast add little protection.
- Expect longer solve times than with deterministic models, which matters when plans must be refreshed daily.
- Ask how a vendor’s model prices the cost of being wrong in each direction, because those costs drive every recommendation.
- Explain recommendations in terms planners recognize, such as extra buffer for volatile items, or planners will override the plan back to the forecast.