v2.0.0
Loading...
Searching...
No Matches
sts_ttest.h
Go to the documentation of this file.
1//=============================================================================================================
32
33#ifndef STS_TTEST_H
34#define STS_TTEST_H
35
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
40#include "sts_global.h"
41#include "sts_types.h"
42
43//=============================================================================================================
44// EIGEN INCLUDES
45//=============================================================================================================
46
47#include <Eigen/Core>
48
49//=============================================================================================================
50// DEFINE NAMESPACE STSLIB
51//=============================================================================================================
52
53namespace STSLIB
54{
55
56//=============================================================================================================
63 Eigen::MatrixXd matTstat;
64 Eigen::MatrixXd matPval;
66};
67
68//=============================================================================================================
75{
76public:
77 //=========================================================================================================
87 static StatsTtestResult oneSample(const Eigen::MatrixXd& data,
88 double mu = 0.0,
90
91 //=========================================================================================================
101 static StatsTtestResult paired(const Eigen::MatrixXd& dataA,
102 const Eigen::MatrixXd& dataB,
104
105 //=========================================================================================================
115 static StatsTtestResult independent(const Eigen::MatrixXd& dataA,
116 const Eigen::MatrixXd& dataB,
118
119 //=========================================================================================================
128 static double tCdf(double t, int df);
129
130 //=========================================================================================================
135 static double regularizedBeta(double x, double a, double b);
136
137private:
138
139 //=========================================================================================================
143 static double betaCf(double x, double a, double b);
144
145 //=========================================================================================================
149 static double logBeta(double a, double b);
150
151 //=========================================================================================================
155 static double tToPval(double t, int df, StatsTailType tail);
156};
157
158} // namespace STSLIB
159
160#endif // STS_TTEST_H
Shared enumerations describing tail direction and multiple-comparison correction strategy.
STSLIB shared-library export macro and build-info accessors for the statistical-tests library.
#define STSSHARED_EXPORT
Definition sts_global.h:44
Statistical testing (t-tests, F-tests, cluster permutation, multiple comparison correction).
StatsTailType
Direction of the alternative hypothesis for a t- or F-test (left, right, or two-sided).
Definition sts_types.h:37
Per-call output of a Student t-test: t-statistics, p-values and degrees of freedom.
Definition sts_ttest.h:62
Eigen::MatrixXd matPval
Definition sts_ttest.h:64
Eigen::MatrixXd matTstat
Definition sts_ttest.h:63
One-sample, paired and independent two-sample Student t-tests with exact p-values via the regularised...
Definition sts_ttest.h:75
static double regularizedBeta(double x, double a, double b)
static StatsTtestResult paired(const Eigen::MatrixXd &dataA, const Eigen::MatrixXd &dataB, StatsTailType tail=StatsTailType::Both)
Definition sts_ttest.cpp:77
static double tCdf(double t, int df)
static StatsTtestResult oneSample(const Eigen::MatrixXd &data, double mu=0.0, StatsTailType tail=StatsTailType::Both)
Definition sts_ttest.cpp:45
static StatsTtestResult independent(const Eigen::MatrixXd &dataA, const Eigen::MatrixXd &dataB, StatsTailType tail=StatsTailType::Both)
Definition sts_ttest.cpp:84