SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.distribution.univariate
Class TDistribution

java.lang.Object
  extended by com.numericalmethod.suanshu.stats.distribution.univariate.TDistribution
All Implemented Interfaces:
UnivariateDistribution

public class TDistribution
extends java.lang.Object
implements UnivariateDistribution

Student's t distribution is the probability distribution of t, where

      x̄ - μ
 t = ------------
      s / sqrt(N)
 

The importance of the Student's distribution is when (as in nearly all practical statistical work) the population standard deviation is unknown and has to be estimated from the data. This is especially true when the sample size is small. When the sample size is large, the Student's distribution converges to the Normal distribution.

The R equivalent functions are dt, pt, qt, rt.

See Also:
Wikipedia: Student's t-distribution

Field Summary
 double v
          the degree of freedom
 
Constructor Summary
TDistribution(double v)
          Construct a Student's t distribution.
 
Method Summary
 double cdf(double x)
          The cumulative distribution function.
 double density(double x)
          The density function, which, if exists, is the derivative of F.
 double entropy()
          Get the entropy of this distribution.
 double kurtosis()
          Get the excess kurtosis of this distribution.
 double mean()
          Get the mean of this distribution.
 double median()
          Get the median of this distribution.
 double moment(double x)
          The moment generating function, which is the expected value of etX This may not always exist.
 double quantile(double u)
          The inverse of the cumulative distribution function.
 double skew()
          Get the skewness of this distribution.
 double variance()
          Get the variance of this distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

v

public final double v
the degree of freedom

Constructor Detail

TDistribution

public TDistribution(double v)
Construct a Student's t distribution.

Parameters:
v - the degree of freedom
Method Detail

mean

public double mean()
Get the mean of this distribution.

Specified by:
mean in interface UnivariateDistribution
Returns:
the mean
Throws:
java.lang.UnsupportedOperationException - when v <= 1
See Also:
Wikipedia: Expected value

median

public double median()
Description copied from interface: UnivariateDistribution
Get the median of this distribution.

Specified by:
median in interface UnivariateDistribution
Returns:
the median
See Also:
Wikipedia: Median

variance

public double variance()
Get the variance of this distribution.

Specified by:
variance in interface UnivariateDistribution
Returns:
the variance
Throws:
java.lang.UnsupportedOperationException - when v < 2
See Also:
Wikipedia: Variance

skew

public double skew()
Get the skewness of this distribution.

Specified by:
skew in interface UnivariateDistribution
Returns:
the skewness
Throws:
java.lang.UnsupportedOperationException - when v <= 3
See Also:
Wikipedia: Skewness

kurtosis

public double kurtosis()
Get the excess kurtosis of this distribution.

Specified by:
kurtosis in interface UnivariateDistribution
Returns:
the excess kurtosis
Throws:
java.lang.UnsupportedOperationException - when v <= 4
See Also:
Wikipedia: Kurtosis

entropy

public double entropy()
Description copied from interface: UnivariateDistribution
Get the entropy of this distribution.

Specified by:
entropy in interface UnivariateDistribution
Returns:
the entropy
See Also:
Wikipedia: Entropy (information theory)

cdf

public double cdf(double x)
Description copied from interface: UnivariateDistribution
The cumulative distribution function.
F(x) = Pr(X <= x)

Specified by:
cdf in interface UnivariateDistribution
Parameters:
x - x
Returns:
F(x) = Pr(X <= x)
See Also:
Wikipedia: Cumulative distribution function

density

public double density(double x)
Description copied from interface: UnivariateDistribution
The density function, which, if exists, is the derivative of F. It describes the density of probability at each point in the sample space.
f(x) = dF(X) / dx

This may not always exist. For the discrete cases, this is the probability mass function. It gives the probability that a discrete random variable is exactly equal to some value.

Specified by:
density in interface UnivariateDistribution
Parameters:
x - x
Returns:
F(x) = Pr(X <= x)
See Also:

quantile

public double quantile(double u)
Description copied from interface: UnivariateDistribution
The inverse of the cumulative distribution function. It returns the value below which random draws from the given distribution would fall, u×100 percent of the time.
F-1(u) = x, such that Pr(X <= x) = u

This may not always exist.

Specified by:
quantile in interface UnivariateDistribution
Parameters:
u - u
Returns:
F-1(u)
See Also:
Wikipedia: Quantile function

moment

public double moment(double x)
Description copied from interface: UnivariateDistribution
The moment generating function, which is the expected value of
etX

This may not always exist.

Specified by:
moment in interface UnivariateDistribution
Parameters:
x - x
Returns:
E(exp(tX))
See Also:
Wikipedia: Moment-generating function

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.