naginterfaces.library.stat.prob_chisq¶
- naginterfaces.library.stat.prob_chisq(x, df, tail='L')[source]¶
prob_chisq
returns the lower or upper tail probability for the -distribution with real degrees of freedom.For full information please refer to the NAG Library document for g01ec
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g01/g01ecf.html
- Parameters
- xfloat
, the value of the variate with degrees of freedom.
- dffloat
, the degrees of freedom of the -distribution.
- tailstr, length 1, optional
Indicates whether the upper or lower tail probability is required.
The lower tail probability is returned, i.e., .
The upper tail probability is returned, i.e., .
- Returns
- pfloat
The lower or upper tail probability for the -distribution, depending on the value of supplied.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
The series used to calculate the gamma probabilities has failed to converge. The result returned should represent an approximation to the solution.
- Notes
The lower tail probability for the -distribution with degrees of freedom, is defined by:
To calculate a transformation of a gamma distribution is employed, i.e., a -distribution with degrees of freedom is equal to a gamma distribution with scale parameter and shape parameter .
- References
NIST Digital Library of Mathematical Functions
Hastings, N A J and Peacock, J B, 1975, Statistical Distributions, Butterworth