Baltor Get started

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.

Files, names only

  • ATTRIBUTION.md 3.9 KB
  • LICENSE 1.0 KB
  • README.md 3.5 KB
  • anytime_confidence_sequence.py 10.9 KB
  • atom_cli.py 3.0 KB
  • component.json 11.5 KB
  • numerics.py 28.0 KB
  • schema_lite.py 8.9 KB
  • test_anytime_confidence_sequence.py 4.1 KB
  • test_package.py 12.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

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.