Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef StatComparator_H
00030 #define StatComparator_H
00031
00032 #include "QGpCoreToolsDLLExport.h"
00033 #include "Trace.h"
00034
00035 namespace QGpCoreTools {
00036
00037 class QGPCORETOOLS_EXPORT StatComparator
00038 {
00039 public:
00040 StatComparator() {}
00041 ~StatComparator() {}
00042
00043 static inline double student(double t, double nu);
00044 static inline double fisher(double F, double nu1, double nu2);
00045 static double invStudent(double p, double nu);
00046 static double invFisher(double p, double nu1, double nu2);
00047 protected:
00048 static double betai(double a, double b, double x);
00049 static double gammln(double x);
00050 static double betacf(double a, double b, double x);
00051 };
00052
00058 inline double StatComparator::student(double t, double nu)
00059 {
00060 TRACE;
00061 return betai(nu/2.0, 0.5, nu/(nu + t * t));
00062 }
00063
00069 inline double StatComparator::fisher(double F, double nu1, double nu2)
00070 {
00071 TRACE;
00072 return betai(nu2/2.0, nu1/2.0, nu2/(nu2 + nu1 * F));
00073 }
00074
00075 }
00076
00077 #endif // STATCOMPARATOR_H