PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_inv_cdf_students_t (g01fb)
Purpose
nag_stat_inv_cdf_students_t (g01fb) returns the deviate associated with the given tail probability of Student's -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 deviate,
associated with the lower tail probability,
, of the Student's
-distribution with
degrees of freedom is defined as the solution to
For the integral equation is easily solved for .
For other values of
a transformation to the beta distribution is used and the result obtained from
nag_stat_inv_cdf_beta (g01fe).
For
an inverse asymptotic expansion of Cornish–Fisher type is used. The algorithm is described by
Hill (1970).
References
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Hill G W (1970) Student's -distribution Comm. ACM 13(10) 617–619
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
, the probability from the required Student's
-distribution as defined by
tail.
Constraint:
.
- 2:
– double scalar
-
, the degrees of freedom of the Student's -distribution.
Constraint:
.
Optional Input Parameters
- 1:
– string (length ≥ 1)
Default:
Indicates which tail the supplied probability represents.
- The upper tail probability, i.e., .
- The lower tail probability, i.e., .
- The two tail (significance level) probability, i.e., .
- The two tail (confidence interval) probability, 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_inv_cdf_students_t (g01fb) 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_inv_cdf_students_t (g01fb) returns zero.
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
-
Convergence in the calculation of the inverse beta value was not achieved. However, the result should be a reasonable 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 results should be accurate to five significant digits, for most argument values. The error behaviour for various argument values is discussed in
Hill (1970).
Further Comments
The value
may be calculated by using the transformation described in
Description and using
nag_stat_inv_cdf_beta (g01fe). This function allows you to set the required accuracy.
Example
This example reads the probability, the tail that probability represents and the degrees of freedom for a number of Student's -distributions and computes the corresponding deviates.
Open in the MATLAB editor:
g01fb_example
function g01fb_example
fprintf('g01fb example results\n\n');
p = [ 0.01; 0.01; 0.99];
df = [20; 7.5; 45.00];
tail = {'Significance'; 'Lower'; 'Confidence' };
fprintf(' p df tail x\n');
for j = 1:numel(p);
[x, ifail] = g01fb( ...
p(j) , df(j), 'tail', tail{j});
fprintf('%9.3f%8.3f%4s%12.3f\n', p(j), df(j), tail{j}(1), x);
end
g01fb example results
p df tail x
0.010 20.000 S 2.845
0.010 7.500 L -2.943
0.990 45.000 C 2.690
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015