In one sentence
Survival analysis estimates how long until something happens, like the next goal, and how factors such as a red card change that waiting time.
How it works
The name comes from medicine, but "survival" here just means "the event has not happened yet". In betting that might be a 0-0 scoreline surviving, a batter surviving, or a favourite leading a race.
The key idea is the hazard: the chance the event happens in the next small slice of time, given it has not happened so far. A goal hazard of 0.028 per minute means roughly a 2.8% chance of a goal in the next minute. From the hazard you can work out the chance the event happens in any window.
The Cox proportional hazards model lets conditions multiply the hazard. A red card, a team chasing the game or a change of weather each scale the baseline up or down. Survival methods also handle "censoring", cases where the event never happened before the clock stopped, without throwing that data away.
The maths
- h(t | x): the hazard at time t given the match conditions x.
- h_0(t): the baseline hazard, with all conditions at their reference level.
- β: how strongly each condition scales the hazard; e^β is the hazard ratio.
- The integral adds up the hazard over the window to give the expected number of events.
In words: conditions multiply the baseline event rate, and the chance of at least one event is one minus the chance of surviving the whole window.
Worked betting example
A match is 0-0 at 60 minutes, with about 33 minutes left including stoppage time. Your fitted model (illustrative figures) has a baseline goal hazard of 0.028 per minute for this stage, taken as constant for simplicity.
- No red card: P(goal) = 1 − e^(−0.028 × 33) ≈ 60.3%. Fair price for over 0.5 ≈ 1.66.
- The away side has a player sent off. Your model's hazard ratio for this is e^0.35 ≈ 1.42, so the hazard rises to about 0.0397.
- New P(goal) = 1 − e^(−0.0397 × 33) ≈ 73.1%. Fair price ≈ 1.37.
- Betfair reopens with over 0.5 at 1.45. £10 stake at 2% commission: a win pays £4.50 × 0.98 = £4.41. EV ≈ 0.731 × £4.41 − 0.269 × £10 ≈ +£0.53.
- Had the price stayed at the pre-red-card 1.75, EV would be about +£2.68, but markets reprice within seconds; you will almost never see stale prices like that.
Where it's good
- In-play goal timing: next goal, goal before a given minute, over/under as the clock runs down.
- Cricket: time or balls until the next wicket, adjusted for batter, bowler and conditions.
- Tennis: games until a break of serve.
- Racing and trading: how long a price move or a leader's advantage tends to last.
- Using matches where the event did not happen (censored data) properly rather than discarding them.
Limitations and pitfalls
- The proportional hazards assumption, that conditions scale the hazard by a fixed factor at all times, often fails; red-card effects may differ at 20 and 80 minutes.
- A constant baseline hazard is a simplification; goal rates rise through a match.
- Game state feeds back on itself: once a goal is scored, both teams change behaviour, so one model rarely covers the whole match.
- Hazard ratios for rare events (red cards, penalties) come from small samples and are noisy.
- In-play Betfair markets suspend on events and apply a bet delay, so by the time you act, the price has moved.
How to build it
- Python: lifelines (Kaplan-Meier, Cox models) and scikit-survival; R: survival and flexsurv.
- Data: time-stamped event data with match state (score, cards, minute) and censoring flags.
- Plot Kaplan-Meier survival curves first to see the shape of the baseline before fitting covariates.
- Tip: fit separate models by score state (level, one-goal lead) rather than forcing one model across all states.
Related methods
- Poisson processes: the constant-hazard special case.
- Gamma, exponential and Weibull distributions: common shapes for waiting times.
- Generalised additive models: a flexible way to model changing goal rates.
- Markov chains: model the sequence of match states that survival models step through.