Implementation of one-sample, paired and independent two-sample t-tests declared in sts_ttest.h. More...

Go to the source code of this file.
Implementation of one-sample, paired and independent two-sample t-tests declared in sts_ttest.h.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
One-sample and paired variants compute the column-wise sample mean and unbiased standard deviation in two Eigen reductions and form \(t = (\bar{x}-\mu)/(s/\sqrt{n})\) on n-1 degrees of freedom; the paired test reduces to the one-sample test on the difference A-B. The independent two-sample test assumes equal variances and uses the pooled standard deviation with n_A+n_B-2 degrees of freedom.
Tail-specific p-values come from the exact Student-t CDF, expressed through the regularised incomplete beta function and evaluated with a Lentz continued-fraction recursion plus a logGamma-based normaliser so the tails stay numerically stable for very large df.
Definition in file sts_ttest.cpp.