32 #ifndef GUM_LEARNING_CHI2_H 33 #define GUM_LEARNING_CHI2_H 35 #include <agrum/agrum.h> 36 #include <agrum/tools/core/math/math_utils.h> 37 #include <agrum/tools/core/hashTable.h> 39 #define GUM_LEARNING_CONFIDENCE_PROBA 0.05
69 Chi2(
const std::vector< std::size_t >& var_modalities,
146 static double probaChi2(
double x, Size df);
202 #ifndef GUM_NO_INLINE 203 # include <agrum/tools/core/math/chi2_inl.h> void setConditioningNodes(const std::vector< Idx > &db_conditioning_ids)
Sets the conditioning nodes (useful for computing degrees of freedom).
static double probaZValue__(double z)
Computes the probability of normal z value.
INLINE void emplace(Args &&... args)
HashTable< Idx, double > critical_values__
A set of already computed critical values.
#define GUM_LEARNING_CONFIDENCE_PROBA
Size conditioning_size__
The domain size of the conditioning nodes.
double confidence_proba__
The confidence probability used for critical values.
Size degreesOfFreedom(Idx var1, Idx var2)
Returns the number of degrees of freedom.
Represent the chi2 distribution.
static double criticalValue__(double proba, Size df)
Computes the critical value of a given chi2 test (used by the cache).
Size degreesOfFreedom(const std::pair< Idx, Idx > &pair)
Returns the number of degrees of freedom.
double criticalValue(Idx var1, Idx var2)
Computes the critical value according to the number of degrees of freedom.
const std::vector< std::size_t > & modalities__
The modalities of the random variables.
static double probaChi2(double x, Size df)
Computes the probability of chi2 value.
Chi2(const Chi2 &)=delete
Forbid use of the copy constructor.
Chi2(const std::vector< std::size_t > &var_modalities, double confidence_proba=GUM_LEARNING_CONFIDENCE_PROBA)
Default constructor.
void setConfidenceProba(double new_proba)
Modifies the confidence probability.
double criticalValue(const std::pair< Idx, Idx > &pair)
Computes the critical value according to the number of degrees of freedom.
Chi2 & operator=(const Chi2 &)=delete
Forbid used of the copy operator.