Markets coveredMatch OddsCorrect ScoreOver / UnderFirst HalfSecond Half
Statometrics
Model Library · Machine learning and simulation

Agent-Based Models

Simulates a market as many individual traders with simple rules, to see how prices and liquidity emerge from their behaviour.

Advancedtradingevaluation

In one sentence

An agent-based model (ABM) builds a virtual exchange full of simulated punters and traders, each following simple rules, and watches what prices come out.

How it works

Instead of modelling the price directly, you model the people. Some agents are informed and back when the price is bigger than their fair value. Some are noise traders who back favourites or popular teams regardless of price. Some are market makers who post both sides of the book.

Run the simulation and the price, volume and spread emerge from their interactions. You can then ask what-if questions: what happens to the price if informed money arrives late, or if commission rises, or if noise traders lose their bank and leave.

ABMs are great for building intuition about markets. They are poor at producing trading signals, because there are too many settings to tune and no reliable way to confirm they match the real exchange.

The maths

There is no single formula for an ABM; the model is the set of rules. A simple money-weighted pricing rule is a common starting point.

pmkt=∑gMg qg∑gMgp_{\text{mkt}} = \frac{\sum_{g} M_g \, q_g}{\sum_{g} M_g}
  • p with subscript mkt is the market-implied probability that emerges.
  • g indexes groups of agents (informed, noise, market makers).
  • M with subscript g is the money each group puts in; q with subscript g is what that group believes the probability is.

In words: in this simple version, the price reflects everyone's beliefs weighted by how much money each group brings.

Worked betting example

In a simulated Match Odds market, the away team's true chance of winning is 40% (illustrative). Informed agents know this and bring £2,000. Noise traders, swayed by the popular home side, believe it is 30% and bring £8,000.

  1. Market probability = (£2,000 × 0.40 + £8,000 × 0.30) ÷ £10,000 = (£800 + £2,400) ÷ £10,000 = 32%.
  2. Market price = 1 ÷ 0.32 = 3.125.
  3. An informed £10 back at 3.125 wins £21.25: EV = 0.40 × £21.25 − 0.60 × £10 = +£2.50, or about +£2.33 after 2% commission.

Now run the simulation forward. Over time noise traders lose money and the informed share grows to half the pool.

  1. New market probability = 0.5 × 0.40 + 0.5 × 0.30 = 35%, price ≈ 2.86.
  2. The informed £10 back now has EV = 0.40 × £18.57 − £6.00 ≈ +£1.43 before commission, or about +£1.28 after 2% commission.

The model shows the textbook story: edges shrink as informed money dominates. It does not tell you what the real split of money is on Betfair today.

Where it's good

  • Understanding why prices behave as they do: steamers, late drift, the favourite-longshot bias.
  • Testing how a trading bot might affect prices before risking real money.
  • Providing a richer environment for reinforcement learning than a simple price replay.
  • Teaching: showing new traders how money and information interact.

Limitations and pitfalls

  • Too many knobs. With enough agent types and rules you can reproduce any historical pattern, which proves nothing. This is overfitting on a grand scale.
  • Validation is weak: matching a few summary statistics of real markets does not mean the mechanism is right.
  • Real agents adapt and learn; simple fixed rules miss how markets change after a strategy becomes popular.
  • Results can be sensitive to tiny changes in rules or random seeds. Run many seeds and report the range.
  • Easy to build a model that confirms what you already believed about the market.
  • Rarely a direct source of betting edge; treat outputs as hypotheses to test on real data.

How to build it

  • Python: Mesa for agent frameworks, or plain numpy loops for small models; R: NetLogo via RNetLogo.
  • Data: real Betfair price and volume histories to compare the simulation against.
  • Tip: start with two or three agent types and a single market; add complexity only when a simple version fails to explain something specific.
18+ only. Educational content, not financial or betting advice. Past results do not guarantee future returns. If gambling stops being fun, get free, confidential help at BeGambleAware.org.
Members