# A geo test that checks itself: design

Written before any code of this part existed and before any test, check, break or lift read of this part was computed.
Every number below is in `geochecks/protocol.json`, which this note explains; if the two disagree, the protocol is the
record.

## What this part adds

Round 2 (`media-mix.html`) ran one geo test to calibrate its media mix model: paid search switched off in half of 40
regions for 8 or 10 weeks, read once at the end. It assumed the test ran as planned and that every conversion was
booked by the readout. A team running such tests in production needs two more things: daily checks that the running test
is still valid, and a readout that knows how much of the test's value has not arrived yet. This part asks:

1. When a geo test breaks in one of four stated ways, which daily check flags it, after how many days, and how often
   does each check flag a test that is fine?
2. How far does the lift read drift when a break goes unflagged, or is read anyway?
3. What does reading the test before its conversions have arrived do to the lift and its 90% interval, and does
   waiting fix it?

Overlap with other published studies, checked before this design: the pacing study (`pacing-delayed-conversions`)
covers delay curves for bidding: how a bidder that sees conversions late should pace and value traffic, and how to
correct a recent return figure for value still to arrive. This part does not rebuild that. It keeps only what a geo
readout needs: the share of the test's value still to arrive at readout, and what an early read does to the lift and
its interval; the page links the pacing study for the rest. The marketplace experiments study covers test designs that
mislead under carryover between periods, not a running test's validity. Round 2 of this study is the nearest: same
company, regions, worlds and estimator, and this part reuses them unchanged.

## The test, day by day

- **Regions and worlds.** Round 2's nine worlds and 40 regions with their revenue shares. In every world round 2's
  geo test went to paid search; it ran 10 weeks (8 in one world) after 26 weeks of history. Each of 400 runs per world
  draws a new random split into 20 held-out regions (search off) and 20 live regions.
- **Days.** Each region's revenue is generated by the day a conversion happens: before the test, round 2's weekly
  national value spread over its seven days; during the test, the baseline and the other four channels at their usual
  spend, plus paid search per arm from a daily version of round 2's carryover and saturation (the weekly carryover
  rate taken to the power 1/7 per day, the same true saturation).
- **Lag.** A conversion is booked some days later: a gamma lag of shape 2. A healthy test has a mean lag of 3 days. The
  team knows its lag curve only from a sample of 400 past conversions. Rough arithmetic before any run: a 70-day test
  books about 96% of its caused value by readout at a 3-day lag, about 58% at 30 days and about 32% at 60 days.
- **Truth.** The value paid search causes at plan per test week, counted by conversion day: the national difference
  between search at plan everywhere and search off everywhere, over the test days. The same in every run of a world.
- **Read.** Round 2's estimator at daily resolution: each region's mean booked revenue in the test minus its
  pre-period mean, the live arm over its share minus the held-out arm over its share, with round 2's standard error and
  a 90% interval. Every run is read at its planned readout, flagged or not.

## The breaks

Each starts on a day drawn from 8 to 21 of the test (the same day for every break of a run) and lasts to the readout,
except the lag, which is there from launch.

1. **Spend leaking into the held-out regions:** 10% of the planned spend runs there (a campaign without the regional
   exclusion). A healthy test already shows about 1% there, because location matching is never perfect.
2. **A regional demand shock:** 6 regions drawn at random lose 20% of their conversion value and of their
   existing-customer revenue.
3. **A pacing change in one arm:** the live regions spend 70% of plan.
4. **Conversion lag longer than the readout window allows:** a mean lag of 60 days. A sweep runs healthy tests at
   mean lags of 3, 7, 14, 30, 60 and 90 days.

## The checks

Written before any run. A flag is recorded, never acted on.

1. **Balance at launch:** the gap between the arms' pre-period weekly revenue (each over its share), regressed on
   week; flag when the slope's p-value is below 0.05. In this generator the regions share one national trend, so this
   check can only flag noise, about 5% of the time by construction.
2. **Spend in the held-out regions:** the last three days' search spend there, against what plan would spend with
   search on; flag above 5%.
3. **Pacing against plan:** the live regions' last three days of spend against plan; flag below 80% or above 120%.
4. **Share still to arrive at readout:** from the 400-conversion lag curve, the share of the test's conversion value
   that will not be booked by the planned readout; flag above 10%. It runs at launch.
5. **A revenue the ads cannot move:** existing-customer revenue in the same regions, read with the test's own
   estimator from launch to today; flag when it moves more than 3 standard errors. The four checks above cannot see a
   demand shock (it moves no spend, no lag and no history), so this one was added to the list for that break.

## Measures

For each check and break: the share of runs flagged by readout, and the days from the break's start to the first flag
(median and 90th percentile). On healthy tests: how often each check, and any check, flags. For each break: the drift of
the read (read over truth minus 1) in every run, and in runs no check flagged; the 90% interval's coverage. For the lag
sweep: the true and estimated share still to arrive at readout, the planned read against the truth and its coverage,
and a read that waits after the test until under 5% is still to arrive (capped at 26 weeks): its wait, its read and its
coverage. The worked example is the shock run picked by a rule stated in the protocol (the median world by true lift,
its first run in which the revenue check flagged).

## Predictions

Written before any run; each scored as stated in the protocol:

1. On healthy tests, at least one check flags in at most 15% of runs, in every world.
2. On healthy tests, the 90% interval holds the true lift in at least 80% of runs, in every world.
3. The spend check flags the leak within 3 days in at least 95% of leak runs, in every world.
4. The pacing check flags the pacing change within 5 days in at least 95% of runs, in every world.
5. The revenue check flags the demand shock before readout in 10% to 60% of shock runs, pooled.
6. Among shock runs, unflagged runs drift less (median absolute drift) than runs the revenue check flagged, in at
   least 7 of 9 worlds.
7. With the 60-day lag, the planned read's median is below 50% of the true lift in every world, and its interval
   holds the truth in at most 20% of runs, pooled.
8. The share-still-to-arrive check flags at launch in at least 99% of 60-day-lag runs and at most 1% of healthy runs.
9. Waiting until under 5% is still to arrive brings coverage to at least 80% at mean lags of 7, 14 and 30 days.
10. Read anyway, the leak and the pacing change each understate the lift (negative median drift) in every world.

## What it does not do

One break at a time, each at one size. No check acts on its flag, so the drift shown is what a team that ignored it
would read. The checks see spend and revenue by region and day; no check sees individual users. The regions share one
national trend apart from the shock, which flatters the balance check. The read that waits is one simple fix; the pacing
study shows how to correct a read for value still to arrive. The round 2 model is not refitted with these reads. One
run on the study's fixed random streams; no paid model calls.
