g01gc returns the probability associated with the lower tail of the noncentral -distribution
.
Syntax
C# |
---|
public static double g01gc( double x, double df, double rlamda, double tol, int maxit, out int ifail ) |
Visual Basic |
---|
Public Shared Function g01gc ( _ x As Double, _ df As Double, _ rlamda As Double, _ tol As Double, _ maxit As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) As Double |
Visual C++ |
---|
public: static double g01gc( double x, double df, double rlamda, double tol, int maxit, [OutAttribute] int% ifail ) |
F# |
---|
static member g01gc : x : float * df : float * rlamda : float * tol : float * maxit : int * ifail : int byref -> float |
Parameters
- x
- Type: System..::..DoubleOn entry: the deviate from the noncentral -distribution with degrees of freedom and noncentrality parameter .Constraint: .
- df
- Type: System..::..DoubleOn entry: , the degrees of freedom of the noncentral -distribution.Constraint: .
- rlamda
- Type: System..::..DoubleOn entry: , the noncentrality parameter of the noncentral -distribution.Constraint: if or if .
- tol
- Type: System..::..Double
- maxit
- Type: System..::..Int32On entry: the maximum number of iterations to be performed.Suggested value: . See [Further Comments] for further discussion.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
g01gc returns the probability associated with the lower tail of the noncentral -distribution
.
Description
The lower tail probability of the noncentral -distribution with degrees of freedom and noncentrality parameter , , is defined by
where is a central -distribution with degrees of freedom.
(1) |
The value of at which the Poisson weight, , is greatest is determined and the summation (1) is made forward and backward from that value of .
The recursive relationship:
is used during the summation in (1).
(2) |
References
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Error Indicators and Warnings
Note: g01gc 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 g01gc returns .
On entry, , or , or and , or , or .
- The initial value of the Poisson weight used in the summation (1) was too small to be calculated. The value of is likely to be zero.
- The solution has failed to converge in maxit iterations.
- The calculations for the central probability has failed to converge. This is an unlikely error exit. A larger value of tol should be used.
Accuracy
The summations described in [Description] are made until an upper bound on the truncation error relative to the current summation value is less than tol.
Parallelism and Performance
None.
Further Comments
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 . |
Example
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.
Example program (C#): g01gce.cs