tInverseCdf¶
Evaluates the inverse of the Student’s t distribution function.
Synopsis¶
tInverseCdf (p, df)
Required Arguments¶
- float
p
(Input) - Probability for which the inverse of the Student’s t distribution
function is to be evaluated. Argument
p
must be in the open interval (0.0, 1.0). - float
df
(Input) - Degrees of freedom. Argument
df
must be greater than or equal to 1.0.
Return Value¶
The inverse of the Student’s t distribution function evaluated at p
.
The probability that a Student’s t random variable takes a value less than
or equal to tInverseCdf
is p
.
Description¶
Function tInverseCdf
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+t^2/\nu)\) of
the t density. For larger values, an asymptotic inverse Cornish-Fisher type
expansion about normal deviates is used.
Example¶
This example finds the 0.05 critical value for a two-sided t test with 6 degrees of freedom.
from __future__ import print_function
from numpy import *
from pyimsl.stat.tInverseCdf import tInverseCdf
p = 0.975
df = 6.0
t = tInverseCdf(p, df)
print("The two-sided t(6) 0.05 critical value is %6.3f" % t)
Output¶
The two-sided t(6) 0.05 critical value is 2.447
Informational Errors¶
IMSLS_OVERFLOW |
Function tInverseCdf 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. |