PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_prob_f_noncentral (g01gd)
Purpose
nag_stat_prob_f_noncentral (g01gd) returns the probability associated with the lower tail of the noncentral or variance-ratio distribution.
Syntax
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 23: |
tol was made optional (default 0) |
Description
The lower tail probability of the noncentral
-distribution with
and
degrees of freedom and noncentrality parameter
,
, is defined by
where
and
is the beta function.
The probability is computed by means of a transformation to a noncentral beta distribution:
where
and
is the lower tail probability integral of the noncentral beta distribution with parameters
,
, and
.
If is very large, greater than , then a approximation is used.
References
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
, the deviate from the noncentral -distribution.
Constraint:
.
- 2:
– double scalar
-
The degrees of freedom of the numerator variance, .
Constraint:
.
- 3:
– double scalar
-
The degrees of freedom of the denominator variance, .
Constraint:
.
- 4:
– double scalar
-
, the noncentrality parameter.
Constraint:
where
is the safe range parameter as defined by
nag_machine_real_safe (x02am).
Optional Input Parameters
- 1:
– double scalar
Default:
The relative accuracy required by you in the results. If
nag_stat_prob_f_noncentral (g01gd) is entered with
tol greater than or equal to
or less than
(see
nag_machine_precision (x02aj)), then the value of
is used instead.
- 2:
– int64int32nag_int scalar
The maximum number of iterations to be used.
Constraint:
.
Output Parameters
- 1:
– double scalar
The result of the function.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Note: nag_stat_prob_f_noncentral (g01gd) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
If on exit or , then nag_stat_prob_f_noncentral (g01gd) returns .
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
-
On entry, | , |
or | , |
or | , |
or | , |
or | , |
or | , |
or | , where safe range argument as defined by nag_machine_real_safe (x02am). |
-
-
The solution has failed to converge in
maxit iterations. You should try a larger value of
maxit or
tol.
-
-
The required probability cannot be computed accurately. This may happen if the result would be very close to
or
. Alternatively the values of
df1 and
f may be too large. In the latter case you could try using a normal approximation; see
Abramowitz and Stegun (1972).
- W
-
The required accuracy was not achieved when calculating the initial value of the central
(or
) probability. You should try a larger value of
tol. If the
approximation is being used then
nag_stat_prob_f_noncentral (g01gd) returns zero otherwise the value returned should be an approximation to the correct value.
-
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
The relative accuracy should be as specified by
tol. For further details see
nag_stat_prob_chisq_noncentral (g01gc) and
nag_stat_prob_beta_noncentral (g01ge).
Further Comments
When both
and
are large a Normal approximation may be used and when only
is large a
approximation may be used. In both cases
is required to be of the same order as
. See
Abramowitz and Stegun (1972) for further details.
Example
This example reads values from, and degrees of freedom for, -distributions, computes the lower tail probabilities and prints all these values until the end of data is reached.
Open in the MATLAB editor:
g01gd_example
function g01gd_example
fprintf('g01gd example results\n\n');
f = [ 5.5 39.9 2.5 ];
df1 = [ 1.5 1 20.25];
df2 = [ 25.5 1 1 ];
rlamda = [ 3 2 0 ];
p = f;
fprintf(' f df1 df2 rlamda p\n');
for j = 1:numel(f)
[p(j), ifail] = g01gd( ...
f(j), df1(j), df2(j), rlamda(j));
end
fprintf('%8.3f%8.3f%8.3f%8.3f%8.4f\n', [f; df1; df2; rlamda; p]);
g01gd example results
f df1 df2 rlamda p
5.500 1.500 25.500 3.000 0.8214
39.900 1.000 1.000 2.000 0.8160
2.500 20.250 1.000 0.000 0.5342
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015