g01gb returns the lower tail probability for the noncentral Student's -distribution.
Syntax
C# |
---|
public static double g01gb( double t, double df, double delta, double tol, int maxit, out int ifail ) |
Visual Basic |
---|
Public Shared Function g01gb ( _ t As Double, _ df As Double, _ delta As Double, _ tol As Double, _ maxit As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) As Double |
Visual C++ |
---|
public: static double g01gb( double t, double df, double delta, double tol, int maxit, [OutAttribute] int% ifail ) |
F# |
---|
static member g01gb : t : float * df : float * delta : float * tol : float * maxit : int * ifail : int byref -> float |
Parameters
- t
- Type: System..::..DoubleOn entry: , the deviate from the Student's -distribution with degrees of freedom.
- df
- Type: System..::..DoubleOn entry: , the degrees of freedom of the Student's -distribution.Constraint: .
- delta
- Type: System..::..DoubleOn entry: , the noncentrality parameter of the Students -distribution.
- tol
- Type: System..::..Double
- maxit
- Type: System..::..Int32On entry: the maximum number of terms that are used in each of the summations.Suggested value: . See [Further Comments] for further comments.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
g01gb returns the lower tail probability for the noncentral Student's -distribution.
Description
The lower tail probability of the noncentral Student's -distribution with degrees of freedom and noncentrality parameter , , is defined by
with
The probability is computed in one of two ways.
(i) | When , the relationship to the normal is used:
|
||
(ii) | Otherwise the series expansion described in Equation 9 of Amos (1964) is used. This involves the sums of confluent hypergeometric functions, the terms of which are computed using recurrence relationships. |
References
Amos D E (1964) Representations of the central and non-central -distributions Biometrika 51 451–458
Error Indicators and Warnings
Errors or warnings detected by the method:
If on exit , then g01gb returns .
On entry, .
On entry, .
- One of the series has failed to converge. Reconsider the requested tolerance and/or maximum number of iterations.
- The probability is too small to calculate accurately.
Accuracy
The series described in Amos (1964) are summed until an estimated upper bound on the contribution of future terms to the probability is less than tol. There may also be some loss of accuracy due to calculation of gamma functions.
Parallelism and Performance
None.
Further Comments
The rate of convergence of the series depends, in part, on the quantity . The smaller this quantity the faster the convergence. Thus for large and small the convergence may be slow. If is an integer then one of the series to be summed is of finite length.
If two tail probabilities are required then the relationship of the -distribution to the -distribution can be used:
and a call made to g01gd.
Note that g01gb only allows degrees of freedom greater than or equal to although values between and are theoretically possible.
Example
This example reads values from, and degrees of freedom for, and noncentrality parameters of the noncentral Student's -distributions, calculates the lower tail probabilities and prints all these values until the end of data is reached.
Example program (C#): g01gbe.cs