# Pacing and bidding when conversions arrive late

A synthetic study of a buyer of clicks or leads that must hit a return-on-spend target inside a daily budget, when
conversions arrive days after the click and the bidding rule decides which traffic it ever observes. Nine rules run on
the same simulated auctions and are scored against the truth the simulator holds. The page is `index.html`.

Everything is synthetic and assumed; the method carries, the numbers do not. Nothing here comes from running bidding
on a real account, and no ad platform or vendor is named.

## Files

- `DESIGN.md`: the design, written before any rule was compared. `protocol.json`: the frozen parameters.
  `protocol-amendment-1.json` and `protocol-amendment-2.json`: the declared changes to them (a calmer return
  controller; a bid grid centred on the starting bid from the history, auctions in a random order within each hour,
  two more rules, the days at the cap, and a ranking of the estimates from logs by value; the second set was declared
  after a first run's results).
- `results-run1/summary.json`: the summary of that first run, whose bid grid was centred on the informed bidder's
  true-value bid.
- `pdc/`: the world (`world.py`), the rules (`arms.py`), the estimates from logs (`ope.py`), the runs (`run.py`), the
  summary (`summarize.py`), the grid check (`gridcheck.py`) and the page (`report.py`).
- `results/grid-check.json` (the grid check), `results/calibration.json`, `results/cells/` (one file per cell and seed), `results/traces/` (daily records of the
  base cell), `results/summary.json`, and the page's number map (`results/page-numbers.json`,
  `results/page-derived.json`). `page-assumptions.json` holds the one declared assumption of the money section.
- `tests/`: unit tests on small cases, the zero-delay control and the replay tests. `tools/check_numbers.py`: ties every
  number on the page to its source.
- `vendor/`: the site's design system, copied unedited from its release.

## Reproduce

Python 3.12 with the packages in `requirements.lock`. From this folder:

```
python3 -B -m pdc.run calibrate
python3 -B -m pdc.run cells
python3 -B -m pdc.run summarize
python3 -B -m pdc.gridcheck
python3 -B -m pdc.report
python3 -B -m pytest tests -q
python3 -I tools/check_numbers.py
```

Each command ends with a `VERDICT:` line. The replay tests rebuild a base seed, a sweep seed, the summary and the
calibration and compare them with the files here byte for byte.

`python3 -B -m pdc.report` and `python3 -I tools/check_numbers.py` read files that are not in this download; they
need the full project.

Some files are packed in pacing-delayed-conversions-data-1.zip; unzip it here to restore the full export, which the manifest lists file by file.
