# Should we cut retargeting? Credit, cause and a holdout

Retargeting looks good in attribution reports because they credit every channel that touched a won deal, including deals
that would have closed anyway. This study
asks whether a revenue team can tell, from its reports or from a test, if a US$41K-a-month retargeting budget pays for
itself. It uses a simulated B2B software company (8,640 leads over three years, US$28.27M of won revenue) where the
true effect of every channel is known, which no real company can see. The data is synthetic so that no customer data
is shared.

Open `report.html` in a browser for the full study: why the report always says keep, the holdout a team would run, how
often it is right, what a wrong call costs, which measurement method to use when, and how I would roll the test out
with a team.

## Results

| True effect | Revenue it causes a month | Right call | The report says | Holdout is right | A wrong call costs a month |
|---|---:|---|---|---:|---:|
| 0 points | US$0 | Cut | Keep (wrong) | 82% | US$41K |
| 2 points | US$21K | Cut | Keep (wrong) | 67% | US$20K |
| 4 points | US$42K | Keep | Keep | 51% | US$515 |
| 6 points | US$62K | Keep | Keep | 69% | US$21K |
| 8 points (like outbound) | US$83K | Keep | Keep | 82% | US$42K |
| 10 points | US$104K | Keep | Keep | 91% | US$63K |

In this simulated company every attribution rule credits retargeting with 5 to 8 times its spend at every true effect
from 0 to 10 points of win probability, so a team reading the report keeps it every time. The rules credit any channel on
a won deal, most won deals here needed no channel, and retargeting is the most common touch. Retargeting also reaches
likelier buyers by design, and that adds a little: with its touches drawn regardless of buying intent (a check added
after the results, `results-selection-off.json`), the lowest credit any rule gives falls only from US$207K to US$203K a
month (2% under the Markov rule), and first-touch and last-touch credit by about a tenth, while the audience grows from
4,647 to 4,871 leads.
The holdout withholds retargeting from 50% of the accounts entering its audience for 18
months and reads the result at month 24. It was sized to be wrong at most 20% of the time each way, and across 2,000
simulated companies per effect, drawn from the same simulator, it met that target: it wrongly keeps a useless channel
18.4% of the time and wrongly cuts one that works as well as outbound sales 17.9% of the time. Run once on the study
company's own accounts, the same test said cut at every effect, so it was wrong from 4 points up. Near break-even, a true
effect of about 4.0 points, any test is close to a coin flip, and there a wrong call costs about US$515 a month, a
remainder: the spend was set from a separate simulated company's revenue at 4 points (US$41,383, rounded to US$41,000),
while the larger population used here gives US$41,515.

Those rates hold at the assumed US$41K spend with every held-out account excluded from the ads. Moving one input at a
time (`results-sensitivity.json`), the test is right 75% to 91% of the time when retargeting does nothing and 88% to 70%
when it works like outbound, across spends of US$30K to US$60K a month. If the ad platforms exclude only 60% of the
held-out accounts, it is right only 59% of the time when retargeting works like outbound; nothing changes when it does
nothing.

Priced with stated assumptions (a US$41K monthly spend, full ad exclusion; the decision stands for a year), the holdout's
expected cost of a wrong call is about US$90K a year. At even odds between "does nothing" and "works like outbound" that compares with
US$246K for trusting the report and US$252K for cutting without a test, and the holdout stays cheapest when the team
starts 25% or 75% sure that retargeting does nothing. At every spend and match rate in the sweep it still costs least at
even odds (about US$75K to US$167K a year). A team that keeps only half the report's credit still keeps
retargeting at every effect. The page's recommendation is to run the holdout as a staged cut.

A balance check before launch helps, in the best case. On the same 2,000 companies per effect, re-drawing the split
until the two halves' expected win rates (from past accounts at the same pipeline stage with the same channels) differ
by less than a quarter of a point makes the test right 87% of the time instead of 82% when retargeting does nothing and
87% instead of 82% when it works like outbound, but only 52% instead of 51% at 4 points; the expected cost of a wrong
call at even odds falls from about US$90K to about US$65K a year. It is a best case because the check here sees every
account's pipeline stage and channels when the split is drawn. The check, its size and nine predictions were written
down before it ran (all nine held). A check added after the results (`results-secondary-checks.json`) shows the whole
gain comes from the pipeline-stage field: scored on the channel fields alone, the check is right 82% of the time at both
ends, the same as no check. The 87% rests on information a real test does not have when it assigns an account; treat it
as an upper bound for this check, not as what a check at entry can reach.

The test's length assumes the ad platforms exclude every held-out account. Planning for a known match rate with the same
rule (`results-match-rate-design.json`, a check added after the results), the test is read at month 30 at a 90% match and
month 42 at 75%; at 60% no design in the tested grid is enough (half the audience would need about 44 months).

## What is measured

- **Credit:** four attribution rules (first touch, last touch, position based, first-order Markov removal) over every
  won deal's touch path.
- **Caused revenue:** the simulator records the random draw that decided each proposal. Removing one channel with that
  draw held fixed shows whether the deal would still have closed.
- **Effect sweep:** retargeting's true effect set from 0 to 10 points of win probability on the deals it touches, with
  the same accounts, touches and draws at every value.
- **Holdout design:** planning numbers from the observed tables (about 129 audience accounts a month, a 15.7% win rate,
  a US$24K average won deal) and an assumed US$41K monthly spend give a break-even lift of 1.35 points, the same line
  as a true effect of about 4.0 points, because the effect only reaches deals that get to a proposal. The design rule,
  fixed before any test ran, picked the shortest enrollment, then the smallest holdout, with at most a 20% planned
  chance of a wrong call each way.
- **Error rates:** the same test on 2,000 fresh simulated companies at each effect. The right call is keep when the
  revenue retargeting causes a month is at least the spend.
- **Sensitivity:** the same 2,000 companies per effect and the same 50%, 18-month test, with the monthly spend set to
  US$30K, 35K, 41K, 50K or 60K, or with only 90%, 75%, 60% or 50% of held-out accounts excluded from the ads (an unmatched
  account still sees them). The base setting must reproduce the main error rates exactly.
- **Money:** a wrong call costs the gap between the revenue retargeting causes a month and its spend. The net cost of
  holding out is the revenue the held-out accounts lose minus the spend saved on them over the 18 months of enrollment,
  so a negative figure is a net saving. All money is in simulated US dollars.

The analysis plan and each later addition were written down before they were computed: `data/protocol.json`,
`data/protocol-amendment-e2.json` (credit against cause) and `data/protocol-amendment-w48.json` (the budget decision).

## Limits

- One simulated company, with a spend and channel effects the study chose, where retargeting reaches likelier buyers by design. The numbers show how attribution and a holdout
  behave, not what retargeting is worth in any real business.
- Revenue counts at face value. With a gross margin below 100%, the break-even lift rises.
- The simulator assumes no spillover between accounts and the same effect for every account, and omits ad auctions,
  budget changes during the test, revised deal values, several deals per account and changing sales processes.
- No employer or customer data is used.

## Round 2: a media mix model, checked

`media-mix.html` asks how far off a Bayesian media mix model is when nobody checks it, and which budget calls change once
the holdout above and one geo test calibrate it. The same simulated company gets five paid channels (paid search, paid
social, display, events, retargeting), each with carryover and saturation, weekly over three years. Retargeting keeps its
round 1 behaviour and true effect; its spend follows demand. The other channels' true effects are drawn from ranges written
down before any code. It is a simulation self-test: 9 worlds, 3 truth scenarios (the model's assumptions hold, events
carry over longer than the model allows, display and social flighted together) times retargeting at 0, 4 and 8 points.

| Reading | Worlds where its budget split earns less than today's | Revenue a year against today's split, average | Channel calls right |
|---|---:|---:|---:|
| Last-touch attribution | 7 of 9 | -US$313K | 28 of 45 |
| Media mix model, unchecked | 6 of 9 | -US$126K | 29 of 45 |
| Media mix model, calibrated | 3 of 9 | +US$110K | 32 of 45 |
| The truth's best split | 0 of 9 | +US$472K | 45 of 45 |

Every reading overstates retargeting in all 9 worlds: per US$1 of spend, last touch reads 7.2 to 10.1, the unchecked
model 3.1 to 16.4 and the calibrated model 1.4 to 6.7, against a truth of 0 to 2.0. Calibration moved the estimate toward
the truth in every world but never reached it, because the holdout's standard error (about US$10K a week) is as large as
the weekly spend. The geo test went to paid search in every world, so in the longer-carryover worlds events was never
tested and stayed undervalued. All 18 fits passed the convergence check (R-hat at most 1.01, effective sample size at
least 400, no divergent transitions); one needed its one allowed re-run.

The model is PyMC on CPU, in `mediamix/`, with its own hash lock `mediamix/requirements.lock` (it keeps the study's pins
and adds PyMC). Results: `results-media-mix.json`, `media-mix-roi.csv`, `media-mix-budget.csv`,
`media-mix-convergence.csv`, and per world `media-mix-runs/world-N-b.json` (data, truth, attribution, unchecked fit) and
`world-N.json` (plus the geo test, the holdout reading, the calibrated fit and the budget splits).

```sh
uv venv --python 3.12.3 .venv-mmm
uv pip sync --python .venv-mmm/bin/python --require-hashes mediamix/requirements.lock
.venv-mmm/bin/python -B -m mediamix.run --stage b --worlds 0 --runs runtime/mmm   # attribution and the unchecked fit
.venv-mmm/bin/python -B -m mediamix.run --stage c --worlds 0 --runs runtime/mmm   # geo test, holdout, calibrated fit, budget
cmp runtime/mmm/world-0.json media-mix-runs/world-0.json
.venv-mmm/bin/python -B -m mediamix.run --gather --runs media-mix-runs --dest runtime/mmm-gather
.venv-mmm/bin/python -B -m mediamix.page --out runtime/media-mix.html
cmp runtime/media-mix.html media-mix.html
.venv-mmm/bin/python -B -m pytest -q
```

In the locked environment a world refits byte for byte from its fixed
random draws (checked on two worlds). Both runner
stages refuse to overwrite an existing world file.

## Round 3: payment and prescribing records, on public data

`life-sciences-signals.html` makes the same move on real public records from another field: what United States
government files on industry payments to clinicians and Medicare prescribing can and cannot establish, and the randomized
holdout that would answer what they cannot. Scope: Ohio; payments and prescribing in 2024, with 2023 as the year before;
two drug classes (SGLT2 inhibitors and the newer blood thinners), four drugs. The outcome is a drug's share of the
clinician's Medicare prescriptions in its class. Each step adds one adjustment the files allow.

| Drug | Naive gap, points | Plus specialty, volume, region | Plus last year's share (95% interval, practices clustered) | Same region step, against the year before | Plus competitor paid (added after the first results) | Clinicians for a practice holdout to detect half the adjusted gap |
|---|---:|---:|---:|---:|---:|---:|
| Dapagliflozin | +16.0 | +14.7 | +6.4 (+5.1 to +7.7) | +13.7 | +7.0 | 2,356 |
| Empagliflozin | −8.7 | −6.9 | −2.9 (−4.1 to −1.7) | −7.3 | +0.9 | 11,769 |
| Rivaroxaban | +4.0 | +2.7 | +1.5 (+0.2 to +2.7) | +2.4 | +1.5 | 27,089 |
| Apixaban | −1.9 | 0.0 | −0.2 (−1.2 to +0.7) | −0.2 | +0.1 | 1,233,867 |

90.6% of the 5,016 clinicians paid about these drugs are in the state's Medicare prescriber file; 2,986 are in the
analysis panels. These are associations, not effects. Every figure comes from clinician-level fits with errors clustered by
practice address. The test sizes use the size of practice a typical clinician sits in (a few hospital and system
addresses hold hundreds of panel clinicians); practices would be paired by size before randomizing, or the test confined
to practices of up to 10 panel clinicians. Added after the first results, and labelled so in the results and on the
page: the competitor step, the clustered intervals, the timing check among clinicians unpaid in 2023, the weighted
cluster size and the small-practice design.

No clinician row, name or ID is published, and no grouped counts either: the published files are the results (estimates,
intervals and counts) and `lifesci/data/sources.json` (every source address, example query and hash). `lifesci.privacy`
checks them: every whole number in the results, both CSVs and the sources file is 0 or at least 11 (smaller counts read
"fewer than 11"; page text, decimals and text fields are not read), and, for the sets of counts listed in the check that
add up to a published total, no count from 1 to 10 can be worked out by subtraction.

To reproduce (network, about 180 MB of filtered requests; keep both folders outside any published copy, since they hold
clinician-level records):

```sh
.venv/bin/python -B -m lifesci.fetch --raw RAW          # public CMS, Open Payments, FDA and NPPES interfaces
.venv/bin/python -B -m lifesci.build --raw RAW --work WORK --out runtime/lifesci-data
cmp runtime/lifesci-data/sources.json lifesci/data/sources.json     # the same downloads
mkdir -p runtime/lifesci
.venv/bin/python -B -m lifesci.analyze --work WORK --out-dir runtime/lifesci
cmp runtime/lifesci/results-life-sciences.json results-life-sciences.json
LIFESCI_RAW=RAW .venv/bin/python -B -m pytest -q tests/test_life_sciences.py   # without LIFESCI_RAW the replay test is skipped
.venv/bin/python -B -m lifesci.privacy .
```

The public files can be revised by their publishers; `sources.json` records the hash of every page this round read, so a
changed download shows up at the `cmp` step. Without the downloads, the tests check the published results against the
recorded hashes of the fit's output, the model and sizing arithmetic, the privacy rules and the page.

## Round 4: account signals from linked claims, on synthetic records

`linked-claims.html` asks what happens before any account signal exists: how a patient's claims and electronic health
records (EHR) are linked, which clinician a new start is credited to, which organisation a clinician rolls up to, and which codes define
the product and the condition. It builds synthetic markets (4 health systems, 12 group practices and 40 small practices;
36,000 patients with the condition and 3,600 with a related one; invented ids, all starting with 9, which no real clinician
or organisation id does, and invented codes, which may coincide with real ones by chance) where the true patient, the
deciding clinician and that clinician's organisation are known behind every record, and scores 36 builds against that
truth on 20 markets. The design and its eight predictions are in `DESIGN-linked-claims.md`; every assumed rate is in
`linkedclaims/protocol.json`.

| Build (one change from the first row) | True top 20 clinicians matched | True top 10 organisations matched | Commercial checks, markets passing all 4 | Research checks, markets passing all 4 |
|---|---:|---:|---:|---:|
| Probabilistic matching, prescriber credit, organisation on the service date, curated value set | 16.5 | 10 | 20 | 20 |
| Exact tokens | 16 | 10 | 20 | 0 |
| Rendering clinician credit | 13 | 8 | 0 | 20 |
| EHR attending credit | 8 | 4 | 0 | 20 |
| Current organisation | 16.5 | 9 | 0 | 20 |
| Exact code list | 12 | 7 | 0 | 0 |
| Grouped value set | 15 | 9 | 20 | 0 |

Medians of the 20 markets. The six linkage and credit lists share 6 of the 20 fastest-growing clinicians (3 to 9); two
draws of the same market with perfect data share 5 of their true top 20 (2 to 8). The rates are assumptions, and the
checks were written by the same author as the faults they look for, so their pass rates are a self-test. Two research
results hold by construction: the probabilistic matcher scores exactly the slips the generator makes, and the curated
value set drops exactly the code the generator gives the related condition; R1 (reproducible counts) passes for every
build by construction and fails only for the planted build that reads the latest release at run time. Three readings
were added after the first results: the worked example's records and the exact code list's missed starts in the second
half and under the new-package sweep, kept apart in `results-linked-claims-posthoc.json`, and the per-market counts
behind each direction the page states, which the page computes from the per-market files.

To reproduce (standard library only, no network):

```sh
mkdir -p runtime/lc
.venv/bin/python -B -m linkedclaims.run all --runs runtime/lc/runs          # resumable; run again until it prints PASS
for f in linked-claims-runs/*.json; do cmp "$f" "runtime/lc/runs/$(basename "$f")"; done
.venv/bin/python -B -m linkedclaims.run gather --runs linked-claims-runs --out-dir runtime/lc/out
cmp runtime/lc/out/results-linked-claims.json results-linked-claims.json
.venv/bin/python -B -m linkedclaims.posthoc --out runtime/lc/posthoc.json
cmp runtime/lc/posthoc.json results-linked-claims-posthoc.json
.venv/bin/python -B -m linkedclaims.page --out runtime/lc/linked-claims.html
cmp runtime/lc/linked-claims.html linked-claims.html
.venv/bin/python -B -m pytest -q tests/test_linked_claims.py      # LINKEDCLAIMS_FULL=1 adds the replay of every world
```

## Round 5: two sales motions, held out

`sales-motions.html` asks the round 1 question of two sales motions on new groups of accounts at the same simulated
company: inside sales calls to product-qualified free accounts (a propensity list, and an uplift list fitted on a
randomized pilot), and a drafted email and SMS cadence to small businesses no rep reaches, with a check that every
personal detail in a draft traces to the account record. Every effect, rate and cost is assumed; the tests are sized and
scored on the generator they were designed for, so the right-call rates are a self-test, and the draft check catches the
generator's own faults by construction. The design and its twelve predictions are in `DESIGN-sales-motions.md`; every
rate and rule is in `motions/protocol.json`, committed before any code; eight implementation clarifications are in
`motions/protocol-amendment-1.json`, committed with the code before the published run.

| Inside sales, true effect | Right call | Test right (2,000 companies) | Credited a month | Caused a month |
|---|---|---:|---:|---:|
| None | Stop | 74.5% | US$225K | US$0 |
| Middle accounts gain most, 4 points | Stop | 36.8% | US$251K | US$26K |
| Middle accounts gain most, 6 points | Keep | 57.5% | US$264K | US$39K |
| Middle accounts gain most, 10 points | Keep | 81.3% | US$290K | US$65K |
| Likeliest buyers gain most, 4 points | Stop | 42.8% | US$253K | US$28K |
| Likeliest buyers gain most, 6 points | Keep | 60.5% | US$267K | US$42K |
| Likeliest buyers gain most, 10 points | Keep | 85.7% | US$295K | US$70K |

The test holds out half of each list for 3 months (300 accounts per list held out). The calls cost about US$30K a month
at the assumed US$150 per worked account. With no effect it said keep in 20.0% of companies and change to the uplift
list in 5.5%. The uplift list earned more than the propensity list only at 8 and 10 points where middle accounts gain most
(prediction 3 missed).

| Cadence, true effect | Right call | Test right (2,000 companies) | Meetings caused per 1,000 | Last touch credits | First touch credits |
|---|---|---:|---:|---:|---:|
| 0 points | Cut | 80.6% | 0 | 81.7 | 31.3 |
| 1 point | Cut | 53.9% | 10 | 90.6 | 34.7 |
| 1.5 points | Keep | 61.1% | 15 | 95.1 | 36.4 |
| 4 points | Keep | 97.9% | 40 | 117.6 | 44.9 |

The cadence test holds out half the cohort for 8 weeks (1,000 accounts per arm). The trace check blocked 14.3% of
drafts; without it the complaint guardrail paused the cadence in 72.7% of companies, with it in 7.6%. Eleven of the twelve
predictions held.

Added after the results: one account on both inside sales lists, traced from the study run by a rule in
`motions/trace.py` (`results-sales-motions-trace.json`): it was called and upgraded, and would have upgraded without the
call, so its whole first-year value is credited to the call and none of it is caused.

Results: `results-sales-motions.json` (every result), `sales-motions-pqa.csv` and `sales-motions-cadence.csv` (the tests
by scenario), and every simulated test in `sales-motions-pqa-replications.csv.gz` and
`sales-motions-cadence-replications.csv.gz`. To reproduce (NumPy only, no network):

```sh
.venv/bin/python -B -m motions.run --out runtime/motions          # refuses an existing folder
for f in results-sales-motions.json sales-motions-pqa.csv sales-motions-cadence.csv sales-motions-pqa-replications.csv.gz sales-motions-cadence-replications.csv.gz; do cmp "runtime/motions/$f" "$f"; done
.venv/bin/python -B -m motions.page --out runtime/sales-motions.html
rm -f runtime/trace.json; .venv/bin/python -B -m motions.trace --out runtime/trace.json
cmp runtime/trace.json results-sales-motions-trace.json
cmp runtime/sales-motions.html sales-motions.html
.venv/bin/python -B -m pytest -q tests/test_sales_motions.py
```

## Round 6: budget by lifetime value

`lifetime-value.html` splits round 2's weekly budget by customer lifetime value, on the same nine worlds, fits and
allocation rule, with no model refitted. Each customer renews yearly, and how long customers stay and how much they grow
depends on the channel that brought them in, by assumed ranges; a team sees three years of orders, each customer labelled
by round 2's last-touch credit rule. Every split is scored by the lifetime value of a year of new customers under the
truth (five contract years, discounted at 10% a year). It is a simulation scored on the same generator, and the
differences between channels follow from the assumed retention. The design and its ten predictions are in
`DESIGN-lifetime-value.md`; every rate and rule is in `ltv/protocol.json`, committed before any code. Change 1 to
the protocol (six implementation clarifications, `ltv/protocol-amendment-1.json`) was committed with the code before
the published run and before any run on round 2's worlds; it changes no rate, range, reading or threshold.

| Split | Lifetime value a year against today's, average | Worlds below today's | Channel calls right |
|---|---:|---:|---:|
| Attributed first-year revenue | -US$628K | 6 of 9 | 29 of 45 |
| Attributed lifetime value | -US$537K | 6 of 9 | 29 of 45 |
| Short-run ROI (calibrated model) | +US$544K | 2 of 9 | 30 of 45 |
| Incremental lifetime value | +US$643K | 3 of 9 | 32 of 45 |
| The truth's best for lifetime value | +US$1.97M | 0 of 9 | 45 of 45 |

Lifetime value on top of the calibrated model moved 1.9% to 8.0% of the budget and earned more than the short-run split
in 7 of 9 worlds (US$37K a year at the median, from -US$114K to US$428K); even the truth's two splits differ by 10% or
more of the budget in only 2 of 9 worlds (prediction 1 missed). Both splits read from the calibrated model beat both
attribution splits in 7 of 9 worlds (US$1.03M a year at the median against attributed lifetime value). The cohort table
held 33% to 91% organic customers per channel, so it overstated paid search, paid social and retargeting in 9 of 9
worlds and display in 8, understated events in 8, and its 90% intervals held the true value in 12 of 45. When
calibration lands after week 6 of a quarter, the lifetime value target falls by US$1.04M to US$8.34M and lands closer to
the truth in 9 of 9 worlds; moving the spend earned at least as much as keeping the plan in 6 of 9. Nine of the ten
predictions held.

Results: `results-lifetime-value.json` (every result), `lifetime-value-budget.csv` (every split per world),
`lifetime-value-channels.csv` (cohort and true lifetime value per channel and world), `lifetime-value-regoal.csv` (the
quarter targets) and `lifetime-value-customers.csv.gz` (the order history; its source column is simulator-only). To
reproduce (NumPy only, no network):

```sh
.venv/bin/python -B -m ltv.run --out runtime/ltv          # refuses an existing folder
for f in results-lifetime-value.json lifetime-value-budget.csv lifetime-value-channels.csv lifetime-value-regoal.csv lifetime-value-customers.csv.gz; do cmp "runtime/ltv/$f" "$f"; done
.venv/bin/python -B -m ltv.page --out runtime/lifetime-value.html
cmp runtime/lifetime-value.html lifetime-value.html
.venv/bin/python -B -m pytest -q tests/test_lifetime_value.py
```

## Round 7: a geo test that checks itself

`geo-checks.html` runs round 2's geo test (paid search switched off in 20 of 40 regions for 8 or 10 weeks) 400 times per
world on round 2's nine worlds, day by day, with sales booked days after they happen, and breaks it on purpose in four
ways: 10% of the planned spend leaking into the held-out regions, the live regions pacing at 70% of plan, six regions
losing 20% of their demand, and a 60-day conversion lag. Five checks watch every run: balance at launch, held-out spend,
pacing, the share of the test's sales still to arrive at readout, and existing-customer revenue that the ads cannot move.
A flag is recorded and never acted on, so every run is read at its planned end. It is a simulation scored on the same
generator; which check catches which break follows from how each break was built. The design and its ten predictions are
in `DESIGN-geo-checks.md`; every rule and size is in `geochecks/protocol.json`, committed before any code. Change 1 to
the protocol (eight implementation clarifications, `geochecks/protocol-amendment-1.json`) was committed with the code
before the published run and before any run on round 2's worlds; it changes no rate, size, check, threshold or prediction.

| Test | Check | Runs flagged (no break) or caught on or after the break's first day | Median day of the break at the first flag (first day = 1) | Read against the truth, median | Interval holds the truth |
|---|---|---:|---:|---:|---:|
| No break | any check | 7.3% flagged | | -5.1% | 88.7% |
| Spend leak | held-out spend | 100% caught | day 2 | -16.8% | 78.3% |
| Pacing change | pacing | 100% caught | day 3 | -20.9% | 72.1% |
| Demand shock | existing-customer revenue | 19.1% caught | day 31 | -7.3% | 64.3% |
| 60-day lag | still to arrive | 100% caught | at launch | -70.3% | 8.8% |

A flag before the break began is a false alarm, not a catch: counting those too, the existing-customer revenue check
flagged 19.5% of shock runs before readout, the measure prediction 5 names (10% to 60%).

The spend checks caught their breaks within 3 days in at least 99.8% of runs. The demand shock moves no spend, lag or
history, so only the existing-customer revenue check could see it, and it caught 19.1% of shock runs after the shock
began (12.3% to 27.3% by world); the 76.3% of shock runs no check flagged drifted a median 21.0% either way (15.0% on
healthy tests no check flagged) and their interval held the truth in 71.9%. Read at its planned end, a
test with a 60-day lag showed a median 30% of the true lift (67% of its sales still to arrive); waiting a median 113 more
days until under 5% was still to arrive read 97%, with an interval 1.95 times as wide that held the truth in 89.5% of
runs. At a 3-day lag 3.6% is still to arrive at the end. Correcting an early read rather than waiting is the subject of
the pacing study on delayed conversions. All ten predictions held. The media mix model is not refitted with these reads.

Results: `results-geo-checks.json` (every result), `geo-checks-summary.csv` (each cell and check per world),
`geo-lag-readout.csv` (the read by lag) and `geo-checks-runs.csv.gz` (every run). To reproduce (NumPy and SciPy, no
network):

```sh
.venv/bin/python -B -m geochecks.run --out runtime/geo --worlds 0 1 2 3 4 5 6 7 8   # one part per world; refuses an existing part
.venv/bin/python -B -m geochecks.run --out runtime/geo --gather                     # refuses existing result files
for f in results-geo-checks.json geo-checks-summary.csv geo-lag-readout.csv geo-checks-runs.csv.gz; do cmp "runtime/geo/$f" "$f"; done
.venv/bin/python -B -m geochecks.page --out runtime/geo-checks.html
cmp runtime/geo-checks.html geo-checks.html
.venv/bin/python -B -m pytest -q tests/test_geo_checks.py
```

## Round 8: a partner-funded program, held out

`partner-programs.html` asks what a holdout can say about a program a partner co-funds for accounts it picks from its own
book, on round 5's free accounts at the same simulated company. Each quarter 3,000 accounts are also the partner's
customers; the partner sends its top 300 by a rating the company never sees (sharp: intent plus noise of SD 0.05; loose:
SD 0.25; a random slice of 300 as a reference). The program adds round 5's two effect shapes at 5 or 10 points and costs an
assumed US$150 per account it reaches. The company draws a holdout inside each list and reads first-year value from its
own records with round 1's estimator and design rule, under three agreements: the terms kept, the partner working half its
held-out accounts itself, and the partner swapping its highest-rated held-out accounts into the program after the draw. It
is a simulation scored on the same generator, so the right-call rates are a self-test; the worked agreement halves the read
by construction. The design and its eight predictions are in `DESIGN-partner-programs.md`; every rule and size is in
`partners/protocol.json`, committed before any code. Change 1 to the protocol (nine implementation clarifications,
`partners/protocol-amendment-1.json`) was committed with the code before any run on the round's random streams; it
changes no rate, rule, effect, threshold or prediction. Change 2 (`partners/protocol-amendment-2.json`) was committed after
a first run and before the published one: the number check found 3 of 90,000 tests reading exactly the US$150 cost that
floating-point rounding had decided stop, where Change 1 says keep. The decision is now exact; the rerun on the same
random streams changed those 3 decisions and nothing else. The first run's results file is kept unchanged as
`results-partner-programs-first-run.json`: it read 62.3% for the loose rating's no-effect swapped cell (now 62.2%) and
37.7% for prediction 6's loose figure (now 37.8%).

| Partner's rating, program effect | Caused per account | Attribution credits | Terms kept: right | Partner works held-out: right | Partner swaps: right |
|---|---:|---:|---:|---:|---:|
| Sharp, no effect (stop) | US$0 | US$1,439 | 81.4% | 81.4% | 44.5% |
| Sharp, middle gain most, 5 points (stop) | US$107 | US$1,546 | 61.1% | 72.0% | 23.9% |
| Sharp, middle gain most, 10 points (keep) | US$214 | US$1,653 | 63.5% | 39.8% | 89.5% |
| Sharp, likeliest gain most, 5 points (keep) | US$201 | US$1,640 | 59.9% | 38.8% | 90.0% |
| Sharp, likeliest gain most, 10 points (keep) | US$402 | US$1,841 | 92.4% | 60.3% | 99.3% |
| Loose, no effect (stop) | US$0 | US$1,073 | 83.7% | 83.7% | 62.2% |
| Loose, middle gain most, 5 points (stop) | US$138 | US$1,211 | 54.8% | 70.9% | 29.9% |
| Loose, middle gain most, 10 points (keep) | US$276 | US$1,349 | 77.9% | 45.8% | 91.5% |
| Loose, likeliest gain most, 5 points (keep) | US$163 | US$1,237 | 51.9% | 31.2% | 77.0% |
| Loose, likeliest gain most, 10 points (keep) | US$327 | US$1,400 | 86.1% | 51.6% | 96.5% |

The design rule gives 3 quarters of lists (900 accounts) with 30% held out (270), read one quarter after the last list;
one quarter's list cannot be read at the cost (planned error at least 29.7%). With the terms kept the mean read was within
US$5 of the caused value in all 15 cells and a program that caused nothing was stopped in 81.4% (sharp) and 83.7% (loose)
of 2,000 tests. When the partner picks, attribution credited 4.3 to 14.5 times the caused value, and comparing its
accounts with the rest of its book 2.9 to 10.6 times. Swaps after the draw raised every read by US$99 to US$181 an account
and kept a program that caused nothing in 55.5% (sharp) and 37.8% (loose) of tests; prediction 6 (at least half under
both ratings) missed on the loose rating, so 7 of 8 predictions held. What the list's read cannot tell: under the sharp
rating, two programs that read US$211 and US$199 an account on the list would cause US$284 and US$83 an account on the
partner's other customers. Attribution is a credit convention, not caused value.

Results: `results-partner-programs.json` (every result), `partner-programs-cells.csv` (each rating, effect and agreement)
and `partner-programs-replications.csv.gz` (every simulated test). To reproduce (NumPy only, no network):

```sh
.venv/bin/python -B -m partners.run --out runtime/partners --companies 0 1000      # one part; refuses an existing part
.venv/bin/python -B -m partners.run --out runtime/partners --companies 1000 2000
.venv/bin/python -B -m partners.run --out runtime/partners --gather                 # refuses existing result files
for f in results-partner-programs.json partner-programs-cells.csv partner-programs-replications.csv.gz; do cmp "runtime/partners/$f" "$f"; done
.venv/bin/python -B -m partners.page --out runtime/partner-programs.html
cmp runtime/partner-programs.html partner-programs.html
.venv/bin/python -B -m pytest -q tests/test_partner_programs.py
```

## Round 9: a broken geo test in the budget

`geo-budget.html` takes the last step round 7 left out: it feeds round 7's geo readouts, broken and healthy, into round 2's
calibrated media mix model and asks what each does to the budget split, on the same nine worlds, model, seeds and budget
rule. In each world one readout per row is picked by a rule fixed before any fit (the lower median read of its set): no
break, the spend leak, the pacing change, the demand shock split by whether a check flagged it, and the 60-day lag; a
seventh fit calibrates with the holdout alone, which is what dropping a flagged readout leaves. "Flagged" is round 7's five
checks, unchanged. It is a simulation scored on the same generator, and each cell is one run of a noisy test. The design
and its eight predictions are in `DESIGN-geo-budget.md`; every rule is in `geobudget/protocol.json`, committed before any
fit with a round 7 readout.

| Geo readout fed in | Flagged | Read over true lift, median | Paid search return over truth, median | Revenue a year against today's split, average | Worlds below today's split | Channel calls right |
|---|---|---|---|---|---|---|
| No break | 1 of 9 | 95% | 104% | +US$124K | 2 of 9 | 33 of 45 |
| Spend leak into held-out regions | 9 of 9 | 83% | 93% | +US$130K | 2 of 9 | 34 of 45 |
| Pacing change in the live regions | 9 of 9 | 79% | 89% | +US$120K | 2 of 9 | 32 of 45 |
| Demand shock, no check flagged | 0 of 9 | 92% | 104% | +US$129K | 2 of 9 | 33 of 45 |
| Demand shock, a check flagged | 9 of 9 | 91% | 102% | +US$118K | 2 of 9 | 32 of 45 |
| A 60-day conversion lag | 9 of 9 | 30% | 49% | -US$19K | 4 of 9 | 25 of 45 |
| No geo readout (holdout only) |  |  | 267% | -US$74K | 4 of 8 | 25 of 40 |
| Round 2, calibrated (its own geo test) | | | 112% | +US$110K | 3 of 9 | 32 of 45 |
| Round 2, unchecked model | | | | -US$126K | 6 of 9 | 29 of 45 |

Fed the no-break readout, the model's split earned +US$124K a year against today's on average, near round 2's own
calibrated split (+US$110K). The 60-day lag read showed a median 30% of the true lift; the model then read paid search at
49% of its true return and gave it less budget than the no-break read in all 9 worlds (a median 52% less; a cut against today's
spend in 6 of the 7 worlds where the truth says to grow it), which cost US$142K a year on average
against the no-break read, with less revenue in 8 of 9 worlds. The spend leak and the pacing cut lowered the read to a
median 83% and 79% of the true lift but moved revenue by under US$37K a year in any world, and the demand shock reads by
under US$49K. Calibrating with the holdout alone, which is what dropping a flagged readout leaves, read paid search at
267% of its true return, pushed it to its cap of twice today's spend in 4 of 8 worlds and earned -US$74K a year on
average, against -US$53K for the 60-day lag read on the same 8 worlds; it beat keeping the short read in 4 of 8. One of
the 63 fits, the holdout alone in world 9, failed the convergence gate after its declared re-run (4 divergent
transitions) and is reported as a method failure, never scored. 6 of 8 predictions held. Prediction 4 (the leak and the
pacing reads each earn less than the no-break read) missed: the leak read earned US$6.7K a year more on average.
Prediction 6 (the holdout alone beats the 60-day read in at least 5 of 9 worlds) is untestable, because the failed fit
decides it. Prediction 1 and the second half of prediction 8 were safe bets.

Results: `results-geo-budget.json` (every result), `geo-budget.csv` (each world and readout) and `geo-budget-runs/` (each
of the 63 fits with its posterior draws and split). To reproduce (PyMC, in round 2's locked environment; no network):

```sh
.venv-mmm/bin/python -B -m geobudget.run fit --world 0 --readout lag60 --runs runtime/geo-budget   # one fit; refuses an existing file
cmp runtime/geo-budget/world-0-lag60.json geo-budget-runs/world-0-lag60.json
.venv-mmm/bin/python -B -m geobudget.run gather --runs geo-budget-runs --dest runtime/geo-budget-gather
for f in results-geo-budget.json geo-budget.csv; do cmp "runtime/geo-budget-gather/$f" "$f"; done
mkdir -p runtime
.venv-mmm/bin/python -B -m geobudget.page --out runtime/geo-budget.html
cmp runtime/geo-budget.html geo-budget.html
.venv-mmm/bin/python -B -m pytest -q tests/test_geo_budget.py      # GEOBUDGET_REFIT=1 adds one refit
```

## Round 10: a named-account program as incremental pipeline

`account-pipeline.html` measures an account-based marketing program (ads, mail and sales plays on a named list of target
accounts) the way a revenue team reports it, and against what it causes. In the same simulated company's 4,000-account
segment the team names the 1,000 accounts with the highest fit score plus the reps' read, pairs them within size band by
fit score and draws one of each of 500 pairs at random for a two-quarter program that raises a program account's weekly
chance of opening a deal by 0%, 25% or 50% and changes nothing else. Each company is simulated with and without the program
on the same draws, so the caused pipeline is known exactly; 1,000 companies per effect. Beside the matched-pair read the
page scores influenced and sourced pipeline, a look-alike control outside the list, stage conversion and sales cycle by
recorded source, coverage against an assumed US$2.0M quarter target, and payback by channel, then plants one CRM fault (a
second, program-sourced record of a deal already open on a program account, kept when the two merge) and one check (flag
any opportunity created while another on the same account was open). The design, the overlap test with the nearest
published studies, what is true by construction and the eleven predictions are in `DESIGN-account-pipeline.md`; every rule
is in `abm/protocol.json`, committed before any code and before any company was simulated.

| Figure | No effect | Middle effect (+25%) | Strong effect (+50%) |
|---|---|---|---|
| Caused by the program (the truth) | US$0 | US$634K | US$1.25M |
| Influenced pipeline | US$2.76M | US$3.41M | US$4.04M |
| Sourced pipeline | US$1.67M | US$2.05M | US$2.43M |
| Sourced, fault on | US$3.29M | US$3.89M | US$4.47M |
| Look-alike control | US$538K | US$1.21M | US$1.83M |
| Matched pairs, fault on | US$1.62M | US$2.49M | US$3.32M |
| Matched pairs, checked | -US$5K | US$642K | US$1.25M |
| Matched pairs | -US$4K | US$653K | US$1.28M |
| Matched pairs: interval holds the truth | 894 of 1,000 | 919 of 1,000 | 931 of 1,000 |
| Fault on: interval holds the truth | 138 of 1,000 | 82 of 1,000 | 54 of 1,000 |
| Checked: interval holds the truth | 889 of 1,000 | 913 of 1,000 | 925 of 1,000 |

Influenced pipeline was 5.4 times the caused pipeline at the middle effect and sourced pipeline sat above it in every
company, both by construction. The look-alike control read US$538K when the program caused nothing, above zero in 870 of
1,000 companies, because the list was chosen partly on the reps' read, which no record holds. The matched pairs landed on
the truth and their 90% interval held it in 894, 919 and 931 of 1,000 companies, though one company's read is noisy (its
interval sat wholly above zero in 365 of 1,000 at the middle effect). The fault lifted the matched-pair read to US$1.62M
with no effect (interval holding the truth in 138 of 1,000), nearly doubled sourced pipeline, raised coverage on day 455
by 0.15 to 0.21 times the target, halved the program's sourced payback (9.1 to 4.7 months, median, middle effect) and took
wins from other sources. The check flagged every duplicate, which is true by construction, and genuine second deals were 16%
to 19% of its flags; dropping the flags put the pipeline read back (889, 913 and 925 of 1,000 intervals holding the truth).
Found after the results and not predicted: dropping the flags does not restore won value, because the merge had already
closed each original as lost, so the checked incremental payback never comes in 754 of 1,000 companies at the middle effect
against 244 with no fault. 9 of 11 predictions held; prediction 6 (coverage up by at least 0.2 at every effect) and
prediction 11 (program-sourced wins at least 20% faster; 11% measured) missed. Predictions 1 and 2 and the first half of
prediction 8 were safe bets.

Results: `results-abm.json` (every result), `abm-companies.csv.gz` (each figure for 3,000 companies) and the traced
company's `abm-study-opportunities.csv.gz` and `abm-study-accounts.csv.gz` (gzip). To reproduce (NumPy only, no network;
about a minute per 1,000 companies):

```sh
.venv/bin/python -B -m abm.run study --out runtime/abm                               # refuses an existing study file
for e in 0 1 2; do for s in 0 250 500 750; do
  .venv/bin/python -B -m abm.run part --out runtime/abm --effect $e --companies $s $((s + 250))
done; done
mkdir -p runtime/abm-gather
.venv/bin/python -B -m abm.run gather --out runtime/abm --dest runtime/abm-gather    # refuses existing result files
for f in results-abm.json abm-companies.csv.gz abm-study-opportunities.csv.gz abm-study-accounts.csv.gz; do cmp "runtime/abm-gather/$f" "$f"; done
.venv/bin/python -B -m abm.page --out runtime/account-pipeline.html
cmp runtime/account-pipeline.html account-pipeline.html
.venv/bin/python -B -m pytest -q tests/test_account_pipeline.py
```

## Reproduce

The commands below run from the published copy on its own. It leaves out one file, the workbook `gtm-review.xlsx`,
which carries an earlier page's text; nothing below reads it, and `gtm.run` writes a fresh one into its output folder.
In the published copy the tests skip one check per page test, the one that pages carry no ruled-off text, because its
pattern list is kept private; every other test runs.

Linux, Python 3.12.3 and uv. The hash lock pins every dependency. Package downloads need network access (about 300 MB,
1 GB on disk); the analysis needs none and calls no API.

```sh
uv venv --python 3.12.3 .venv
uv pip sync --python .venv/bin/python --require-hashes requirements.lock
.venv/bin/python -m gtm.run --seed 20261008 --output runtime/reproduction
.venv/bin/python -B -m page.render --root runtime/reproduction --out runtime/reproduction/reader.html
cmp runtime/reproduction/reader.html report.html
.venv/bin/python -B -m pytest -q
.venv/bin/python -B -m balance.check --output runtime/balance
.venv/bin/python -B -m sensitivity.sweep --out runtime/sensitivity.json
cmp runtime/sensitivity.json results-sensitivity.json
.venv/bin/python -B -m selection.flat --out runtime/selection-off.json
cmp runtime/selection-off.json results-selection-off.json
.venv/bin/python -B -m selection.secondary --out runtime/secondary-checks.json
cmp runtime/secondary-checks.json results-secondary-checks.json
.venv/bin/python -B -m selection.match_design --out runtime/match-rate-design.json
cmp runtime/match-rate-design.json results-match-rate-design.json
```

`selection.match_design` reruns the design rule's planning maths for a known ad-exclusion
match rate and fails unless a full match reproduces the frozen design.
`selection.flat` and `selection.secondary` are the checks added after the results (`DESIGN-selection-off.md`). The first
reruns the effect sweep with retargeting's touch weight made flat in buying intent, in a copy of the generator built from
its own source with that one term replaced; it fails unless the published generator reproduces `effect-sweep.csv`. The
second scores the balance check on the channel fields alone and fails unless its plain arm reproduces `balance-check.csv`.
Both refuse to overwrite their output.

`sensitivity.sweep` reruns the test with the spend or the ad-exclusion match rate moved, one at a time, refuses to
overwrite its output, and fails unless the base setting reproduces the main error rates exactly.

`balance.check` runs the balance check against the plain split on the same simulated companies, refuses an existing
output folder, and fails unless its plain arm reproduces `budget-holdout-replications.csv` row for row.

`gtm.run` regenerates every output (event tables, `results.json`, the CSVs, charts and workbook) into a new folder and
refuses to overwrite an existing one. With the final seed it refuses to start unless every analysis file matches
`data/source-freeze.json`, recorded before the final run. `page.render` draws the reader page from a run's results
without changing any number; the run's own `report.html` is its original page, kept for reproduction. The tests use toy
inputs and a development run, so a pass does not prove the final results; the `cmp` line does.

## Files

- `results.json`: every result. `data/manifest.json`: each generated CSV's columns, row count, size and SHA256.
- `effect-sweep.csv`, `holdout-design.csv`, `holdout-operating.csv`, `holdout-study-run.csv` and
  `budget-holdout-replications.csv`: the budget decision, down to every simulated test.
- `balance-check.csv`, `balance-check-replications.csv.gz` (gzip; `balance.check` writes it as plain CSV) and `balance-check.json`: the balance check against the plain
  split at each effect, every balance-checked test, and the full summary with its checks (code in `balance/check.py`).
- `results-sensitivity.json`: the spend and match-rate sweep (code in `sensitivity/sweep.py`).
- `results-selection-off.json` and `results-secondary-checks.json`: the checks added after the results, declared in
  `DESIGN-selection-off.md` (code in `selection/`).
- `results-match-rate-design.json`: the test's length at lower ad-exclusion match rates (code in
  `selection/match_design.py`). Its written plan was committed before the run and is kept with the study's records; it is
  not in the download.
- `incrementality.csv` and `attribution.csv`: credit against caused revenue, and credit by rule.
- `holdout-replications.csv`: the estimator check. `forecast-months.csv` and `forecast-comparison.csv`: a side analysis
  of next-month revenue, not shown on the page.
- `data/raw-leads.csv` and `data/raw-touches.csv` keep injected exact duplicates; the clean tables remove them.
  `data/truth.csv` is simulator-only information that the forecast never sees.
- `gtm-review.xlsx` (not in the published copy): every result table as static values with a reading guide; every cell is
  checked against its source.
- Round 4: `results-linked-claims.json` (every result), `linked-claims-pipelines.csv` (each of the 36 builds),
  `linked-claims-worlds.csv` (each market and build), `linked-claims-sweep.csv` (the assumed rates at half and double),
  `results-linked-claims-posthoc.json` (the readings added after the first results), `linked-claims-runs/` (one file
  per market, which the gather step reads), `linkedclaims/` (code, protocol and the invented terminology) and
  `DESIGN-linked-claims.md`.
- Round 5: `results-sales-motions.json` (every result), `sales-motions-pqa.csv` and `sales-motions-cadence.csv` (each test
  by scenario), `sales-motions-pqa-replications.csv.gz` and `sales-motions-cadence-replications.csv.gz` (every simulated
  test, gzip), `results-sales-motions-trace.json` (one account traced, added after the results), `motions/` (code,
  protocol and its first amendment) and `DESIGN-sales-motions.md`.
- Round 6: `results-lifetime-value.json` (every result), `lifetime-value-budget.csv` (each split per world),
  `lifetime-value-channels.csv` (cohorts against the truth), `lifetime-value-regoal.csv` (quarter targets),
  `lifetime-value-customers.csv.gz` (the order history, gzip), `ltv/` (code, protocol and Change 1 to the protocol) and
  `DESIGN-lifetime-value.md`.
- Round 7: `results-geo-checks.json` (every result), `geo-checks-summary.csv` (each cell and check per world),
  `geo-lag-readout.csv` (the read by lag), `geo-checks-runs.csv.gz` (every run, gzip), `geochecks/` (code, protocol and
  Change 1 to the protocol) and `DESIGN-geo-checks.md`.
- Round 8: `results-partner-programs.json` (every result), `results-partner-programs-first-run.json` (the first run,
  before Change 2), `partner-programs-cells.csv` (each rating, effect and agreement),
  `partner-programs-replications.csv.gz` (every simulated test, gzip), `partners/` (code, protocol and Changes 1 and 2
  to the protocol) and `DESIGN-partner-programs.md`.
- Round 9: `results-geo-budget.json` (every result), `geo-budget.csv` (each world and readout), `geo-budget-runs/` (each
  of the 63 fits with its posterior draws and split), `geobudget/` (code and protocol) and `DESIGN-geo-budget.md`.
- Round 10: `results-abm.json` (every result), `abm-companies.csv.gz` (each figure for 3,000 companies, gzip),
  `abm-study-opportunities.csv.gz` and `abm-study-accounts.csv.gz` (the traced company's records, gzip), `abm/` (code
  and protocol) and `DESIGN-account-pipeline.md`.
- The page uses the vendored design system in `vendor/viz-design-system/` (release 2.3.0, unedited; file hashes in
  `vendor/viz-design-system-adoption.json`). JavaScript runs the theme button, plays the figure under the opening once,
  marks the section in view and, on the website, links the next study. Without it the page shows everything, finished.

Some files are packed in retargeting-holdout-data-1.zip and its sibling parts; unzip them here to restore the full export, which the manifest lists file by file.
