5 Parameters

On entry: p, the lower tail probability from the required beta distribution.

Constraint:
0.0≤P≤1.0.

2: A – REAL (KIND=nag_wp)Input

On entry: a, the first parameter of the required beta distribution.

Constraint:
0.0<A≤106.

3: B – REAL (KIND=nag_wp)Input

On entry: b, the second parameter of the required beta distribution.

Constraint:
0.0<B≤106.

4: TOL – REAL (KIND=nag_wp)Input

On entry: the relative accuracy required by you in the result. If G01FEF is entered with TOL greater than or equal to 1.0 or less than 10×machine precision (see X02AJF), then the value of 10×machine precision is used instead.

5: IFAIL – INTEGERInput/Output

On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.

For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, because for this routine the values of the output parameters may be useful even if IFAIL≠0 on exit, the recommended value is -1. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.

On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).

Note: G01FEF may return useful information for one or more of the following detected errors or warnings.

Errors or warnings detected by the routine:

If on exit IFAIL=1 or 2, then G01FEF returns 0.0.

IFAIL=1

On entry,

P<0.0,

or

P>1.0.

IFAIL=2

On entry,

A≤0.0,

or

A>106,

or

B≤0.0,

or

B>106.

IFAIL=3

There is doubt concerning the accuracy of the computed result. 100 iterations of the Newton–Raphson method have been performed without satisfying the accuracy criterion (see Section 7). The result should be a reasonable approximation of the solution.

IFAIL=4

Requested accuracy not achieved when calculating beta probability. The result should be a reasonable approximation to the correct solution. You should try setting TOL larger.

7 Accuracy

The required precision, given by TOL, should be achieved in most circumstances.

8 Further Comments

The typical timing will be several times that of G01EEF and will be very dependent on the input parameter values. See G01EEF for further comments on timings.

9 Example

This example reads lower tail probabilities for several beta distributions and calculates and prints the corresponding deviates until the end of data is reached.