Skip to content

Account for arm selection in switch-rate confidence intervals - #3

Open
infinityscroll wants to merge 1 commit into
HumeAI:mainfrom
infinityscroll:fix/simultaneous-switch-interval
Open

infinityscroll wants to merge 1 commit into
HumeAI:mainfrom
infinityscroll:fix/simultaneous-switch-interval

Conversation

@infinityscroll

Copy link
Copy Markdown

The switch score is the minimum observed arm rate, but its interval currently belongs only to whichever arm attains that minimum. With tied rates such as 5/10 and 50/100, reversing arm labels can change the reported interval without changing the data or estimand.

This adds simultaneous Clopper–Pearson bounds and takes the minimum lower and upper endpoints. Each required arm receives a two-sided error budget of 0.05/m. The construction gives at least 95% coverage under fixed-arm marginal binomial sampling; it does not require independence between arms, and it does not address within-arm clustering or post-hoc selection of families/models. The implementation stays standard-library-only.

The default rejects incomplete required-arm sets. legacy-wilson preserves the historical behavior, and repro/precompute_cells.py explicitly selects that mode. Point estimates and tallies remain unchanged for complete arm sets; shipped paper data and figure sources are untouched. CLI JSON records the interval method.

Validation: all 85 tests pass, including the published reference-disagreement replay; Ruff and git diff --check pass. Added tests cover binomial boundaries, exact finite-sample enumeration, tied-arm order invariance, missing arms, legacy equivalence and CLI serialization. An independent local comparison against SciPy exact binomial intervals passed 34 boundary/central cases up to n=100,000, with maximum absolute endpoint difference 2.83e-14. This numerical comparison is not a machine-verified coverage proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant