g01ge returns the probability associated with the lower tail of the noncentral beta distribution.

Syntax

C#
public static double g01ge(
	double x,
	double a,
	double b,
	double rlamda,
	double tol,
	int maxit,
	out int ifail
)
Visual Basic
Public Shared Function g01ge ( _
	x As Double, _
	a As Double, _
	b As Double, _
	rlamda As Double, _
	tol As Double, _
	maxit As Integer, _
	<OutAttribute> ByRef ifail As Integer _
) As Double
Visual C++
public:
static double g01ge(
	double x, 
	double a, 
	double b, 
	double rlamda, 
	double tol, 
	int maxit, 
	[OutAttribute] int% ifail
)
F#
static member g01ge : 
        x : float * 
        a : float * 
        b : float * 
        rlamda : float * 
        tol : float * 
        maxit : int * 
        ifail : int byref -> float 

Parameters

x
Type: System..::..Double
On entry: β, the deviate from the beta distribution, for which the probability PBβ:a,b;λ is to be found.
Constraint: 0.0x1.0.
a
Type: System..::..Double
On entry: a, the first parameter of the required beta distribution.
Constraint: 0.0<a106.
b
Type: System..::..Double
On entry: b, the second parameter of the required beta distribution.
Constraint: 0.0<b106.
rlamda
Type: System..::..Double
On entry: λ, the noncentrality parameter of the required beta distribution.
Constraint: 0.0rlamda-2.0logU, where U is the safe range parameter as defined by x02am.
tol
Type: System..::..Double
On entry: the relative accuracy required by you in the results. If g01ge is entered with tol greater than or equal to 1.0 or less than 10×machine precision (see x02aj), then the value of 10×machine precision is used instead.
See [Accuracy] for the relationship between tol and maxit.
maxit
Type: System..::..Int32
On entry: the maximum number of iterations that the algorithm should use.
See [Accuracy] for suggestions as to suitable values for maxit for different values of the parameters.
Suggested value: 500.
Constraint: maxit1.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Return Value

g01ge returns the probability associated with the lower tail of the noncentral beta distribution.

Description

The lower tail probability for the noncentral beta distribution with parameters a and b and noncentrality parameter λ, PBβ:a,b;λ, is defined by
PBβ:a,b;λ=j=0e-λ/2λ/2j!PBβ:a,b;0, (1)
where
PBβ:a,b;0=Γa+bΓaΓb0βBa-11-Bb-1dB,
which is the central beta probability function or incomplete beta function.
Recurrence relationships given in Abramowitz and Stegun (1972) are used to compute the values of PBβ:a,b;0 for each step of the summation (1).
The algorithm is discussed in Lenth (1987).

References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Lenth R V (1987) Algorithm AS 226: Computing noncentral beta probabilities Appl. Statist. 36 241–244

Error Indicators and Warnings

Note: g01ge may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
ifail=1
On entry,a0.0,
ora>106,
orb0.0,
orb>106,
orrlamda<0.0,
orrlamda>-2.0logU, where U= safe range parameter as defined by x02am,
orx<0.0,
orx>1.0,
ormaxit<1.
If on exit ifail=1 then g01ge returns zero.
ifail=2
The solution has failed to converge in maxit iterations. You should try a larger value of maxit or tol. The returned value will be an approximation to the correct value.
ifail=3
The probability is too close to 0.0 or 1.0 for the algorithm to be able to calculate the required probability. g01ge will return 0.0 or 1.0 as appropriate, this should be a reasonable approximation.
ifail=4
The required accuracy was not achieved when calculating the initial value of PBβ:a,b;λ. You should try a larger value of tol. The returned value will be an approximation to the correct value.
ifail=-9000
An error occured, see message report.

Accuracy

Convergence is theoretically guaranteed whenever PY>maxittol where Y has a Poisson distribution with mean λ/2. Excessive round-off errors are possible when the number of iterations used is high and tol is close to machine precision. See Lenth (1987) for further comments on the error bound.

Parallelism and Performance

None.

Further Comments

The central beta probabilities can be obtained by setting rlamda=0.0.

Example

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

Example program (C#): g01gee.cs

Example program data: g01gee.d

Example program results: g01gee.r

See Also