PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_prob_f (g01ed)
Purpose
nag_stat_prob_f (g01ed) returns the probability for the lower or upper tail of the or variance-ratio distribution with real degrees of freedom.
Syntax
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 23: |
tail was made optional (default 'L') |
Description
The lower tail probability for the
, or variance-ratio distribution,
with
and
degrees of freedom,
, is defined by:
for
,
,
.
The probability is computed by means of a transformation to a beta distribution,
:
and using a call to
nag_stat_prob_beta (g01ee).
For very large values of both
and
, greater than
, a normal approximation is used. If only one of
or
is greater than
then a
approximation is used, see
Abramowitz and Stegun (1972).
References
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
, the value of the variate.
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:
.
Optional Input Parameters
- 1:
– string (length ≥ 1)
Default:
Indicates whether an upper or lower tail probability is required.
- The lower tail probability is returned, i.e., .
- The upper tail probability is returned, i.e., .
Constraint:
or .
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 (g01ed) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
If , or on exit, then nag_stat_prob_f (g01ed) returns .
-
-
On entry, | or . |
-
-
-
-
On entry, | , |
or | . |
-
-
f is too far out into the tails for the probability to be evaluated exactly. The result tends to approach
if
is large, or
if
is small. The result returned is a good approximation to the required solution.
-
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 result should be accurate to five significant digits.
Further Comments
For higher accuracy
nag_stat_prob_beta (g01ee) can be used along with the transformations given in
Description.
Example
This example reads values from, and degrees of freedom for, a number of -distributions and computes the associated lower tail probabilities.
Open in the MATLAB editor:
g01ed_example
function g01ed_example
fprintf('g01ed example results\n\n');
f = [ 5.5; 39.9; 2.50];
df1 = [ 1.5; 1.0; 20.25];
df2 = [25.5; 1.0; 1.00];
tail = {'Lower'; 'Lower'; 'Lower';};
fprintf(' Tail F df1 df2 probability\n');
for j = 1:numel(f);
[p, ifail] = g01ed( ...
f(j), df1(j), df2(j), 'tail', tail{j});
fprintf('%4s%8.3f%8.1f%8.1f%12.4f\n',tail{j}(1), f(j), df1(j), df2(j), p);
end
g01ed example results
Tail F df1 df2 probability
L 5.500 1.5 25.5 0.9837
L 39.900 1.0 1.0 0.9000
L 2.500 20.2 1.0 0.5342
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015