NAG Library Function Document
nag_deviates_students_t (g01fbc) returns the deviate associated with the given tail probability of Student's -distribution with real degrees of freedom.
||nag_deviates_students_t (Nag_TailProbability tail,
associated with the lower tail probability,
, of the Student's
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_deviates_beta (g01fec)
an inverse asymptotic expansion of Cornish–Fisher type is used. The algorithm is described by Hill (1970)
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
tail – Nag_TailProbabilityInput
: 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., .
, , or .
p – doubleInput
, the probability from the required Student's
-distribution as defined by tail
df – doubleInput
On entry: , the degrees of freedom of the Student's -distribution.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
- On any of the error conditions listed below except NE_SOL_NOT_CONV nag_deviates_students_t (g01fbc) returns .
Dynamic memory allocation failed.
On entry, argument had an illegal value.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
On entry, .
On entry, .
On entry, .
The solution has failed to converge.
However, the result should be a reasonable approximation.
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)
may be calculated by using the transformation described in Section 3
and using nag_deviates_beta (g01fec)
. This function allows you to set the required accuracy.
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.
9.1 Program Text
Program Text (g01fbce.c)
9.2 Program Data
Program Data (g01fbce.d)
9.3 Program Results
Program Results (g01fbce.r)