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. 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. This article walks through how I approach these problems using stochastic programming, nonlinear optimisation, gradient methods, and duality theory — with formulas and examples throughout.
The Basic Problem: Optimisation with Uncertainty
Suppose you have a fixed marketing budget ( B ), and you want to allocate it across ( n ) channels. Each channel ( i ) has a random return ( R_i(x_i, \omega) ), where ( x_i ) is the spend on channel ( i ) and ( \omega ) 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 ( \omega ).
Modelling Randomness: Scenario-Based vs Distributional
There are two main ways I model uncertainty:
- Scenario-based: generate a finite set of scenarios ( \omega_1, \omega_2, \dots, \omega_K ), each with probability ( p_k )
- Distribution-based: model ( \omega ) as a continuous random variable with known distribution (e.g. normal, log-normal)
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 ( \sum x_i \leq B ) is too strict (due to billing cycles, carry-over budgets), I introduce a slack variable ( s \geq 0 ) and penalise it:
Here, ( \lambda ) 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 ( x ) by following the gradient of expected return:
Where:
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 ( \lambda^* ) is the optimal dual variable for the budget constraint ( \sum x_i \leq B ), it tells you: "How much more value would I get from one more unit of budget?"
Formally, from the Lagrangian:
We find the ( \lambda ) 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 ( D(p, \omega) ) depends on price ( p ) and uncertain factors ( \omega ) (like seasonality, competitor price).
Revenue is ( R(p, \omega) = p \cdot D(p, \omega) ). The goal is:
Assuming log-linear demand, for example:
I calibrate ( \alpha ) and ( \beta ) from historical data, run simulations under different pricing structures, and optimise ( p ) 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 using historical variability as scenario inputs, applied nonlinear revenue functions, estimated gradients with sampling, and ran constrained optimisation.
The result: a new allocation plan that increased expected revenue by 18 percent while reducing downside risk exposure — all without increasing total spend.
Why This Matters
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.