Stats 0.2.0 multiplecomparisons benjaminiyekutieli - CyrilB1531/lodestar GitHub Wiki

Lodestar.Stats 0.2.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

MultipleComparisons.BenjaminiYekutieli

The Benjamini-Yekutieli procedure, valid under any dependence.

public static double[] BenjaminiYekutieli(ReadOnlySpan<double> pValues)

ParameterspValues is the family, at least one value, each in [0, 1]; the span is read, never modified.

Returnsdouble[]: the adjusted p-values, in the input's own order.

ExceptionsArgumentException when pValues is empty. ArgumentOutOfRangeException when a value is NaN or outside [0, 1].

Example — the same five p-values Bonferroni adjusts.

using Lodestar.Stats;

double[] family = [0.001, 0.008, 0.039, 0.041, 0.042];
double[] adjusted = MultipleComparisons.BenjaminiYekutieli(family);

double smallest = Math.Round(adjusted[0], 6);   // => 0.011417
double largest = Math.Round(adjusted[4], 6);    // => 0.0959

RemarksBenjaminiHochberg assumes the tests are independent or positively dependent; this drops that assumption and is valid under any dependence structure at all, at the price of a harmonic-sum factor, 1 + 1/2 + ... + 1/n, that multiplies every adjustment. Its values are never smaller than Benjamini-Hochberg's on the same family — here, 0.0959 against 0.042 on the largest raw p-value — which is the cost of not needing to know how the tests relate to each other.

Applies to — net10.0, netstandard2.0.

See alsoMultipleComparisons.Bonferroni, MultipleComparisons.BenjaminiHochberg, the Python equivalence table.

⚠️ **GitHub.com Fallback** ⚠️