v2.0.0
Loading...
Searching...
No Matches
sts_correction.cpp File Reference

Implementation of Bonferroni, Holm-Bonferroni and Benjamini-Hochberg FDR corrections declared in sts_correction.h. More...

#include "sts_correction.h"
#include <algorithm>
#include <numeric>
#include <vector>
#include <cmath>
Include dependency graph for sts_correction.cpp:

Go to the source code of this file.

Detailed Description

Implementation of Bonferroni, Holm-Bonferroni and Benjamini-Hochberg FDR corrections declared in sts_correction.h.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.0
Date
April 2026

Bonferroni is a constant rescale by n followed by a cwiseMin(1). Holm-Bonferroni flattens the p-value matrix, sorts ascending and walks the ranks computing \(p^*_{(i)} = (n-i+1)\, p_{(i)}\) with the cumulative-maximum enforcement that keeps the sequence monotone; results are then scattered back to the original (channel, time) layout. Benjamini-Hochberg FDR uses the conjugate step-up recursion \(p^*_{(i)} = \min_{k\ge i} \tfrac{n}{k}\, p_{(k)}\), capped at 1.

Definition in file sts_correction.cpp.