# What this simulation can tell you

This is a synthetic capacity and matching model for comparing randomization designs.
Its results are conditional on the assumptions below and do not describe a real marketplace.

## Population and policy target

The city has 16 regions on a 4 by 4 grid, with four driver catchments per region.
Each request originates at its home driver's catchment centroid. A driver can complete a
limited number of rides in each slot. These are batch counts, with no route, trip duration,
retention, price elasticity or passenger waiting-time model.

The incentive adds up to one expected ride of capacity per driver per slot. Random rounding
uses the same uniform draws in every counterfactual. It is a supply intervention, not a fare
or profit model. Driver quality, catchment popularity, region/time shocks, rider demand,
baseline capacity, rounding and matching priority are drawn before assignment.

An experiment spans eight blocks of three slots. The first slot of every block is excluded
from the primary outcome for every design and both policy worlds. The primary outcome is
the total completed rides in the same 16 scored slots across the entire city. Excluded slots
still advance the carryover state. The policy contrast is the difference between all drivers
treated throughout the experiment and all drivers controlled, starting from an all-control
prehistory. Both worlds share all exogenous randomness. This is a finite-window contrast;
it is not a steady-state effect.

## Six declared scenarios

Each mechanism is run at zero incentive and at the specified positive incentive. Scenario
parameters are assumptions, not estimates from employer or public trip data.

| Mechanism | Matching | Persistence |
|---|---|---|
| No interference | Requests can use only their home driver | Current assignment only |
| Spillovers | Overflow requests can use nearby spare capacity | Current assignment only |
| Carryover | Requests can use only their home driver | Geometric state with coefficient 0.7 |

In the spillover scenario, unserved requests are considered in a fixed exogenous source
order, then offered to drivers in distance order within a radius of 1.25 grid units.
Region centers are 1.4 units apart, with driver offsets of 0.3 units in both coordinates.
Nearby matches can cross region borders. A completed ride is attributed to its serving
driver, with origin counts retained to check conservation. This explicitly allows a treated
driver to take work that another driver could have served. It is a greedy batch matcher,
not a globally optimal dispatch system. Spillovers and carryover are examined separately;
their combination is outside this run.

Carryover follows state[t] = 0.3 * assignment[t] + 0.7 * state[t-1], from state[-1] = 0.
The excluded first slot is a one-slot washout attempt, not a claim that the geometric tail
has disappeared. Static assignments have a startup transient; switchbacks also have repeated
transitions.

## Designs and what their contrasts mean

| Design | Assignment | Estimator and uncertainty | Interpretation |
|---|---|---|---|
| Driver A/B | Half of all drivers treated for the full experiment | Driver totals; city-scaled difference in means with Welch uncertainty | A mixed-market driver contrast |
| Driver A/B with CUPED | Exactly the same A/B assignment and observed outcomes | Adjust each driver total with a pretreatment predictor, then use the same estimator | Same mixed-market contrast, with a variance adjustment |
| Region cluster | Half the regions treated, with all their drivers following that assignment | Region totals; city-scaled difference in means with Welch uncertainty | A mixed-region policy contrast |
| Region/time switchback | Each region and adjacent block pair independently receives AB or BA | Twice the signed block totals; uncertainty clustered by region with 15 degrees of freedom | A contrast between alternating policies under the declared history |

Driver A/B and region cluster are complete randomizations with fixed arm sizes. The paired
switchback assignment balances each adjacent block pair. Its region clustering keeps repeated
pairs together; the individual AB/BA pairs are the randomization units. No ride-level
independence assumption enters an interval.

Without interference or carryover, these contrasts target the all-treated policy difference.
With spillovers, treating a driver or region while other units remain mixed can change its
outcome differently from treating the whole city. With carryover, current assignment does
not specify exposure history. The reported mean estimate minus paired policy truth is
therefore labeled **policy gap**. It is bias against the global policy target and can contain
an estimand mismatch. It is not evidence that an otherwise valid estimator is biased for
its own randomized contrast.

The confidence intervals are ordinary design-based approximations in the clean scenario.
They do not adjust away cross-region spillovers or misspecified carryover. Coverage of the
paired global policy truth under those scenarios is an empirical stress test, not a promise
of valid policy inference. The simple AB/BA schedule here is not an implementation of the
optimal switchback design in the cited paper.

## CUPED without post-treatment leakage

Three separate pretreatment windows have the same duration as the scored experiment. Fit
theta = cov(window 1, window 2) / var(window 1) across drivers. Use window 3 as the
covariate, center it at its city mean, and subtract that centered value scaled by theta from each observed driver total.
If training variance is zero, theta is zero. Assignment and post-treatment outcomes are not
arguments to the fitting function. The adjustment can reduce variance, increase variance,
or leave it unchanged; it cannot remove interference.

## Frozen collection and Monte Carlo reporting

The runtime pilot uses seed 90007 and 10 replications. It reports time and row counts only.
Before any final outcomes are inspected, choose 500 replications if projected collection
is at most 600 seconds; otherwise choose 250 if it fits; otherwise stop and optimize.
The grid, scenarios, replication count, seed and source hashes are then frozen in
data/protocol.json. Final seed 7 selects independent replication streams, with separate
spawn keys for exogenous worlds and assignments. The same worlds and assignments are
shared across scenarios and methods to support paired comparisons.

Every scenario/design report includes the mean paired truth, mean estimate, policy gap,
estimate variance, coverage of each replication's paired policy truth, and rejection of zero.
Rejection is a false-positive rate for null scenarios and power for positive scenarios.
Coverage and rejection use Wilson Monte Carlo intervals; mean gaps use Student intervals
over replications. Variance intervals and CUPED variance-reduction intervals use 1,000
bootstrap resamples of replications. CUPED ratios resample A/B and adjusted A/B together.
These intervals describe Monte Carlo uncertainty under this simulator, not uncertainty
about a real city. Methods and scenarios share draws, so their summaries are correlated.

Predeclared checks include a separate 2,000-experiment Gaussian reference with type-I rate
between 0.025 and 0.075 and coverage between 0.925 and 0.975. These bands exceed five Monte
Carlo standard errors around the nominal rates and catch vacuous or broken intervals.
In the actual null scenarios, rejection must be no more than
0.05 + 4 * sqrt(0.05 * 0.95 / replications) + 0.02; the final term allows finite-cluster
approximation error. Null policy truth must equal zero exactly. In no-interference scenarios,
the absolute mean policy gap must be at most four Monte Carlo standard errors plus 0.1
ride for numerical slack. An unexpected failure is investigated and retained, never removed
by choosing a more favorable final seed.

## Method references

[Deng, Xu, Kohavi and Walker, WSDM 2013](https://exp-platform.com/Documents/2013-02-CUPED-ImprovingSensitivityOfControlledExperiments.pdf)
derive the control-variate adjustment and discuss pretreatment covariates. This implementation
uses a separate pretreatment fit to make its information boundary explicit.

[Bojinov, Simchi-Levi and Zhao, Design and Analysis of Switchback Experiments](https://arxiv.org/abs/2009.00148)
show why carryover assumptions matter to switchback design and inference. Their work motivates
the explicit history stress test here; the simulator does not claim their optimality results.
