g01eb returns the lower tail, upper tail or two tail probability for the Student's t-distribution with real degrees of freedom.

Syntax

C#
public static double g01eb(
	string tail,
	double t,
	double df,
	out int ifail
)
Visual Basic
Public Shared Function g01eb ( _
	tail As String, _
	t As Double, _
	df As Double, _
	<OutAttribute> ByRef ifail As Integer _
) As Double
Visual C++
public:
static double g01eb(
	String^ tail, 
	double t, 
	double df, 
	[OutAttribute] int% ifail
)
F#
static member g01eb : 
        tail : string * 
        t : float * 
        df : float * 
        ifail : int byref -> float 

Parameters

tail
Type: System..::..String
On entry: indicates which tail the returned probability should represent.
tail="U"
The upper tail probability is returned, i.e., PTt:ν.
tail="S"
The two tail (significance level) probability is returned, i.e., PTt:ν+PT-t:ν.
tail="C"
The two tail (confidence interval) probability is returned, i.e., PTt:ν-PT-t:ν.
tail="L"
The lower tail probability is returned, i.e., PTt:ν.
Constraint: tail="U", "S", "C" or "L".
t
Type: System..::..Double
On entry: t, the value of the Student's t variate.
df
Type: System..::..Double
On entry: ν, the degrees of freedom of the Student's t-distribution.
Constraint: df1.0.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Return Value

g01eb returns the lower tail, upper tail or two tail probability for the Student's t-distribution with real degrees of freedom.

Description

The lower tail probability for the Student's t-distribution with ν degrees of freedom, PTt:ν is defined by:
PTt:ν=Γν+1/2πνΓν/2-t1+T2ν-ν+1/2dT,  ν1.
Computationally, there are two situations:
(i) when ν<20, a transformation of the beta distribution, PβBβ:a,b is used
PTt:ν=12PβBνν+t2:ν/2,12  when ​t<0.0
or
PTt:ν=12+12PβBνν+t2:ν/2,12  when ​t>0.0;
(ii) when ν20, 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 t-distribution Comm. ACM 13(10) 617–619

Error Indicators and Warnings

Errors or warnings detected by the method:
If ifail0, then g01eb returns 0.0.
ifail=1
On entry,tail"U", "S", "C" or "L".
ifail=2
On entry,df<1.0.
ifail=-9000
An error occured, see message report.

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 10-10), see Hastings and Peacock (1975).

Parallelism and Performance

None.

Further Comments

The probabilities could also be obtained by using the appropriate transformation to a beta distribution (see Abramowitz and Stegun (1972)) and using g01ee. This method allows you to set the required accuracy.

Example

This example reads values from, and degrees of freedom for Student's t-distributions along with the required tail. The probabilities are calculated and printed until the end of data is reached.

Example program (C#): g01ebe.cs

Example program data: g01ebe.d

Example program results: g01ebe.r

See Also