Chi2cdf

Description

Computes the lower/upper tail probability for the \chi^2 distribution with real degrees of freedom df.

Syntax

double prob = chi2cdf(double x, double df[, int tail])

Parameters

x

Input, the value of the Chi variate, must be nonnegative (x>=0).

df

Input, the degrees of freedom, \nu, of the distribution, \chi^2 must be positive(df>0).

tail

Input, Optional. The tail probability type using for the \chi^2 distribution
  • 1 = the for upper tail probability
  • 2 = the lower tail probability (Default if not set)

prob

Output, the returned probability.

Example

chi2cdf(150,3,1)=;     // ANS: 2.6349139284881E-32