g01ef returns the lower or upper tail probability of the gamma distribution, with parameters and .
Syntax
C# |
---|
public static double g01ef( string tail, double g, double a, double b, out int ifail ) |
Visual Basic |
---|
Public Shared Function g01ef ( _ tail As String, _ g As Double, _ a As Double, _ b As Double, _ <OutAttribute> ByRef ifail As Integer _ ) As Double |
Visual C++ |
---|
public: static double g01ef( String^ tail, double g, double a, double b, [OutAttribute] int% ifail ) |
F# |
---|
static member g01ef : tail : string * g : float * a : float * b : float * ifail : int byref -> float |
Parameters
- tail
- Type: System..::..StringOn entry: indicates whether an upper or lower tail probability is required.
- The lower tail probability is returned, that is .
- The upper tail probability is returned, that is .
Constraint: or .
- g
- Type: System..::..DoubleOn entry: , the value of the gamma variate.Constraint: .
- a
- Type: System..::..DoubleOn entry: the parameter of the gamma distribution.Constraint: .
- b
- Type: System..::..DoubleOn entry: the parameter of the gamma distribution.Constraint: .
- 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
g01ef returns the lower or upper tail probability of the gamma distribution, with parameters and .
Description
The lower tail probability for the gamma distribution with parameters and , , is defined by:
The mean of the distribution is and its variance is . The transformation is applied to yield the following incomplete gamma function in normalized form,
This is then evaluated using s14ba.
References
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Error Indicators and Warnings
Errors or warnings detected by the method:
If , , or on exit, then g01ef returns .
On entry, or .
On entry, .
On entry, , or .
- The solution did not converge in iterations. See s14ba. The probability returned should be a reasonable approximation to the solution.
Accuracy
The result should have a relative accuracy of machine precision. There are rare occasions when the relative accuracy attained is somewhat less than machine precision but the error should not exceed more than or decimal places. Note also that there is a limit of decimal places on the achievable accuracy, because constants in s14ba are given to this precision.
Parallelism and Performance
None.
Further Comments
Example
This example reads in values from a number of gamma distributions and computes the associated lower tail probabilities.
Example program (C#): g01efe.cs