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> static double _probaZValue_(double z)
Computes the probability of normal z value.
void setConditioningNodes(const std::vector< Idx > &db_conditioning_ids)
Sets the conditioning nodes (useful for computing degrees of freedom).
HashTable< Idx, double > _critical_values_
A set of already computed critical values.
INLINE void emplace(Args &&... args)
#define GUM_LEARNING_CONFIDENCE_PROBA
Size degreesOfFreedom(Idx var1, Idx var2)
Returns the number of degrees of freedom.
Represent the chi2 distribution.
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.
static double probaChi2(double x, Size df)
Computes the probability of chi2 value.
static double _criticalValue_(double proba, Size df)
Computes the critical value of a given chi2 test (used by the cache).
double _confidence_proba_
The confidence probability used for critical values.
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.
Size _conditioning_size_
The domain size of the conditioning nodes.
void setConfidenceProba(double new_proba)
Modifies the confidence probability.
const std::vector< std::size_t > & _modalities_
The modalities of the random variables.
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.