Skip to main content

E-value bankrolls: anytime-valid evidence as a running bet against your hypothesis

Project description

methodeutics

Anytime-valid evidence as a running bet. The e-value bankroll, in three lines:

from methodeutics import Bankroll, bernoulli

b = Bankroll(bernoulli(p0=0.5, p1=0.6), alpha=0.05).extend(observations)
b.plot()  # pip install methodeutics[plot]

Start with one dollar. Each observation multiplies your bankroll by the likelihood ratio the alternative assigns against the null. If the null is true, no strategy grows the dollar on average, and the bankroll crosses 1/alpha with probability at most alpha, no matter when or how often you look (Ville's inequality). If the null is false, the bankroll compounds. Look every day. Stop whenever you want. The guarantee holds.

b.e           # current e-value
b.trajectory  # e-value after each observation
b.threshold   # 1/alpha, pre-committed
b.decided     # crossed the threshold? (remembered even if it later falls)
b.compose(b2) # evidence from an independent bankroll: multiply, no correction

Models: normal(null_mean, alt_mean, sd), bernoulli(p0, p1), categorical(null, alt), or any callable lr(x) returning a likelihood ratio.

This is the companion package to chapters 9-10 of the Methodeutics textbook, where the bankroll is derived from scratch and the three guarantees (anytime validity, optional stopping, composition) are stated with their lineage: Ville 1939, Doob 1953, Shafer 2021, Ramdas 2023, Grünwald 2024.

Not the epidemiology E-value (VanderWeele & Ding's sensitivity-analysis quantity). Same letter, unrelated concept.

See also: confseq (confidence sequences, the reference implementation), expectation (a fuller e-process library), savvi (anytime-valid inference for specific models).

AGPL-3.0-or-later license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

methodeutics-0.1.0.tar.gz (134.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

methodeutics-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file methodeutics-0.1.0.tar.gz.

File metadata

  • Download URL: methodeutics-0.1.0.tar.gz
  • Upload date:
  • Size: 134.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for methodeutics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 18b705805b4879d19abc4b2a7a5f7f819b0e24bd40c5a00098c1e5dc596649b2
MD5 0137d43288f5a573673c48b518cdd713
BLAKE2b-256 fcc2aa6a0f6c26f8998d855cb37f4b40bf0775d8bf11dd3b1476e08a2bf1a48a

See more details on using hashes here.

File details

Details for the file methodeutics-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: methodeutics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for methodeutics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c9fb27ea4089ca0db499a1fd9f7da26079c87dbf59ec3804ed645b2cd92c207
MD5 7f9870bbd0c302e8bae7c4cc1f611e3a
BLAKE2b-256 f15f6d547ba7130ae61191f0a071b1a9719bf0dae336faaac0129fba56fff4c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page