Optimisation Under Uncertainty: Stochastic Programming for Budget Allocation and Pricing Strategy
Most business decisions are made under uncertainty. You do not know future demand, competitor behaviour, customer response or exact costs in advance. But you still need to allocate budgets, set prices and plan resources. In this article, I explain how I use stochastic optimisation to model and optimise decisions in the presence of randomness, with practical applications to ad spend allocation, dynamic pricing and performance bidding systems.
Introduction: Decisions Under Uncertainty
Most business decisions are made under uncertainty. You do not know future demand, competitor behaviour, customer response or exact costs in advance. But you still need to allocate budgets, set prices and plan resources. That is where stochastic optimisation becomes powerful. It lets you model and optimise decisions in the presence of randomness.
I use these techniques in real client work when planning ad spend across channels, dynamic pricing structures and performance based bidding systems.
The Basic Problem: Optimisation with Uncertainty
Suppose you have a fixed marketing budget , and you want to allocate it across channels. Each channel has a random return , where is the spend on channel and represents the scenario (e.g. customer behaviour, conversion rate, CPC).
Your goal is to maximise expected return:
Subject to:
This is a stochastic programming problem. The outcome depends on both your decision and an uncertain variable .
Modelling Randomness: Scenario Based vs Distributional
There are two main ways I model uncertainty:
| Approach | Description | When I Use It |
|---|---|---|
| Scenario based | Generate finite set of scenarios with probabilities | When historical data suggests discrete outcomes |
| Distribution based | Model as continuous random variable (e.g. normal, log normal) | When behaviour is smooth and well understood |
The scenario version becomes:
This is easier to solve numerically.
Constraint Relaxation: Softening the Boundaries
Real systems often break under hard constraints. So I use constraint relaxation to model reality more flexibly.
For example, if is too strict (due to billing cycles, carry over budgets), I introduce a slack variable and penalise it:
Here, is the penalty for overspending. It reflects how painful it is to exceed the budget. This allows for soft constraints, helpful when managing risk without being brittle.
Nonlinear Returns and Gradient Optimisation
Returns are rarely linear. For example, spending more on a channel often has diminishing returns:
This is concave and models saturation, a common real world pattern.
To optimise such functions, I use stochastic gradient descent (SGD). This iteratively updates the spend vector by following the gradient of expected return:
Where is the learning rate and is the gradient of expected return. I often estimate the gradient from sampled scenarios using Monte Carlo methods.
Duality Theory: Understanding Tradeoffs
Many optimisation problems have dual forms, which give insights into shadow prices, the value of relaxing a constraint.
If is the optimal dual variable for the budget constraint , it tells you: "How much more value would I get from one more unit of budget?"
Formally, from the Lagrangian:
We find the that satisfies the KKT (Karush Kuhn Tucker) conditions. This is especially useful for pricing and resource allocation.
Pricing Optimisation with Uncertain Demand
In pricing strategy, demand depends on price and uncertain factors (like seasonality, competitor price).
Revenue is . The goal is:
Assuming log linear demand:
I calibrate and from historical data, run simulations under different pricing structures and optimise using either closed form derivation (if tractable) or numerical solvers.
Real Example: Performance Budget Across Channels
A client had to allocate £50,000 per month across paid search, social and affiliate. Each channel had different cost uncertainty and lead to revenue conversion volatility.
I built a stochastic model:
- Used historical variability as scenario inputs
- Applied nonlinear revenue functions per channel
- Estimated gradients with Monte Carlo sampling
- Ran constrained optimisation
| Channel | Old Allocation | New Allocation | Expected Return Change |
|---|---|---|---|
| Paid Search | £25,000 | £22,000 | +8% |
| Social | £15,000 | £18,000 | +12% |
| Affiliate | £10,000 | £10,000 | Stable |
The result: a new allocation plan that increased expected revenue by 18 percent while reducing downside risk exposure, all without increasing total spend.
Final Thought: Plan for Uncertainty, Not Around It
In growth work, you are always making decisions before the data is in. Pricing, bids, budgets, offers, all are exposed to uncertainty.
Stochastic optimisation allows me to model that risk explicitly, not ignore it. It helps businesses:
- Maximise expected outcome
- Account for variance, not just mean
- Understand the cost of constraints
- Allocate based on return potential, not surface performance
If you are still making deterministic plans in a probabilistic world, you are missing out on upside and underestimating your risk.
I can help you build models that reflect reality, not assumptions. And from those models, we extract strategies that scale.