PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_inv_cdf_f (g01fd)
Purpose
nag_stat_inv_cdf_f (g01fd) returns the deviate associated with the given lower tail probability of the or variance-ratio distribution with real degrees of freedom.
Syntax
Description
The deviate,
, associated with the lower tail probability,
, of the
-distribution with degrees of freedom
and
is defined as the solution to
where
;
.
The value of
is computed by means of a transformation to a beta distribution,
:
and using a call to
nag_stat_inv_cdf_beta (g01fe).
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 lower tail probability from the required -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:
.
Optional Input Parameters
None.
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_inv_cdf_f (g01fd) 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_inv_cdf_f (g01fd) 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 | . |
- W
-
The solution has not converged. The result should still be a reasonable approximation to the solution. Alternatively,
nag_stat_inv_cdf_beta (g01fe) can be used with a suitable setting of the argument
tol.
-
-
The value of
p is too close to
or
for the value of
to be computed. This will only occur when the large sample approximations are used.
-
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_inv_cdf_beta (g01fe) can be used along with the transformations given in
Description.
Example
This example reads the lower tail probabilities for several -distributions, and calculates and prints the corresponding deviates until the end of data is reached.
Open in the MATLAB editor:
g01fd_example
function g01fd_example
fprintf('g01fd example results\n\n');
p = [ 0.9837 0.9000 0.5342];
df1 = [10 1 20.25 ];
df2 = [25.5 1 1 ];
fp = p;
fprintf(' p df1 df2 f_p\n');
for j = 1:numel(p)
[fp(j), ifail] = g01fd( ...
p(j), df1(j), df2(j));
end
fprintf('%8.3f%8.3f%8.3f%8.3f\n', [p; df1; df2; fp]);
g01fd example results
p df1 df2 f_p
0.984 10.000 25.500 2.837
0.900 1.000 1.000 39.863
0.534 20.250 1.000 2.500
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015