In one sentence
Mean-variance optimisation, from Markowitz's portfolio theory, chooses how much of your bank to put into each strategy or bet so that you get the most expected return for a given level of risk, measured by variance.
How it works
Most serious punters run more than one thing: a pre-match Match Odds model, a Correct Score angle, an in-play goals trading bot. Each has its own average return and its own swings. Because their bad weeks do not all land at the same time, a mix can be smoother than any single one.
The method needs three inputs: each strategy's average return, how much it swings (standard deviation) and how closely their results move together (correlation). It then finds the mix with the lowest swings for a given return, or the best return per unit of swing.
Think of it as not putting all your eggs in one basket, but with numbers attached to how many eggs go in each.
The maths
- w is the list of shares of your bank given to each strategy.
- μ is the list of expected returns per period.
- Σ is the covariance matrix: each strategy's variance plus how pairs move together.
- λ is your risk aversion: bigger means you care more about swings.
- The bold 1 is a list of ones, so the second formula gives the lowest-variance mix whose shares add up to 100%.
In plain English: reward expected return, penalise swings, and let correlation decide how much diversification helps.
Worked betting example
You run two football strategies on Betfair and measure weekly returns, after commission, as a percentage of the money allocated to each. The figures are illustrative.
- Match Odds model: average +2.0% a week, standard deviation 8%.
- In-play goals trading (Over/Under): average +1.5% a week, standard deviation 5%.
- Correlation between their weekly results: 0.2.
| Mix (Match Odds / goals trading) | Weekly return | Weekly SD | Return per unit of SD |
|---|---|---|---|
| 100% / 0% | 2.00% | 8.00% | 0.250 |
| 0% / 100% | 1.50% | 5.00% | 0.300 |
| 50% / 50% | 1.75% | 5.12% | 0.342 |
| 23% / 77% (lowest variance) | 1.61% | 4.59% | 0.352 |
| 31% / 69% (best ratio) | 1.66% | 4.64% | 0.357 |
With a £5,000 bank, the best-ratio mix puts about £1,560 behind the Match Odds model and £3,440 behind goals trading. Its swings are smaller than goals trading alone while its average return is higher. That is the diversification benefit of a low correlation.
If the correlation rose to 1, there would be no benefit and the mix would just average the two.
Where it's good
- Splitting a bank between separate strategies, sports or trading bots.
- Checking whether a new strategy adds anything, or just adds more of the same risk.
- Spotting hidden concentration, for example two "different" models that back the same favourites.
- Setting fixed allocations that you review monthly, instead of reacting to last week's results.
Limitations and pitfalls
- The inputs are guesses from history. Small errors in average returns swing the answer wildly, and the optimiser loves to overweight whichever strategy had a lucky run.
- Variance treats big wins as badly as big losses, which is odd for betting, where returns are lopsided, especially at long odds.
- Correlations are unstable and tend to jump in bad periods, exactly when you need diversification.
- It does not maximise long-run growth; Kelly does. Mean-variance with a suitable λ is roughly similar to Kelly only when edges are small.
- Unconstrained answers can call for more than 100% of the bank. In betting you must add limits: no negative stakes, no borrowing, a maximum share per strategy.
- Commission takes a different share of each strategy's returns; measure returns after the 2% commission.
How to build it
- numpy for the maths; cvxpy or scipy.optimize for versions with limits on each weight.
- Data: at least a year of weekly or monthly returns per strategy, after commission.
- Shrink the estimates: pull average returns towards zero and correlations towards a common value before optimising.
- Practical tip: treat the output as a guide, then round to simple allocations; a 30/70 split is as good as 31/69 given the uncertainty.
Related methods
- Sharpe and Sortino ratios – the return-per-risk measure used here.
- Simultaneous Kelly – the growth-maximising alternative.
- Independence and correlation – the input that drives diversification.
- Value at risk – a tail-focused risk measure.
- Kelly criterion – sizing for growth rather than variance.