MCPcopy Create free account
hub / github.com/catboost/catboost / TTest

Function TTest

library/cpp/statistics/statistics.h:364–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362 /*! More details on: http://en.wikipedia.org/wiki/Student's_t-test */
363 template <typename ValueType>
364 double TTest(ValueType diffValue, ValueType diffPrecision, const bool isTailed = false, const bool isLeftTailed = true) {
365 static const ValueType EPS = 16 * std::numeric_limits<ValueType>::epsilon();
366
367 if (diffPrecision < EPS) {
368 if (std::abs(diffValue) > EPS) {
369 return 1.0;
370 } else {
371 return 0.5;
372 }
373 }
374
375 if (isTailed) {
376 const double res = Phi(static_cast<ValueType>(0.0), diffPrecision, diffValue, false);
377 return isLeftTailed ? res : (1 - res);
378 } else {
379 const double res = Phi(static_cast<ValueType>(0.0), diffPrecision, std::abs(diffValue), false);
380 return (1 - res) * 2;
381 }
382 }
383
384 template <typename InputIterator, typename ValueType>
385 double TTest(InputIterator begin, InputIterator end, ValueType expectedMean,

Callers

nothing calls this directly

Calls 7

distanceFunction · 0.85
MeanAndStandardDeviationFunction · 0.85
PhiFunction · 0.70
epsilonFunction · 0.50
absFunction · 0.50
sqrtFunction · 0.50
SqrFunction · 0.50

Tested by

no test coverage detected