The routine may be called by the names g01fcf or nagf_stat_inv_cdf_chisq.
The deviate, , associated with the lower tail probability of the -distribution with degrees of freedom is defined as the solution to
The required is found by using the relationship between a -distribution and a gamma distribution, i.e., a -distribution with degrees of freedom is equal to a gamma distribution with scale parameter and shape parameter .
For very large values of , greater than , Wilson and Hilferty's normal approximation to the is used; see Kendall and Stuart (1969).
Best D J and Roberts D E (1975) Algorithm AS 91. The percentage points of the distribution Appl. Statist.24 385–388
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Kendall M G and Stuart A (1969) The Advanced Theory of Statistics (Volume 1) (3rd Edition) Griffin
1: – Real (Kind=nag_wp)Input
On entry: , the lower tail probability from the required -distribution.
2: – Real (Kind=nag_wp)Input
On entry: , the degrees of freedom of the -distribution.
3: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended since useful values can be provided in some output arguments even when on exit. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
Note: in some cases g01fcf may return useful information.
If , , or on exit, then g01fcf returns .
On entry, .
On entry, .
On entry, .
The probability is too close to or .
The algorithm has failed to converge in iterations. The result should be a reasonable approximation.
The series used to calculate the gamma function has failed to converge. This is an unlikely error exit.
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
The results should be accurate to five significant digits for most argument values. Some accuracy is lost for close to .
8Parallelism and Performance
g01fcf is not threaded in any implementation.
For higher accuracy the relationship described in Section 3 may be used and a direct call to g01fff made.
This example reads lower tail probabilities for several -distributions, and calculates and prints the corresponding deviates until the end of data is reached.