ppad-eproc-0.5.5: Anytime-valid sequential testing via e-processes.
Copyright(c) 2026 Jared Tobin
LicenseMIT
MaintainerJared Tobin <jared@ppad.tech>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.Eproc.Merge

Description

Merging e-values, and choosing among the hypotheses they test.

An e-value for a null H_0 is a nonnegative statistic E with E[E] <= 1 under H_0. Two ways of merging them keep that property:

  • The mean of any e-values for one null is an e-value for it, however they depend on one another (log_mean): the merge a test over several observables makes, paying a factor of their number.
  • The product of e-values each valid given those before it (for instance, computed on independent data) is an e-value (log_product): the merge of a test continued on fresh data.

An e-process evaluated at a stopping time is an e-value, so both apply to e-processes stopped when the caller likes.

Given e-values for several nulls, one each, ebh chooses which to reject: the e-BH procedure of Wang & Ramdas (2022), whose false discovery rate is at most its level under any dependence between the e-values.

Every function here takes and returns e-values as their natural logarithms, as the test modules' log_evalue accessors report them.

Synopsis

Documentation

log_mean :: [Double] -> Double Source #

The log of the mean of e-values given as logs: an e-value for the null they share, whatever their dependence. The mean of no e-values is taken to be one.

>>> round (exp (log_mean [log 2, log 4]) * 1000)
3000
>>> log_mean []
0.0
>>> log_mean [1 / 0, 0]
Infinity

log_product :: [Double] -> Double Source #

The log of the product of e-values given as logs: an e-value where each is valid given those before it.

>>> log_product [log 2, log 3] == log 6
True

ebh :: Double -> [Double] -> [Int] Source #

The e-BH discoveries at a level among e-values, one per null, given as logs: the indices of the k largest, for the largest k whose k-th largest e-value is at least n / (alpha k), for n of them, in decreasing order of e-value. The expected share of discoveries whose null holds is at most alpha, under any dependence between the e-values.

>>> ebh 0.1 [log 100, 0, log 14]
[0]
>>> ebh 0.1 [log 100, 0, log 15]
[0,2]