CCCoreLib 31 May 2022
CloudCompare Core algorithms
Static Public Member Functions | List of all members
Chi2Helper Class Reference

Package of methods to compute Chi2 related stuff. More...

#include <Chi2Helper.h>

Static Public Member Functions

static double poz (double z)
 Probability of normal z value. More...
 
static double EXP_MAX_A_VALUE ()
 Value above which exp(EXP_MAX_A_VALUE) diverges.
 
static double pochisq (double x, int df)
 Probability of chi-square value. More...
 
static double critchi (double p, int df)
 Compute critical chi-square value toproduce given p. More...
 

Detailed Description

Package of methods to compute Chi2 related stuff.

The following JavaScript functions for calculating normal and chi-square probabilities and critical values were adapted by John Walker from C implementations written by Gary Perlman of Wang Institute, Tyngsboro, MA 01879. Both the original C code and this JavaScript edition are in the public domain.

Member Function Documentation

◆ critchi()

static double Chi2Helper::critchi ( double  p,
int  df 
)
inlinestatic

Compute critical chi-square value toproduce given p.

We just do a bisection search for a value within CHI_EPSILON, relying on the monotonicity of pochisq().

◆ pochisq()

static double Chi2Helper::pochisq ( double  x,
int  df 
)
inlinestatic

Probability of chi-square value.

Adapted from: Hill, I. D. and Pike, M. C. Algorithm 299 Collected Algorithms for the CACM 1967 p. 243 Updated for rounding errors based on remark in ACM TOMS June 1985, page 185

◆ poz()

static double Chi2Helper::poz ( double  z)
inlinestatic

Probability of normal z value.

Adapted from a polynomial approximation in: Ibbetson D, Algorithm 209 Collected Algorithms of the CACM 1963 p. 616 Note: This routine has six digit accuracy, so it is only useful for absolute z values < 6. For z values >= to 6.0, poz() returns 0.0.


The documentation for this class was generated from the following file: