Repository avatar
AI Tools
v0.1.0
active

strokes-gained

com.shottogolf/strokes-gained

Golf strokes gained: expected strokes from any lie, shot-by-shot strokes gained, handicap levels.

Documentation

strokes-gained

Calculate strokes gained in golf, in JavaScript or Python. Expected strokes to hole out from any lie and distance, strokes gained for every shot, hole and round, and how many strokes golfers at each handicap lose to a scratch golfer. Libraries and command line tools with no dependencies, built on Mark Broadie's published PGA Tour tables.

npx strokes-gained hole "tee 410, fairway 150, green 20ft, green 3ft"   # npm
pip install strokes-gained                                              # PyPI
 1. 410 y tee        Off the tee       +0.16
 2. 150 y fairway    Approach          +0.17
 3. 20 ft green      Putting           −0.15
 4. 3 ft green       Putting           +0.06

4 on a par 4: +0.24 against a scratch golfer (+0.00 against the PGA Tour)
Off the tee +0.16 · Approach +0.17 · Putting −0.09

Made by Shotto, an AI agent for golf on iPhone and Apple Watch that tracks every shot from what you say and works out your strokes gained.

PackageDocs
JavaScriptstrokes-gained on npmjs/README.md
Pythonstrokes-gained on PyPIpython/README.md

Use it in Claude or ChatGPT

Add https://shottogolf.com/mcp to Claude or ChatGPT as a custom connector. It's free and needs no account. Then ask in plain words: "I drove it to 150 yards in the fairway, hit it to 20 feet and two-putted. What did each shot gain?" The assistant reads your description, and the connector does the maths with these same tables, against a scratch golfer unless you ask for the Tour or a handicap. Its tools are expected_strokes, strokes_gained (one hole or a whole round) and compare_to_handicap.

What is strokes gained?

Strokes gained measures each golf shot against a benchmark: the average number of strokes it takes to hole out from where the ball was. A shot that leaves you somewhere better than the benchmark expects gains strokes, and one that leaves you somewhere worse loses them. Added up over a round, it shows where your strokes are won and lost: off the tee, on approach shots, around the green and on the putting green.

strokes gained = expected strokes before the shot − expected strokes after it − 1

From 150 yards in the fairway a PGA Tour player averages 2.95 strokes to hole out, and from 20 feet on the green 1.87. So hitting it from 150 yards to 20 feet gains 2.95 − 1.87 − 1 = +0.08 strokes: slightly better than the average Tour player. Holing a 3-footer gains 1.04 − 0 − 1 = +0.04, and missing it loses about 0.96.

Mark Broadie developed the method at Columbia Business School and explains it in Every Shot Counts (2014). The PGA Tour has published strokes-gained statistics since 2011, starting with putting. There's a short guide at shottogolf.com/strokes-gained.

Against the Tour, scratch or any handicap

Broadie's tables are the average PGA Tour player, so every number starts there. Against the Tour nearly every amateur is negative, which says little about how a shot compares with golfers like you. So a hole can also be measured against a scratch golfer or any handicap index: that level's strokes per round, in each part of the game, are spread over a round's shots and added to each shot's Tour number. A tee shot or approach is worth about 0.1 more against scratch, and about 0.3 more against a typical 15 handicap.

Measured againstThat par 4 above (two putts from 20 feet)
PGA Tour+0.00
Scratch+0.24
5 handicap+0.40
15 handicap+0.78
20 handicap+0.99

The spread uses a typical round's shots per category (14 drives, 24 approaches, 8 shots around the green, 18 putted holes); pass a golfer's own counts for a closer reading. Putting's adjustment is per putted hole, split across the hole's putts. Shotto's app reads strokes gained the same way, with each golfer's own counts.

Strokes gained tables

Expected strokes to hole out for the average PGA Tour player, from Broadie's tables, and the strokes golfers at each handicap lose to a scratch golfer. Look up the spots before and after any shot and the formula above does the rest. Values between rows are interpolated.

From the fairway, rough, sand and recovery

DistanceFairwayRoughSandRecovery
20 yards2.402.592.533.51
30 yards2.522.702.663.57
50 yards2.662.872.923.79
75 yards2.742.953.233.84
100 yards2.803.023.233.80
125 yards2.873.103.213.78
150 yards2.953.193.253.80
175 yards3.063.293.373.82
200 yards3.193.423.553.87
225 yards3.353.563.743.93
250 yards3.523.693.884.00

From the tee

Hole lengthExpected strokes
150 yards2.98
175 yards3.04
200 yards3.12
350 yards3.89
400 yards3.99
450 yards4.13
500 yards4.41
550 yards4.70

On the green

PuttExpected putts
3 feet1.04
5 feet1.23
8 feet1.50
10 feet1.61
15 feet1.78
20 feet1.87
30 feet1.98
40 feet2.06
60 feet2.20

Strokes lost to a scratch golfer, by handicap

Per 18 holes, for a typical golfer at each handicap.

HandicapLong gameShort gameSandPuttingTotal
5−2.2−0.8−0.2−0.8−4.0
10−5.2−1.9−0.4−1.4−8.8
15−8.1−3.0−0.5−2.0−13.7
20−11.2−4.3−0.7−2.9−19.2
25−14.3−5.8−0.9−4.0−25.1
30−17.5−7.3−1.1−5.1−31.0
PGA Tour average+3.7+0.9+0.15+0.65+5.4

The long game (tee shots and approaches) is where most of the strokes go at every level: about 8 of a 15-handicap's 14 strokes a round to scratch. The handicap rows come from Broadie's amateur data. We place his scoring groups at handicaps of about 5, 17 and 30, and interpolate between them.

Tracking your own strokes gained

Strokes gained only needs to know where each shot started and where it finished. There are three ways to get that for your own rounds:

  • Write it down yourself. Note each shot's lie and distance on the card or in a spreadsheet, then let these packages do the maths.
  • Put sensors on your clubs, which tag each shot as you play.
  • Talk to Shotto. Say what happened after a shot, a few words to your Apple Watch or iPhone, or talk through the whole round on the drive home. Shotto places each shot on the hole and works out your strokes gained off the tee, on approach, around the green and putting, with nothing to tap on the course and nothing on your clubs. Its strokes gained comes from these same tables. It also keeps what sensors can't see, like the target you had in mind and how the swing felt. Shotto Golf is on the App Store, with a two-week free trial.

Questions

What is a good strokes gained number?

Zero means a shot, round or part of your game matched the benchmark exactly. Against the PGA Tour baseline nearly every amateur is negative, so the useful comparison is against golfers at your level: a 15-handicap typically loses about 2 strokes a round putting to a scratch golfer, so losing 1 means your putting is ahead of your handicap. Both packages do that comparison (levelVsScratch / level_vs_scratch).

How many strokes does a 15-handicap lose to a scratch golfer?

About 14 a round: roughly 8 in the long game, 3 in the short game, half a stroke from bunkers and 2 putting. The table above has every level from 5 to 30.

Is strokes gained measured against the PGA Tour or a scratch golfer?

Either, or any handicap. The tables are the PGA Tour's, the standard reference. Measured against a scratch golfer, or a handicap like 10 or 15, the numbers say how a shot compares with golfers you'd actually play with, which is what the command line and the Claude and ChatGPT connector show by default.

Do I need sensors or a launch monitor to track strokes gained?

No. Strokes gained needs only where each shot started and finished. That can come from club sensors, from a notebook, or from what you say: Shotto works out strokes gained from shots you describe to your Apple Watch or iPhone.

Which golf apps calculate strokes gained?

Sensor-based trackers calculate it from shots their sensors tag, and some GPS apps from shots you tap in. Shotto calculates it from what you say about each shot, during the round or after it, so there's nothing to tap or attach. Shotto Golf is on the App Store for iPhone and Apple Watch.

What's in this repo

PathWhat it is
data/baseline.jsonThe tables, with their sources
data/conformance.json174 cases every implementation must pass to within 1e-6
js/The npm package: library, CLI and types
python/The PyPI package: library, CLI and a pandas helper

The two packages, and the Swift implementation in the Shotto app, are generated from the same baseline.json and pass the same cases, so they always agree. The command line tools print identical output.

This repository is a mirror of the packages in Shotto's main codebase, where the tables are shared with the app. Issues and pull requests are welcome here; we apply accepted changes there and they sync back.

Where the numbers come from

  • Tee to green: Broadie (2011), "Assessing Golfer Performance on the PGA TOUR", Table 9: average strokes to hole out from about 8 million ShotLink shots, 2003 to 2010. Values between rows are interpolated in a straight line, and distances past either end take the end value.
  • Putting: the Tour expected-putts curve by distance, anchored to the paper's 1.80 from 16 feet.
  • Handicap levels: Broadie's Golfmetrics amateur data, by part of the game against scratch. The handicap given to each of his scoring groups (about 5, 17 and 30) is our estimate.
  • The Tour's edge on scratch: about 5.4 strokes a round (Every Shot Counts, 2014). How it splits between the parts of the game is our estimate.

These are Tour averages from one era, the standard reference for strokes gained.

License

MIT. Made by Shotto.

No installation packages available.

Remote