next up previous index
Next: G105 Inverse of Up: CERNLIB Previous: G103 Kolmogorov Test

G104 Student's t-Distribution and Its Inverse

Routine ID: G104
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.02.1994
Language: FortranRevised:

Function subprogram STUDIS calculates the value of the Student t-distribution function

F(t,n) = {Γ({12}(n+1))πn Γ({12}n)}∫-&inf;t ( 1+{x2n})-{12}(n+1)dx

for a given degrees of freedom n ≥1 .

Function subprogram STUDIN calculates the inverse t(F,n) .

Structure:

FUNCTION subprogram
User Entry Names: STUDIS, STUDIN
Files Referenced: Printer
External References: GAUSIN (G105), MTLMTR (N002), ABEND (Z035)

Usage:

In any arithmetic expression, STUDIS(T,N) or STUDIN(F,N) has the value F(T,N) or t(F,N) ,

respectively. STUDIS, STUDIN, F and T are of type REAL, N is of type INTEGER.

Error handling:

Error G104.1: N ≤0 .
Error G104.2: F < 0 or F > 1 .
In both cases, a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

Accuracy:

About six decimal places are usually correct. Accuracy is lost for STUDIS when T << 0 and N > 4 .

Notes:

The subprograms are based on algorithms given in the references.

References:

  1. B.E. Cooper, Algorithm AS3 - Applied Statistics 17 (1968) 189.
  2. G.W. Hill, Algorithm 396, Student's t-quantiles, Collected algorithms from CACM (1970).

G105


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995