Library / Code module
Anytime-valid confidence sequence for a bounded mean
anytime_confidence_sequence
Give confidence intervals for the mean of bounded observations that hold at every time simultaneously, so results can be monitored after each run and stopped at any point. Includes a Hoeffding union-bound sequence, a betting (hedged capital) sequence and a seeded coverage simulation.
ATTRIBUTION.md3.9 KBLICENSE1.0 KBREADME.md3.5 KBanytime_confidence_sequence.py10.9 KBatom_cli.py3.0 KBcomponent.json11.5 KBnumerics.py28.0 KBschema_lite.py8.9 KBtest_anytime_confidence_sequence.py4.1 KBtest_package.py12.0 KB
Full files in your harness.
What it takes and gives
- Runs with
- Python 3.10 or later
- Entry points
- hoeffding_sequence, betting_sequence, pointwise_wilson_sequence, coverage_simulation
- Known answers
- 6 cases its tests reproduce
Cases it covers
- peeking is not anytime valid: A fixed-sample 90 percent interval checked after every observation misses the mean at some time in about 66 percent of these runs.
Limits and scope
- Limits
- Means of bounded observations only; the bounds must be known in advance. The Hoeffding sequence is conservative; the betting sequence is tighter but costs grid x n operations and is meant for up to a few thousand observations. Grid reporting rounds intervals outward by at most one cell. Guarantees need a constant conditional mean; under drift the sequence covers no single target.
- Guarantees
- hoeffding: P(mu leaves the interval at some t) <= alpha, by Hoeffding's inequality at level alpha / (t (t + 1)) and a union bound. betting: the averaged capital (K+ + K-) / 2 at the true mean is a non-negative martingale, so P(it ever reaches 1 / alpha) <= alpha by Ville's inequality; the reported intervals contain every candidate mean the capital never rejects. Running intersections keep the simultaneous guarantee; empty_at records a time when the intersection would have become empty.
- Assumes
- Observations lie in the stated bounds and share one conditional mean given the past (for example independent and identically distributed). The level alpha is fixed before looking at the data.
Details
- Kind
- Code module
- Licence
- MIT
- Declared effects
- runs commands
- Source
- github.com/alisonjieli-png/loop-engine/tools/creative_originals/evaluation_atoms/items/anytime_confidence_sequence
- Size
- 10 files, 87.0 KB
- Identity
library.supply.creative_originals.bbe09180a8d78f621c60fe21.84f408d3c7d3573c- Version
84f408d3c7d3573c17b6497e49b8208522840d5ab05856923376d9333c16e93f
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Where it is shown
- Statistics for comparing resultsDeterministic skills
Related components
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.