95
98
// PartialPearson : Independence Pearson test between 2 samples : firstSample of dimension n and secondSample of dimension 1. If firstSample[i] is the numerical sample extracted from firstSample (ith coordinate of each point of the numerical sample), PartialPearson performs the Independence Pearson test simultaneously on firstSample[i] and secondSample, for i in the selection. For all i, it is supposed that the couple (firstSample[i] and secondSample) is issued from a gaussian vector.
96
99
// Probability of the H0 reject zone : 1-0.90
98
std::cout << "PartialPearsonXY=" << HypothesisTest::PartialPearson(sampleX, sampleY, selection, 0.90) << std::endl;
101
fullprint << "PartialPearsonXY=" << HypothesisTest::PartialPearson(sampleX, sampleY, selection, 0.90) << std::endl;
100
103
// The three tests must be equal
101
std::cout << "PartialPearsonX0Y=" << HypothesisTest::PartialPearson(sampleX, sampleY, selection2, 0.90) << std::endl;
102
std::cout << "PearsonX0Y=" << HypothesisTest::Pearson(sampleX0, sampleY, 0.90) << std::endl;
103
std::cout << "FullPearsonX0Y=" << HypothesisTest::FullPearson(sampleX0, sampleY, 0.90) << std::endl;
104
fullprint << "PartialPearsonX0Y=" << HypothesisTest::PartialPearson(sampleX, sampleY, selection2, 0.90) << std::endl;
105
fullprint << "PearsonX0Y=" << HypothesisTest::Pearson(sampleX0, sampleY, 0.90) << std::endl;
106
fullprint << "FullPearsonX0Y=" << HypothesisTest::FullPearson(sampleX0, sampleY, 0.90) << std::endl;
105
108
// FullPearson : Independence Pearson test between 2 samples : firstSample of dimension n and secondSample of dimension 1. If firstSample[i] is the numerical sample extracted from firstSample (ith coordinate of each point of the numerical sample), FullPearson performs the Independence Pearson test simultaneously on firstSample[i] and secondSample. For all i, it is supposed that the couple (firstSample[i] and secondSample) is issued from a gaussian vector.
106
109
// Probability of the H0 reject zone : 1-0.90
108
std::cout << "FullPearsonX0Y=" << HypothesisTest::FullPearson(sampleX, sampleY, 0.90) << std::endl;
109
std::cout << "FullPearsonYY=" << HypothesisTest::FullPearson(sampleY, sampleY, 0.90) << std::endl;
111
fullprint << "FullPearsonX0Y=" << HypothesisTest::FullPearson(sampleX, sampleY, 0.90) << std::endl;
112
fullprint << "FullPearsonYY=" << HypothesisTest::FullPearson(sampleY, sampleY, 0.90) << std::endl;
111
114
// PartialSpearman test between 2 samples : firstSample of dimension n and secondSample of dimension 1. If firstSample[i] is the numerical sample extracted from firstSample (ith coordinate of each point of the numerical sample), PartialSpearman performs the Independence Spearman test simultaneously on firstSample[i] and secondSample, for i in the selection.
112
115
// Probability of the H0 reject zone : 1-0.90
114
117
// The three tests must be equal
115
std::cout << "PartialSpearmanX0Y=" << HypothesisTest::PartialSpearman(sampleX, sampleY, selection2, 0.90) << std::endl;
116
std::cout << "SpearmanX0Y=" << HypothesisTest::Spearman(sampleX0, sampleY, 0.90) << std::endl;
117
std::cout << "FullSpearmanX0Y=" << HypothesisTest::FullSpearman(sampleX0, sampleY, 0.90) << std::endl;
118
fullprint << "PartialSpearmanX0Y=" << HypothesisTest::PartialSpearman(sampleX, sampleY, selection2, 0.90) << std::endl;
119
fullprint << "SpearmanX0Y=" << HypothesisTest::Spearman(sampleX0, sampleY, 0.90) << std::endl;
120
fullprint << "FullSpearmanX0Y=" << HypothesisTest::FullSpearman(sampleX0, sampleY, 0.90) << std::endl;
119
std::cout << "PartialSpearmanXY=" << HypothesisTest::PartialSpearman(sampleX, sampleY, selection, 0.90) << std::endl;
122
fullprint << "PartialSpearmanXY=" << HypothesisTest::PartialSpearman(sampleX, sampleY, selection, 0.90) << std::endl;
121
124
// FullSpearman : Spearman test between 2 samples : firstSample of dimension n and secondSample of dimension 1. If firstSample[i] is the numerical sample extracted from firstSample (ith coordinate of each point of the numerical sample), FullSpearman performs the Independence Spearman test simultaneously on all firstSample[i] and secondSample.
122
125
// Probability of the H0 reject zone : 1-0.90
124
std::cout << "FullSpearmanYZ=" << HypothesisTest::FullSpearman(sampleY, sampleZ, 0.90) << std::endl;
125
std::cout << "FullSpearmanYY=" << HypothesisTest::FullSpearman(sampleY, sampleY, 0.90) << std::endl;
127
fullprint << "FullSpearmanYZ=" << HypothesisTest::FullSpearman(sampleY, sampleZ, 0.90) << std::endl;
128
fullprint << "FullSpearmanYY=" << HypothesisTest::FullSpearman(sampleY, sampleY, 0.90) << std::endl;
127
130
// Regression test between 2 samples : firstSample of dimension n and secondSample of dimension 1. If firstSample[i] is the numerical sample extracted from firstSample (ith coordinate of each point of the numerical sample), PartialRegression performs the Regression test simultaneously on all firstSample[i] and secondSample, for i in the selection. The Regression test tests ifthe regression model between two scalar numerical samples is significant. It is based on the deviation analysis of the regression. The Fisher distribution is used.
129
132
// The two tests must be equal
130
std::cout << "PartialRegressionX0Y=" << HypothesisTest::PartialRegression(sampleX, sampleY, selection2, 0.90) << std::endl;
131
std::cout << "FullRegressionX0Y=" << HypothesisTest::FullRegression(sampleX0, sampleY, 0.90) << std::endl;
133
fullprint << "PartialRegressionX0Y=" << HypothesisTest::PartialRegression(sampleX, sampleY, selection2, 0.90) << std::endl;
134
fullprint << "FullRegressionX0Y=" << HypothesisTest::FullRegression(sampleX0, sampleY, 0.90) << std::endl;
133
std::cout << "PartialRegressionXY=" << HypothesisTest::PartialRegression(sampleX, sampleY, selection, 0.90) << std::endl;
136
fullprint << "PartialRegressionXY=" << HypothesisTest::PartialRegression(sampleX, sampleY, selection, 0.90) << std::endl;
135
138
// Regression test between 2 samples : firstSample of dimension n and secondSample of dimension 1. If firstSample[i] is the numerical sample extracted from firstSample (ith coordinate of each point of the numerical sample), FullRegression performs the Regression test simultaneously on all firstSample[i] and secondSample. The Regression test tests if the regression model between two scalar numerical samples is significant. It is based on the deviation analysis of the regression. The Fisher distribution is used.
137
std::cout << "FullRegressionXZ=" << HypothesisTest::FullRegression(sampleX, sampleZ, 0.90) << std::endl;
138
std::cout << "FullRegressionZZ=" << HypothesisTest::FullRegression(sampleZ, sampleZ, 0.90) << std::endl;
140
fullprint << "FullRegressionXZ=" << HypothesisTest::FullRegression(sampleX, sampleZ, 0.90) << std::endl;
141
fullprint << "FullRegressionZZ=" << HypothesisTest::FullRegression(sampleZ, sampleZ, 0.90) << std::endl;
141
144
return ExitCode::Success;