ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
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. More...
 
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().

References pochisq().

Referenced by cloudViewer::StatisticalTestingTools::computeChi2Fractile().

◆ EXP_MAX_A_VALUE()

static double Chi2Helper::EXP_MAX_A_VALUE ( )
inlinestatic

Value above which exp(EXP_MAX_A_VALUE) diverges.

Referenced by 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

References a, e, EXP_MAX_A_VALUE(), I_SQRT_PI, LOG_SQRT_PI, poz(), x, y, and z.

Referenced by cloudViewer::StatisticalTestingTools::computeChi2Probability(), and critchi().

◆ 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.

References x, y, and z.

Referenced by pochisq().


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