MCPcopy Create free account
hub / github.com/apache/madlib / tStatsToResult

Function tStatsToResult

src/modules/stats/t_test.cpp:300–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298namespace {
299
300inline
301AnyType
302tStatsToResult(double inT, double inDegreeOfFreedom) {
303 // Return t statistic, degrees of freedom, one-tailed p-value (Null
304 // hypothesis \mu <= \mu_0), and two-tailed p-value (\mu = \mu_0).
305 // Recall definition of p-value: The probability of observating a
306 // value at least as extreme as the one observed, assuming that the null
307 // hypothesis is true.
308 using boost::math::complement;
309
310 AnyType tuple;
311 tuple
312 << inT
313 << inDegreeOfFreedom
314 << prob::cdf(complement(prob::students_t(inDegreeOfFreedom), inT))
315 << 2. * prob::cdf(boost::math::complement(
316 prob::students_t(inDegreeOfFreedom), std::fabs(inT)));
317 return tuple;
318}
319
320}
321

Callers 1

runMethod · 0.85

Calls 1

cdfFunction · 0.50

Tested by

no test coverage detected