Skip to main content

Online FDR: Online False Discovery Rate Control Algorithms

python License CI PyPI

online-fdr is a Python package for multiple testing when hypotheses arrive over time or in batches. It provides p-value and e-value procedures for false discovery rate (FDR) and family-wise error rate (FWER) control.

The package focuses on small stateful objects:

  • sequential methods use test_one(...)
  • batch methods use test_batch(...)
  • method state exposes the target level, current threshold, and number of processed tests where applicable

Installation

pip install online-fdr

For development:

git clone https://github.com/OliverHennhoefer/online-fdr.git
cd online-fdr
uv sync --group dev

Live parity tests also need R 4.5.x, Bioconductor onlineFDR==2.18.0, and the parity dependency group; see docs/installation.md and tests/reference/README.md.

P-values

Sequential p-value methods make one decision per incoming p-value.

from online_fdr.p_values import Addis

p_values = [0.20, 0.004, 0.32, 0.018, 0.60, 0.0007]
method = Addis(alpha=0.05, wealth=0.025, lambda_=0.25, tau=0.5)

decisions = [method.test_one(p_value) for p_value in p_values]

print("ADDIS sequential p-value test")
print(f"Tests processed: {method.num_hypotheses}")
print(f"Discoveries: {sum(decisions)}")
print(f"Decisions: {decisions}")

Batch methods test a group of p-values at once.

from online_fdr.p_values import BatchStoreyBH

p_values = [0.001, 0.012, 0.20, 0.40, 0.006, 0.70]
method = BatchStoreyBH(alpha=0.10, lambda_=0.5)

decisions = method.test_batch(p_values)

print("Batch Storey-BH p-value test")
print(f"Batch threshold: {method.last_rejection_threshold:.6f}")
print(f"Discoveries: {sum(decisions)} of {len(decisions)}")
print(f"Decisions: {decisions}")

E-values

E-value methods use evidence values where larger values are stronger evidence against the null.

from online_fdr.e_values import EBH, ELond

batch = EBH(alpha=0.10)
e_values = [1.0, 4.0, 80.0, 12.0, 0.5, 25.0]
batch_decisions = batch.test_batch(e_values)

stream = ELond(alpha=0.10)
stream_decisions = [stream.test_one(e_value) for e_value in [250.0, 40.0, 500.0]]

print("e-BH batch test")
print(f"Discoveries: {sum(batch_decisions)} of {len(batch_decisions)}")
print(f"Decisions: {batch_decisions}")
print("")
print("e-LOND sequential test")
print(f"Tests processed: {stream.num_hypotheses}")
print(f"Discoveries: {sum(stream_decisions)}")
print(f"Decisions: {stream_decisions}")

Methods

P-value procedures:

  • sequential: ADDIS, SAFFRON, GAI, weighted GAI++, LOND, LORD variants, alpha-spending, online fallback, and a naive baseline
  • asynchronous: ADDIS and SAFFRON lifecycle APIs
  • batch: BatchBH, BatchStoreyBH, BatchPRDS, BatchBY, BatchBHOfficial, and TOAD

E-value procedures and tools:

  • e-BH and e-LOND
  • p-to-e calibration, e-to-p conversion, e-value merging
  • likelihood-ratio and betting e-process helpers

Examples

The examples/ notebooks are short demonstrations of individual procedures:

  • examples/addis.ipynb
  • examples/alpha_spend.ipynb
  • examples/batch_storey_bh.ipynb
  • examples/e_value.ipynb
  • examples/lord_mem_decay.ipynb
  • examples/naive.ipynb
  • examples/weight_decay.ipynb

Guarantees and parity

Statistical guarantees are method-specific and depend on the assumptions of the underlying procedure. The guarantee matrix in docs/theory/guarantee_matrix.md summarizes which methods are proven, parity-tested against Bioconductor onlineFDR, or implemented as package extensions.

The live parity suite compares overlapping p-value methods against Bioconductor onlineFDR==2.18.0 through rpy2. CI runs this suite with the pinned R package; local setup instructions are in tests/reference/README.md.

Documentation

  • Installation: docs/installation.md
  • User guide: docs/user_guide/index.md
  • API reference: docs/api/index.md
  • Theory and guarantees: docs/theory/index.md
  • Release process: docs/release.md

License

This project is licensed under the BSD 3-Clause License. See LICENSE for details.

Metadata

Release files for online-fdr 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for online-fdr 1.0.0
File Size Uploaded Provenance Actions
online_fdr-1.0.0.tar.gz 54.5 kB With provenance Details for online_fdr-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for online-fdr 1.0.0
File Interpreter ABI Platform Actions
online_fdr-1.0.0-py3-none-any.whl Python 3 none any Details for online_fdr-1.0.0-py3-none-any.whl

Total release size: 139.2 kB

Release files / online_fdr-1.0.0.tar.gz

Download URL online_fdr-1.0.0.tar.gz
Size 54.5 kB
Tags Source
SHA-256 checksum
How to use checksums
60c1c461521a1bbb72d319974158409706da3fef754f0e84ec67cdde9fe185e3
BLAKE2b-256 checksum
How to use checksums
aec5ec53f5196ca2f2c3fcc8408d44747555512d3c8f4222160a664679dbb318
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Release files / online_fdr-1.0.0-py3-none-any.whl

Download URL online_fdr-1.0.0-py3-none-any.whl
Size 84.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1134c1627620d26fc11f1705c4be8fdbc35cc4fb4c7bcc8d36455285dc9ecfbb
BLAKE2b-256 checksum
How to use checksums
00662eac83b528616cdffedadbb351624398441d65f263a808b5f1d0d7aad529
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

Security for online-fdr 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for online_fdr-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page