NAG Library Routine Document
G01JCF returns the lower tail probability of a distribution of a positive linear combination of random variables.
|SUBROUTINE G01JCF (
||A, MULT, RLAMDA, N, C, P, PDF, TOL, MAXIT, WRK, IFAIL)
||MULT(N), N, MAXIT, IFAIL
||A(N), RLAMDA(N), C, P, PDF, TOL, WRK(N+2*MAXIT)
For a linear combination of noncentral
random variables with integer degrees of freedom the lower tail probability is
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.
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
, i.e., the probability that a central
is less than
The value of
is set at
, in which case
is used, where
Farebrother R W (1984) The distribution of a positive linear combination of random variables Appl. Statist. 33(3)
- 1: A(N) – REAL (KIND=nag_wp) arrayInput
On entry: the weights, .
, for .
- 2: MULT(N) – INTEGER arrayInput
On entry: the degrees of freedom, .
, for .
- 3: RLAMDA(N) – REAL (KIND=nag_wp) arrayInput
On entry: the noncentrality parameters, .
, for .
- 4: N – INTEGERInput
, the number of
random variables in the combination, i.e., the number of terms in equation (1)
- 5: C – REAL (KIND=nag_wp)Input
On entry: , the point for which the lower tail probability is to be evaluated.
- 6: P – REAL (KIND=nag_wp)Output
On exit: the lower tail probability associated with the linear combination of random variables with
degrees of freedom, and noncentrality parameters , for .
- 7: PDF – REAL (KIND=nag_wp)Output
On exit: the value of the probability density function of the linear combination of variables.
- 8: TOL – REAL (KIND=nag_wp)Input
: the relative accuracy required by you in the results. If G01JCF is entered with TOL
greater than or equal to
or less than
), then the value of
is used instead.
- 9: MAXIT – INTEGERInput
On entry: the maximum number of terms that should be used during the summation.
- 10: WRK() – REAL (KIND=nag_wp) arrayWorkspace
- 11: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, because for this routine the values of the output parameters may be useful even if
on exit, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Note: G01JCF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
If on exit or , then G01JCF returns .
|On entry,||A has an element ,|
|or||MULT has an element ,|
|or||RLAMDA has an element .|
calculation has failed to converge. This is an unlikely exit. A larger value of TOL
should be tried.
The solution has failed to converge within MAXIT
iterations. A larger value of MAXIT
should be used. The returned value should be a reasonable approximation to the correct value.
The solution appears to be too close to or for accurate calculation. The value returned is or as appropriate.
The series (2)
is summed until a bound on the truncation error is less than TOL
. See Farebrother (1984)
for further discussion.
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.
9.1 Program Text
Program Text (g01jcfe.f90)
9.2 Program Data
Program Data (g01jcfe.d)
9.3 Program Results
Program Results (g01jcfe.r)