cdfChinc

Purpose

Computes the cumulative distribution function for the noncentral chi-squared distribution.

Format

p = cdfChinc(x, df, nonc)
Parameters:
  • x (Nx1 vector) – Values at which to evaluate the cdf of the noncentral chi-squared distribution. \(x > 0\).

  • df (scalar) – degrees of freedom, \(df > 0\).

  • nonc (scalar) – noncentrality parameter, \(nonc > 0\). Note: This is the square root of the noncentrality parameter that sometimes goes under the symbol \(\lambda\). \(nonc > 0\).

Returns:

p (Nx1 vector) – Each element in p is the noncentral chi-squared cdf value evaluated at the corresponding element in x.

Examples

// Values
x = { .5, 1, 5, 25 };

// Degrees of freedom
df = 4;

// Non-centrality parameter
nonc = 2;

print cdfChinc(x, df, nonc);

The code above returns:

0.0042086234
0.016608592
0.30954232
0.99441140

Remarks

p is the integral from 0 to x of the noncentral chi-square distribution with df degrees of freedom and noncentrality nonc.

cdfChinc() can return a vector of values, but the degrees of freedom and noncentrality parameter must be the same for all values of x.

For invalid inputs, cdfChinc() will return a scalar error code which, when its value is assessed by function scalerr(), corresponds to the invalid input. If the first input is out of range, scalerr() will return a 1; if the second is out of range, scalerr() will return a 2; etc.

Relation to cdfChic():

cdfChic(x, df) = 1 - cdfChinc(x, df, 0);

See also

Functions cdfFnc(), cdfTnc()