chi2cdf

 

Description

computes the lower or upper tail probability for the chi-square distribution with real degrees of freedom.

Syntax

double chi2cdf( const double x, double df, int iTail = TAILED_TEST_LOWER, int * nFail = NULL )

Parameters

x
[input] value of the Chi variate, x. must be nonnegative (x>=0).
df
[input] degrees of freedom, df, \nu of the distribution \chi^2, must be positive(df>0).
iTail
[input] upper tailed, or lower tailed test.
1 = TAILED_TEST_UPPER,
2 = TAILED_TEST_LOWER.
nFail
[output] on successful exit, it returns the NAG error code NE_NOERROR; if an error or warning has been detected, then it returns the specific error or warning code.

Return

Returns Chi Square cdf

Examples

EX1

void chi2cdf_ex1()
{
        double x[]= {0.25, 0.5, 0.75};
        double df = 3;
        for(int ii = 0; ii<3; ii++)
                printf("%f     %f:     %f\n", x[ii], df, chi2cdf(x[ii], df));
}

Remark

See Also

chi2inv

header to Include

origin.h

Reference