Metadata-Version: 2.4
Name: methodeutics
Version: 0.1.0
Summary: E-value bankrolls: anytime-valid evidence as a running bet against your hypothesis
Project-URL: Homepage, https://june.kim/reading/methodeutics/
Project-URL: Textbook, https://june.kim/reading/methodeutics/ch10-e-values/
Author-email: June Kim <kimjune01@gmail.com>
License: AGPL-3.0-or-later
License-File: LICENSE
Keywords: abduction,anytime-valid,e-values,martingale,sequential testing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.9
Provides-Extra: plot
Requires-Dist: matplotlib>=3.5; extra == 'plot'
Description-Content-Type: text/markdown

# methodeutics

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

```python
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.

```python
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](https://june.kim/reading/methodeutics/), 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](https://github.com/gostevehoward/confseq) (confidence
sequences, the reference implementation), [expectation](https://github.com/jakorostami/expectation)
(a fuller e-process library), [savvi](https://github.com/assuncaolfi/savvi)
(anytime-valid inference for specific models).

AGPL-3.0-or-later license.
