Who gets there first? Timing a pass, and the cost of waiting
A pass is a race between the ball and the nearest defender. Work out when each gets there, turn the gap into a chance, and one touch on the ball turns a switch that gets there 95% of the time into one that gets there 78%. The idea behind pitch control and the Action and Reaction board.
Intermediate Part 13 of Decision Science Through Football
New to the notation? The symbols explained
Contents
The football question
Blue's deep midfielder has the ball. Red have squeezed everything over to Blue's left, and their right-back is alone on the far touchline. The switch is on. Should he hit it now, or take a touch and look up first? Every coach says "play it early". This piece puts a number on why.
The concept
A pass is a race. The ball sets off at a steady speed; every defender sets off too, but only after he's seen it and reacted. If the ball gets to a spot before any defender can, the pass gets through there. If a defender can get to some spot on the ball's path first, he can cut it out.
So the whole question comes down to two times: when the ball gets to each point on its path, and when the quickest defender can get there. The difference is the margin.
This is the idea behind pitch control, the model William Spearman presented at the MIT Sloan Sports Analytics Conference in 2018 ("Beyond Expected Goals"), the year he joined Liverpool's data team. Laurie Shaw later wrote it up as open code for the Friends of Tracking course. It's also what the Action and Reaction board measures every time a player moves. This piece uses the board's numbers, with every setting stated, and the positions are made up.
How long does a defender take?
A player can't move the instant the ball is struck. He first takes a moment to react, and in that time he carries on the way he was already running. Then he sprints.
$$t_{\text{player}} = t_{\text{react}} + \frac{d - r}{v}$$
In plain football
- treact is how long he takes to react: 0.7 seconds, the published default.
- d is how far he has to go to the spot, measured from where he'll be once he's reacted. A defender already running towards the ball has a head start; one running away has further to go.
- r is his reach, 1.5 metres: he can stretch a leg that far, so he doesn't need to get all the way there.
- v is his running speed, 5 metres a second, again the published default.
The ball's time is simpler: the distance along the pass divided by 15 metres a second. The margin at each spot is the defender's time minus the ball's, and the pass is decided at the spot where the defender does best:
$$\text{margin} = t_{\text{defender}} - t_{\text{ball}}$$
In plain football
- Margin above zero: the defender is that many seconds too late. The pass gets there.
- Margin below zero: he gets there first and can cut it out.
- It's worked out for every spot on the pass, against every defender, and the worst one counts. One defender who gets there is enough.
A football example
Here's the switch, using the positions from "The midfield general" play on the board. Blue's 6 is at (46, 28) and the right-back is on the far touchline at (56, 60): 34 metres, a pass in the air that takes 2.24 seconds. A ball in the air can only be challenged where it comes down, so only the last five metres count.
Red's nearest man to that landing area is their wide midfielder, Red 11. Now, he's standing still, 11.2 metres from the best point he can reach. He needs 0.7 + (11.2 − 1.5) ÷ 5 = 2.64 seconds. The ball reaches that point after 1.91 seconds. He's 0.73 seconds too late.
Now suppose the 6 takes a touch first. In those two seconds Red slide back across, and they're still moving when he finally hits it. Red 11 is now at (64, 51) and running towards the touchline at 2.5 metres a second, so by the time he's reacted he's already 1.75 metres nearer. He needs 2.48 seconds; the ball now reaches his best point after 2.17. He's 0.31 seconds too late. The pass is still on, but only just.
Switch now 0.73 s, 95%
After a touch 0.31 s, 78%
From a margin to a chance
A margin of 0.31 seconds sounds safe. It isn't, because none of these times is exact. Spearman's model treats each player's arrival time as uncertain by about 0.45 seconds: he might react a little quicker, set off a little better, or stretch a little further. So a margin becomes a chance, and the curve that does it is the same S-shaped logistic curve as in logistic regression:
$$\text{chance} = \frac{1}{1 + e^{-k\,m}}$$
In plain football
- m is the margin in seconds.
- k sets how steep the S is: π ÷ (√3 × 0.45), about 4.0 a second. The smaller the uncertainty, the steeper the curve.
- A margin of zero is a dead heat: 50%. Every extra tenth of a second pushes the chance up, quickly at first, then more slowly as it nears 100%.
| Margin | Pass gets there |
|---|---|
| −0.3 s | 23% |
| 0 (dead heat) | 50% |
| 0.1 s | 60% |
| 0.3 s | 77% |
| 0.5 s | 88% |
| 0.75 s | 95% |
| 1 s | 98% |
The switch played now, at 0.73 seconds, gets there 95% of the time. After the touch, at 0.31 seconds, it's 78%. Same pass, same players, same target. The touch cost 17 percentage points.
These chances are what Spearman's assumed uncertainty makes of a margin. They aren't completion rates measured on real passes, and that's why the board itself doesn't show percentages.
Too close to call
The table also explains a rule on the board. When a margin is within 0.3 seconds either way, the board calls the pass too close to call rather than open or shut. At +0.3 seconds the pass gets there 77% of the time, so the defender still wins about 1 race in 4; at −0.3 it's the other way round. Inside that band, a lane that looks open is closer to a coin toss than a sure thing, so the board's optimiser only recommends passes that are clearly open.
From one pass to pitch control
Run the same race for every patch of grass, against every player on both teams, and you get a map of who gets there first: every spot belongs to whichever team has a player who can reach it soonest. That map is pitch control. On the board it's the coloured shading, worked out for every 1.5-metre square, and the "space" figure is the share of the pitch each side controls.
Spearman's full model goes a step further: it blends every player's chance over time, so a spot two attackers can almost reach is worth more than a spot one can just reach. The board keeps to the simpler "who's first" version.
The decision: now or after a touch?
This is a decision under uncertainty, the same kind as shoot, cross or keep the ball?. Waiting isn't free. A defence that's sliding across closes the far side while the ball sits at the passer's feet, so the touch costs about 17 percentage points of the switch's chance.
The touch is worth taking only if it buys more than that: a better body shape for a cleaner pass, a teammate's run that's about to start, or a second option that wasn't there before. If it buys nothing, "play it early" is right, and now we know by how much. The same arithmetic runs the other way for the defending side: every half-second they can make the passer wait is worth having, which is what pressing the man on the ball does.
On the board, step through "The midfield general" and look at the switch in the third step and then the fourth. The margin falls as Red slide across, and you can drag Red 11 to see how much each metre is worth.
Why it matters
- Timing is a number. "The pass was on, then it wasn't" becomes a margin in seconds, and a margin can be compared, traded off and improved.
- Moving players count twice. A defender running the right way is ahead before he's even reacted, which is why a sliding defence closes lanes faster than its positions suggest.
- Near-ties are risky. A pass that's just open is far less safe than it looks; leave room for the times you can't measure.
- Data science on the pitch. The same race, run over every spot, is pitch control, one of the main tools clubs use with tracking data. Routes through the press gave each pass a made-up chance; this is how such a chance can be worked out from where players stand.
Limitations
- The positions are made up. They show a coaching idea, not a measured match.
- The uncertainty is assumed. 0.45 seconds is Spearman's published setting, not something fitted to these players; with a different value, every chance in the table changes (the margins don't).
- Players don't keep running in straight lines. Real defenders read the pass and adjust; the model only lets them carry on the way they were going while they react.
- The ball is simple. A steady 15 metres a second in a straight line, no curl, no bounce, and no first touch at the other end.
- Everyone is average. Every player here has the default speed and reaction time. The board lets you rate players from 1 to 5, but that spread is made up.
Try it yourself
The 6 decides to hit the switch harder after his touch: 20 metres a second instead of 15. Before running the code, guess: is the late switch as safe again as playing it early? Change BALL to 20 in the snippet and see. Then try a quicker Red 11: what does a 0.5-second reaction do to the margin played now?
Reproduce the analysis
Plain Python, nothing to install or download. It works out Red 11's margin on the switch now and after the touch, using the same rules and positions as the board, and turns margins into chances. All the positions are made up.
Show the Python58 lines, ready to copy and run.
# From Football Data Science by Bryan McGuire. Free to use with credit.
# https://www.footballdatascience.co.uk/learn/timing-a-pass
from math import ceil, exp, hypot, pi, sqrt
# The board's defaults (Spearman 2018, as coded by Laurie Shaw): the ball travels at 15 m/s; a player takes 0.7 s to
# react, keeps running the way he was going while he does, then runs at 5 m/s; anything within 1.5 m he can reach now.
BALL, REACT, PACE, REACH = 15.0, 0.7, 5.0, 1.5
SIGMA = 0.45 # how uncertain an arrival time is, in seconds (Shaw's tti_sigma)
def arrival(player, spot, run=(0, 0)):
"""Seconds for a player to get to a spot: react (still carrying his run), then sprint."""
if hypot(spot[0] - player[0], spot[1] - player[1]) <= REACH:
return 0.0
x, y = player[0] + run[0] * REACT, player[1] + run[1] * REACT
return REACT + max(0.0, hypot(spot[0] - x, spot[1] - y) - REACH) / PACE
def margin(start, end, defenders, contest=5):
"""How many seconds the quickest defender is too late, at his best point on the pass. A pass in the air can only
be challenged where it comes down: its last `contest` metres."""
length = hypot(end[0] - start[0], end[1] - start[1])
steps, worst = ceil(length / 0.5), None
for i in range(steps + 1):
s = length * i / steps
if s < length - contest:
continue
spot = (start[0] + (end[0] - start[0]) * i / steps, start[1] + (end[1] - start[1]) * i / steps)
for name, (at, run) in defenders.items():
m = arrival(at, spot, run) - s / BALL
if worst is None or m < worst[0]:
worst = (m, name)
return worst
def chance(m):
"""The chance the defender isn't there in time: the logistic curve Spearman's model uses for arrival times."""
return 1 / (1 + exp(-pi / sqrt(3) * m / SIGMA))
# The midfield general, from the Action and Reaction board (metres; Blue attack left to right, y across the pitch).
# Blue's 6 has it at (46, 28); the right-back waits on the far touchline at (56, 60), 34 m away. Made-up positions.
six, right_back = (46, 28), (56, 60)
red_now = { # Red have squeezed the ball side and stopped: position, run (m/s)
"Red 7": ((55, 9), (0, 0)), "Red 8": ((56, 18), (0, 0)), "Red 6": ((58, 27), (0, 0)), "Red 10": ((60, 36), (0, 0)),
"Red 11": ((63, 48), (0, 0)), "Red 2": ((71, 11), (0, 0)), "Red 5": ((75, 23), (0, 0)), "Red 4": ((76, 34), (0, 0)),
"Red 3": ((76, 45), (0, 0)), "Red 9": ((48, 20), (0, 0)), "Red 1": ((100, 34), (0, 0))}
red_after_touch = {**red_now, # two seconds later: Red slide back across, and are still running that way
"Red 9": ((50, 26), (1, 3)), "Red 8": ((57, 22), (0, 2)), "Red 6": ((59, 30), (0, 2)),
"Red 10": ((61, 39), (0, 2.5)), "Red 11": ((64, 51), (0, 2.5)), "Red 3": ((77, 47), (0, 1.5))}
print(f"The switch: {hypot(right_back[0] - six[0], right_back[1] - six[1]):.0f} m, in the air, "
f"{hypot(right_back[0] - six[0], right_back[1] - six[1]) / BALL:.2f} s")
for when, red in [("Now", red_now), ("After a touch", red_after_touch)]:
m, who = margin(six, right_back, red)
print(f" {when:<14} {who} is {m:.2f} s too late: the pass gets there {chance(m):.0%} of the time")
print("\nMargin (s) and the chance the pass gets there")
for m in [-0.3, 0, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0]:
print(f" {m:+.2f} {chance(m):.0%}")
It prints:
Show the Text13 lines, ready to copy and run.
The switch: 34 m, in the air, 2.24 s
Now Red 11 is 0.73 s too late: the pass gets there 95% of the time
After a touch Red 11 is 0.31 s too late: the pass gets there 78% of the time
Margin (s) and the chance the pass gets there
-0.30 23%
+0.00 50%
+0.10 60%
+0.20 69%
+0.30 77%
+0.50 88%
+0.75 95%
+1.00 98%
The board runs the same sums in JavaScript, and its tests check that this play's story still holds whenever the rules change.
Further reading
- LaurieOnTracking, GitHub. Laurie Shaw's Python for Metrica's sample tracking data, including the pitch control code whose defaults (0.7 s, 5 m/s, 15 m/s, 0.45 s) this piece and the board use.
- Friends of Tracking, YouTube. The free course the code was written for, with talks on pitch control and tracking data.
- Logistic function, Wikipedia. The S-shaped curve that turns a margin into a chance.
- William Spearman, "Beyond Expected Goals", MIT Sloan Sports Analytics Conference, 2018. The original pitch control paper; the conference's old link no longer works.