aGrUM  0.16.0
chiSquare.h
Go to the documentation of this file.
1 
31 #ifndef GUM_CHI_SQUARE_H
32 # define GUM_CHI_SQUARE_H
33 
34 # include <agrum/core/math/math.h>
35 # include <agrum/core/hashTable.h>
36 
37 
38 namespace gum {
39 
48  class ChiSquare {
49  public:
50  static double probaChi2(double x, Size df);
51 
52  private:
55 
57  static constexpr double __Z_MAX = 6.0;
58 
60  static constexpr double __CHI_EPSILON = 0.000001;
61 
63  static constexpr double __CHI_MAX = 99999.0;
64 
66  static constexpr double __LOG_SQRT_PI = 0.5723649429247000870717135;
67 
69  static constexpr double __I_SQRT_PI = 0.5641895835477562869480795;
70 
72  static constexpr double __BIGX = 20.0;
73 
75 
76 
79 
80  static double __exp(double x) { return (((x) < -__BIGX) ? 0.0 : exp(x)); }
81 
82  static double __probaZValue(double z);
84  };
85 
86 } /* namespace gum */
87 
88 #endif // GUM_CHI_SQUARE_H
89 
90 
91 // static HashTable<std::pair<double, unsigned long>, double> __chi2Cache;
92 // static HashTable<double, double> __ZCache;
93 // static Idx nbZ;
94 // static Idx nbChi;
95 // static Idx nbZt;
96 // static Idx nbChit;
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
static constexpr double __LOG_SQRT_PI
log (sqrt (pi))
Definition: chiSquare.h:66
static constexpr double __BIGX
max value to represent exp (x)
Definition: chiSquare.h:72
static double __probaZValue(double z)
computes the probability of normal z value (used by the cache)
Definition: chiSquare.cpp:43
static double __exp(double x)
Required constant to compute the cdf.
Definition: chiSquare.h:80
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
static constexpr double __I_SQRT_PI
1 / sqrt (pi)
Definition: chiSquare.h:69
static constexpr double __Z_MAX
Required constant to compute the cdf.
Definition: chiSquare.h:57
static constexpr double __CHI_MAX
maximum chi square value
Definition: chiSquare.h:63
static double probaChi2(double x, Size df)
computes the probability of chi2 value (used by the cache)
Definition: chiSquare.cpp:118
static constexpr double __CHI_EPSILON
accuracy of critchi approximation
Definition: chiSquare.h:60
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
<agrum/FMDP/learning/core/testPolicy/chiSquare.h>
Definition: chiSquare.h:48