stats.comparison.holm_adjust(p_values)
Adjust p-values for multiple testing with the Holm step-down method.
Sorts the raw p-values ascending (stable sort), multiplies the i-th smallest by m - i remaining hypotheses, enforces monotonicity with a running maximum, and caps at 1.0.
i
m - i
p_values
import pandas as pd from spotforecast2_safe.stats.comparison import holm_adjust raw = pd.Series([0.01, 0.02, 0.03, 0.04], index=list("abcd")) adjusted = holm_adjust(raw) print(adjusted.to_string()) assert list(adjusted) == [0.04, 0.06, 0.06, 0.06]
a 0.04 b 0.06 c 0.06 d 0.06