g01fe returns the deviate associated with the given lower tail probability of the beta distribution.
Syntax
C# |
---|
public static double g01fe( double p, double a, double b, double tol, out int ifail ) |
Visual Basic |
---|
Public Shared Function g01fe ( _ p As Double, _ a As Double, _ b As Double, _ tol As Double, _ <OutAttribute> ByRef ifail As Integer _ ) As Double |
Visual C++ |
---|
public: static double g01fe( double p, double a, double b, double tol, [OutAttribute] int% ifail ) |
F# |
---|
static member g01fe : p : float * a : float * b : float * tol : float * ifail : int byref -> float |
Parameters
- p
- Type: System..::..DoubleOn entry: , the lower tail probability from the required beta distribution.Constraint: .
- a
- Type: System..::..DoubleOn entry: , the first parameter of the required beta distribution.Constraint: .
- b
- Type: System..::..DoubleOn entry: , the second parameter of the required beta distribution.Constraint: .
- tol
- Type: System..::..Double
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Return Value
g01fe returns the deviate associated with the given lower tail probability of the beta distribution.
Description
The deviate, , associated with the lower tail probability, , of the beta distribution with parameters and is defined as the solution to
The algorithm is a modified version of the Newton–Raphson method, following closely that of Cran et al. (1977).
An initial approximation, , to is found (see Cran et al. (1977)), and the Newton–Raphson iteration
where is used, with modifications to ensure that remains in the range .
References
Cran G W, Martin K J and Thomas G E (1977) Algorithm AS 109. Inverse of the incomplete beta function ratio Appl. Statist. 26 111–114
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Error Indicators and Warnings
Note: g01fe may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
If on exit or , then g01fe returns .
On entry, , or .
On entry, , or , or , or .
- There is doubt concerning the accuracy of the computed result. iterations of the Newton–Raphson method have been performed without satisfying the accuracy criterion (see [Accuracy]). The result should be a reasonable approximation of the solution.
- 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.
Accuracy
The required precision, given by tol, should be achieved in most circumstances.
Parallelism and Performance
None.
Further Comments
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.
Example program (C#): g01fee.cs