edu.northwestern.at.utils.math.distributions
Class Studentst

java.lang.Object
  extended by edu.northwestern.at.utils.math.distributions.Studentst

public class Studentst
extends java.lang.Object

Student's t distribution functions.


Constructor Summary
protected Studentst()
          Make class non-instantiable but inheritable.
 
Method Summary
static double t(double t, double df)
          Compute probability for Student t distribution.
static double tInverse(double p, double df)
          Compute percentage point for Student t distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Studentst

protected Studentst()
Make class non-instantiable but inheritable.

Method Detail

t

public static double t(double t,
                       double df)
                throws java.lang.IllegalArgumentException
Compute probability for Student t distribution.

Parameters:
t - Percentage point of Student t distribution
df - Degrees of freedom
Returns:
The corresponding probability for the Student t distribution.
Throws:
java.lang.IllegalArgumentException - if df <= 0

The probability is computed using the following relationship between the incomplete beta distribution and Student's t:

tprob(t) = incompleteBeta( df/(df*t*t), df/2, 0.5 )

The result is accurate to about 14 decimal digits.


tInverse

public static double tInverse(double p,
                              double df)
                       throws java.lang.ArithmeticException,
                              java.lang.IllegalArgumentException
Compute percentage point for Student t distribution.

Parameters:
p - Probability level for percentage point
df - Degrees of freedom
Returns:
The corresponding percentage point of the Student t distribution.
Throws:
java.lang.IllegalArgumentException - p < 0 or p > 1 or df <= 0
java.lang.ArithmeticException - if incomplete beta evaluation fails

The percentage point is computed using the inverse incomplete beta distribution. This allows for fractional degrees of freedom.