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

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

#include "sts_ttest.h"
#include <cmath>
#include <algorithm>
Include dependency graph for sts_ttest.cpp:

Go to the source code of this file.

Detailed Description

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

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

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.