PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_stat_prob_students_t (g01eb)
Purpose
nag_stat_prob_students_t (g01eb) returns the lower tail, upper tail or two tail probability for the 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 lower tail probability for the Student's
-distribution with
degrees of freedom,
is defined by:
Computationally, there are two situations:
(i) |
when , a transformation of the beta distribution, is used
or
|
(ii) |
when , an asymptotic normalizing expansion of the Cornish–Fisher type is used to evaluate the probability, see Hill (1970). |
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
Hill G W (1970) Student's -distribution Comm. ACM 13(10) 617–619
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
, the value of the Student's variate.
- 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 returned probability should represent.
- The upper tail probability is returned, i.e., .
- The two tail (significance level) probability is returned,
i.e., .
- The two tail (confidence interval) probability is returned,
i.e., .
- The lower 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
Errors or warnings detected by the function:
If , then nag_stat_prob_students_t (g01eb) returns .
-
-
On entry, | , , or . |
-
-
-
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 computed probability should be accurate to five significant places for reasonable probabilities but there will be some loss of accuracy for very low probabilities (less than
), see
Hastings and Peacock (1975).
Further Comments
The probabilities could also be obtained by using the appropriate transformation to a beta distribution (see
Abramowitz and Stegun (1972)) and using
nag_stat_prob_beta (g01ee). This function allows you to set the required accuracy.
Example
This example reads values from, and degrees of freedom for Student's -distributions along with the required tail. The probabilities are calculated and printed until the end of data is reached.
Open in the MATLAB editor:
g01eb_example
function g01eb_example
fprintf('g01eb example results\n\n');
t = 0.85;
df = 20;
tail = {'Lower'; 'Significance'; 'Confidence'; 'Upper'};
fprintf(' Tail t df probability\n');
for j = 1:size(tail,1);
[p, ifail] = g01eb( ...
t, df, 'tail', tail{j});
fprintf('%4s%8.3f%8.1f%12.4f\n', tail{j}(1), t, df, p);
end
g01eb example results
Tail t df probability
L 0.850 20.0 0.7973
S 0.850 20.0 0.4054
C 0.850 20.0 0.5946
U 0.850 20.0 0.2027
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015