g01jc returns the lower tail probability of a distribution of a positive linear combination of random variables.
Syntax
C# |
---|
public static void g01jc( double[] a, int[] mult, double[] rlamda, int n, double c, out double p, out double pdf, double tol, int maxit, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g01jc ( _ a As Double(), _ mult As Integer(), _ rlamda As Double(), _ n As Integer, _ c As Double, _ <OutAttribute> ByRef p As Double, _ <OutAttribute> ByRef pdf As Double, _ tol As Double, _ maxit As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g01jc( array<double>^ a, array<int>^ mult, array<double>^ rlamda, int n, double c, [OutAttribute] double% p, [OutAttribute] double% pdf, double tol, int maxit, [OutAttribute] int% ifail ) |
F# |
---|
static member g01jc : a : float[] * mult : int[] * rlamda : float[] * n : int * c : float * p : float byref * pdf : float byref * tol : float * maxit : int * ifail : int byref -> unit |
Parameters
- a
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: the weights, .Constraint: , for .
- mult
- Type: array<System..::..Int32>[]()[][]An array of size [n]On entry: the degrees of freedom, .Constraint: , for .
- rlamda
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: the noncentrality parameters, .Constraint: , for .
- n
- Type: System..::..Int32On entry: , the number of random variables in the combination, i.e., the number of terms in equation (1).Constraint: .
- c
- Type: System..::..DoubleOn entry: , the point for which the lower tail probability is to be evaluated.Constraint: .
- p
- Type: System..::..Double%On exit: the lower tail probability associated with the linear combination of random variables with degrees of freedom, and noncentrality parameters , for .
- Type: System..::..Double%On exit: the value of the probability density function of the linear combination of variables.
- tol
- Type: System..::..Double
- maxit
- Type: System..::..Int32On entry: the maximum number of terms that should be used during the summation.Suggested value: .Constraint: .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
For a linear combination of noncentral random variables with integer degrees of freedom the lower tail probability is
where and are positive constants and where represents an independent random variable with degrees of freedom and noncentrality parameter . The linear combination may arise from considering a quadratic form in Normal variables.
(1) |
Ruben's method as described in Farebrother (1984) is used. Ruben has shown that (1) may be expanded as an infinite series of the form
where , i.e., the probability that a central is less than .
(2) |
The value of is set at
unless , in which case
is used, where and , for .
References
Farebrother R W (1984) The distribution of a positive linear combination of random variables Appl. Statist. 33(3)
Error Indicators and Warnings
Note: g01jc 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 g01jc returns .
On entry, , or , or .
- The central calculation has failed to converge. This is an unlikely exit. A larger value of tol should be tried.
- The solution appears to be too close to or for accurate calculation. The value returned is or as appropriate.
Accuracy
The series (2) is summed until a bound on the truncation error is less than tol. See Farebrother (1984) for further discussion.
Parallelism and Performance
None.
Further Comments
None.
Example
The number of variables is read along with their coefficients, degrees of freedom and noncentrality parameters. The lower tail probability is then computed and printed.
Example program (C#): g01jce.cs