On entry: the deviate from the noncentral -distribution with degrees of freedom and noncentrality parameter .
2: – Real (Kind=nag_wp)Input
On entry: , the degrees of freedom of the noncentral -distribution.
3: – Real (Kind=nag_wp)Input
On entry: , the noncentrality parameter of the noncentral -distribution.
if or if .
4: – Real (Kind=nag_wp)Input
On entry: the required accuracy of the solution. If g01gcf is entered with tol greater than or equal to or less than (see x02ajf), the value of is used instead.
5: – IntegerInput
On entry: the maximum number of iterations to be performed.
. See Section 9 for further discussion.
6: – 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 g01gcf may return useful information.
If on exit , , or , then g01gcf returns .
On entry, .
On entry, and .
Constraint: if .
On entry, .
On entry, .
On entry, .
The initial value of the Poisson weight used in the summation of (1) (see Section 3) was too small to be calculated. The computed probability is likely to be zero.
The solution has failed to converge in iterations. Consider increasing maxit or tol.
The value of a term required in (2) (see Section 3) is too large to be evaluated accurately. The most likely cause of this error is both x and rlamda are too large.
The calculations for the central chi-square probability has failed to converge. A larger value of tol should be used.
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 summations described in Section 3 are made until an upper bound on the truncation error relative to the current summation value is less than tol.
8Parallelism and Performance
g01gcf is not threaded in any implementation.
The number of terms in (1) required for a given accuracy will depend on the following factors:
(i)The rate at which the Poisson weights tend to zero. This will be slower for larger values of .
(ii)The rate at which the central probabilities tend to zero. This will be slower for larger values of and .
This example reads values from various noncentral -distributions, calculates the lower tail probabilities and prints all these values until the end of data is reached.