PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_prob_chisq_lincomb (g01jd)
Purpose
nag_stat_prob_chisq_lincomb (g01jd) calculates the lower tail probability for a linear combination of (central) variables.
Syntax
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 23: |
method was made optional (default 'D') |
Description
Let
be independent Normal variables with mean zero and unit variance, so that
have independent
-distributions with unit degrees of freedom.
nag_stat_prob_chisq_lincomb (g01jd) evaluates the probability that
If
this is equivalent to the probability that
Alternatively let
then
nag_stat_prob_chisq_lincomb (g01jd) 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
described in
nag_quad_1d_fin_smooth (d01bd)
is used to compute the value of the integral otherwise
nag_quad_1d_fin_bad (d01aj)
is used.
Pan's procedure can only be used if the
are sufficiently distinct;
nag_stat_prob_chisq_lincomb (g01jd) requires the
to be at least
distinct; see
Further Comments. If the
are at least
distinct and
, then Pan's procedure is recommended; otherwise Imhof's procedure is recommended.
References
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
Parameters
Compulsory Input Parameters
- 1:
– double array
-
The weights,
, for , of the central variables.
Constraint:
for at least one
. If
, then the
must be at least
distinct; see
Further Comments, for
.
- 2:
– double scalar
-
, the multiplier of the central variables.
Constraint:
.
- 3:
– double scalar
-
, the value of the constant.
Optional Input Parameters
- 1:
– string (length ≥ 1)
Default:
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.
Constraint:
, or .
- 2:
– int64int32nag_int scalar
-
Default:
the dimension of the array
rlam.
, the number of independent standard Normal variates, (central variates).
Constraint:
.
Output Parameters
- 1:
– double scalar
-
The lower tail probability for the linear combination of central variables.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
On entry, | , |
or | , |
or | , or . |
-
-
On entry, for all values of , for .
-
-
On entry, yet two successive values of the ordered , for , were not at least distinct.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
On successful exit at least four decimal places of accuracy should be achieved.
Further Comments
Pan's procedure can only work if the are sufficiently distinct. nag_stat_prob_chisq_lincomb (g01jd) uses the check , where the are the ordered nonzero values of .
For the situation when all the
are positive
nag_stat_prob_chisq_noncentral_lincomb (g01jc) may be used. If the probabilities required are for the Durbin–Watson test, then the bounds for the probabilities are given by
nag_stat_prob_durbin_watson (g01ep).
Example
For , the choice of method, values of and and the are input and the probabilities computed and printed.
Open in the MATLAB editor:
g01jd_example
function g01jd_example
fprintf('g01jd example results\n\n');
method = 'P';
rlam = [-9 -7 -5 -3 -1 2 4 6 8 10];
d = 1;
c = 0;
[p, ifail] = g01jd( ...
rlam, d, c, 'method', method);
fprintf('lambda = ');
fprintf('%6.1f',rlam);
fprintf('\n d = %6.1f\n', d);
fprintf(' c = %6.1f\n\n', c);
fprintf(' prob = %9.4f\n', p);
g01jd example results
lambda = -9.0 -7.0 -5.0 -3.0 -1.0 2.0 4.0 6.0 8.0 10.0
d = 1.0
c = 0.0
prob = 0.5749
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015