NAG Library Function Document
nag_prob_lin_chi_sq (g01jdc) calculates the lower tail probability for a linear combination of (central) variables.
||nag_prob_lin_chi_sq (Nag_LCCMethod method,
const double rlam,
be independent Normal variables with mean zero and unit variance, so that
-distributions with unit degrees of freedom. nag_prob_lin_chi_sq (g01jdc) evaluates the probability that
this is equivalent to the probability that
then nag_prob_lin_chi_sq (g01jdc) returns the probability that
Two methods are available. One due to Pan (1964)
(see Farebrother (1980)
) makes use of series approximations. The other method due to Imhof (1961)
reduces the problem to a one-dimensional integral. If
then a non-adaptive method
is used to compute the value of the integral otherwise
Pan's procedure can only be used if the
are sufficiently distinct; nag_prob_lin_chi_sq (g01jdc) requires the
to be at least
distinct; see Section 9
. If the
are at least
, then Pan's procedure is recommended; otherwise Imhof's procedure is recommended.
Farebrother R W (1980) Algorithm AS 153. Pan's procedure for the tail probabilities of the Durbin–Watson statistic Appl. Statist. 29 224–227
Imhof J P (1961) Computing the distribution of quadratic forms in Normal variables Biometrika 48 419–426
Pan Jie–Jian (1964) Distributions of the noncircular serial correlation coefficients Shuxue Jinzhan 7 328–337
method – Nag_LCCMethodInput
: indicates whether Pan's, Imhof's or an appropriately selected procedure is to be used.
- Pan's method is used.
- Imhof's method is used.
- Pan's method is used if
, for are at least distinct and ; otherwise Imhof's method is used.
, or .
n – IntegerInput
On entry: , the number of independent standard Normal variates, (central variates).
rlam[n] – const doubleInput
On entry: the weights,
, for , of the central variables.
for at least one
, then the
must be at least
distinct; see Section 9
d – doubleInput
On entry: , the multiplier of the central variables.
c – doubleInput
On entry: , the value of the constant.
prob – double *Output
On exit: the lower tail probability for the linear combination of central variables.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
Dynamic memory allocation failed.
On entry, argument had an illegal value.
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
On entry, .
On entry, all values of .
On entry, but two successive values of were not percent distinct.
On successful exit at least four decimal places of accuracy should be achieved.
8 Parallelism and Performance
nag_prob_lin_chi_sq (g01jdc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the Users' Note
for your implementation for any additional implementation-specific information.
Pan's procedure can only work if the are sufficiently distinct. nag_prob_lin_chi_sq (g01jdc) uses the check , where the are the ordered nonzero values of .
For the situation when all the
are positive nag_prob_lin_non_central_chi_sq (g01jcc)
may be used. If the probabilities required are for the Durbin–Watson test, then the bounds for the probabilities are given by nag_prob_durbin_watson (g01epc)
For , the choice of method, values of and and the are input and the probabilities computed and printed.
10.1 Program Text
Program Text (g01jdce.c)
10.2 Program Data
Program Data (g01jdce.d)
10.3 Program Results
Program Results (g01jdce.r)