The IMSL_TCDF function evaluates the Student’s t distribution or non-central Student’s t distribution. Using a keyword the inverse of these distributions can be computed.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

If Two Input Arguments Are Used

The IMSL_TCDF function evaluates the distribution function of a Student’s t random variable with ν = df degrees of freedom. If t2 ≥ ν, the relationship of a t to an F random variable (and subsequently, to a beta random variable) is exploited, and percentage points from a beta distribution are used. Otherwise, the method described by Hill (1970) is used. If ν is not an integer or if ν is greater than 19, a Cornish-Fisher expansion is used to evaluate the distribution function. If ν is less than 20 and |t| is less than 2.0, a trigonometric series (see Abramowitz and Stegun 1964, Equations 26.7.3 and 26.7.4, with some rearrangement) is used. For the remaining cases, a series given by Hill (1970) that converges well for large values of t is used.

If keyword INVERSE is specified, the IMSL_TCDF function evaluates the inverse distribution function of a Student’s t random variable with ν = df degrees of freedom.

If ν equals 1 or 2, the inverse can be obtained in closed form. If ν is between 1 and 2, the relationship of a t to a beta random variable is exploited, and the inverse of the beta distribution is used to evaluate the inverse. Otherwise, the algorithm of Hill (1970) is used. For small values of ν greater than 2, Hill’s algorithm inverts an integrated expansion in 1 / (1 + t2 / ν) of the t density. For larger values, an asymptotic inverse Cornish-Fisher type expansion about normal deviates is used.

If Three Input Arguments Are Used

The IMSL_TCDF function evaluates the distribution function F of a non-central t random variable with df degrees of freedom and non-centrality parameter delta; that is, with v = df, δ = delta, and t0 = t:

where Γ(·) is the gamma function. The value of the distribution function at the point t0 is the probability that the random variable takes a value less than or equal to t0.

The non-central t random variable can be defined by the distribution function above, or alternatively and equivalently, as the ratio of a normal random variable and an independent chi-squared random variable. If w has a normal distribution with mean δ and variance equal to one, u has an independent chi-squared distribution with v degrees of freedom, and:

then x has a non-central t distribution with degrees of freedom and non-centrality parameter δ.

The distribution function of the non-central t can also be expressed as a double integral involving a normal density function (see, for example, Owen 1962, page 108). The function TNDF uses the method of Owen (1962, 1965), which uses repeated integration by parts on that alternate expression for the distribution function.

If INVERSE is specified IMSL_TCDF evaluates the inverse distribution function of a non-central t random variable with df degrees of freedom and non-centrality parameter delta; that is, with P = t, v = df, and δ = delta, it determines t0 (= IMSL_TCDF(t, df, delta)), such that:

where Γ(·) is the gamma function. The probability that the random variable takes a value less than or equal to t0 is P.

Examples


Example 1

This example finds the probability that a t random variable with six degrees of freedom is greater in absolute value than 2.447. Argument t is symmetric about zero.

p = 2 * IMSL_TCDF(-2.447, 6)
PM, 'Pr(|t(6)| > 2.447) = ', p, FORMAT = '(a21, f7.4)'
 
Pr(|t(6)| > 2.447) = 0.0500

Syntax


Result = IMSL_TCDF(T, Df[, Delta] [, /DOUBLE] [, /INVERSE])

Return Value


The probability that a Student’s t random variable takes a value less than or equal to the input t.

Arguments


Delta (optional)

(Optional) The non-centrality parameter.

Df

Degrees of freedom. Argument df must be greater than or equal to 1.0.

T

Argument for which the Student’s t distribution function is to be evaluated. If Inverse is specified, argument t represents the probability for which the inverse of the Student’s t distribution function is to be evaluated. In this case, t must be in the open interval (0.0, 1.0).

Keywords


DOUBLE (optional)

If present and nonzero, double precision is used.

INVERSE (optional)

If present and nonzero, evaluates the inverse of the Student’s t distribution function. If INVERSE is specified, argument t represents the probability for which the inverse of the Student’s t distribution function is to be evaluated. In this case, t must be in the open interval (0.0, 1.0).

Errors


Informational Errors

STAT_OVERFLOW: IMSL_TCDF is set to machine infinity since overflow would occur upon modifying the inverse value for the F distribution with the result obtained from the inverse beta distribution.

Version History


6.4

Introduced