savvi
savvi is a package for Safe Anytime Valid Inference (SAVI). Also, it’s a savvy pun.
The goal of this package is to provide methods to calculate confidence intervals and p-values that are valid at all sample sizes.
More formally, given a significance level \(\alpha \in [0, 1]\), a \((1 - \alpha)\) confidence sequence for parameters \(\theta \in \mathbb{R}^p\) is a sequence of intervals \(C_n\) such that
\[P(\forall n \geq 1 : \theta \notin C_n) \leq \alpha.\]
\(p_n\) is an anytime-valid p-value for that process if
\[P(\forall n \geq 1 : p_n \leq \alpha) \leq \alpha.\]
See Ramdas et al. (2023).
Install
Stable version:
pip install savvi
Development version:
pip install git+https://github.com/assuncaolfi/savvi
For development, use pdm.
Get started
See the example gallery.
References
Ramdas, Aaditya, Peter Grünwald, Vladimir Vovk, and Glenn Shafer. 2023. “Game-Theoretic Statistics and Safe Anytime-Valid Inference.” https://arxiv.org/abs/2210.01948.