org.jscience.mathematics.statistics
Class StudentDistribution

java.lang.Object
  extended by org.jscience.mathematics.statistics.Distribution
      extended by org.jscience.mathematics.statistics.StudentDistribution
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CauchyDistribution

public class StudentDistribution
extends Distribution
implements java.io.Serializable

This class models the student t distribution with a specifed degrees of freeom parameter.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
StudentDistribution()
          This default constructor creates a new student distribuion with 1 degree of freedom.
StudentDistribution(int n)
          This general constructor creates a new student distribution with a specified degrees of freedom.
 
Method Summary
 double getCDF(double x)
          This method computes the cumulative distribution function in terms of the beta CDF.
 double getDegrees()
          This method returns the degrees of freedom parameter.
 double getDensity(double x)
          This method computes the probability density function.
 double getMaxDensity()
          This method returns the maximum value of the probability density function.
 double getMean()
          This method returns the mean of the distribution.
 double getMoment(double a, int n)
          This method returns the moment a specified order about a specified point.
 double getMoment(int n)
          This method returns the moment of order n about 0.
 double getVariance()
          This method returns the variance of the distribution.
 void setDegrees(int n)
          This method sets the degrees of freedom.
 double simulate()
          This method simulates a value of the distribution.
 java.lang.String toString()
          This method returns a string that gives the name of the distribution and the values of the parameters.
 
Methods inherited from class org.jscience.mathematics.statistics.Distribution
getDomain, getFailureRate, getMedian, getMGF, getPGF, getQuantile, getSD, getType, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StudentDistribution

public StudentDistribution(int n)
This general constructor creates a new student distribution with a specified degrees of freedom.

Parameters:
n - the degrees of freedom

StudentDistribution

public StudentDistribution()
This default constructor creates a new student distribuion with 1 degree of freedom.

Method Detail

setDegrees

public void setDegrees(int n)
This method sets the degrees of freedom.

Parameters:
n - the degrees of freedom

getDensity

public double getDensity(double x)
This method computes the probability density function.

Specified by:
getDensity in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the probability density at x

getMaxDensity

public double getMaxDensity()
This method returns the maximum value of the probability density function.

Overrides:
getMaxDensity in class Distribution
Returns:
the maximum value of the probability denstiy function

getMean

public double getMean()
This method returns the mean of the distribution.

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

public double getVariance()
This method returns the variance of the distribution.

Overrides:
getVariance in class Distribution
Returns:
the variance

getMoment

public double getMoment(int n)
This method returns the moment of order n about 0.

Overrides:
getMoment in class Distribution
Parameters:
n - the order
Returns:
the moment of order n

getMoment

public double getMoment(double a,
                        int n)
This method returns the moment a specified order about a specified point.

Overrides:
getMoment in class Distribution
Parameters:
a - the center
n - the order
Returns:
the moment of order n about a

getCDF

public double getCDF(double x)
This method computes the cumulative distribution function in terms of the beta CDF.

Overrides:
getCDF in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the cumulative distribution at x
See Also:
betaCDF

getDegrees

public double getDegrees()
This method returns the degrees of freedom parameter.

Returns:
the degrees of freedom

simulate

public double simulate()
This method simulates a value of the distribution.

Overrides:
simulate in class Distribution
Returns:
a simulated value from the distribution

toString

public java.lang.String toString()
This method returns a string that gives the name of the distribution and the values of the parameters.

Overrides:
toString in class Distribution
Returns:
a string giving the name of the distribution and the values of the parameters