@PublicationReference(author="Christopher Bishop",title="Pattern Recognition and Machine Learning",type=Book,year=2006,pages={102,105}) @PublicationReference(author="Wikipedia",title="Student\'s t-distribution",type=WebPage,year=2009,url="http://en.wikipedia.org/wiki/Student_t_distribution") public class StudentTDistribution extends AbstractClosedFormSmoothUnivariateDistribution implements EstimableDistribution<java.lang.Double,StudentTDistribution>
| Modifier and Type | Class and Description |
|---|---|
static class |
StudentTDistribution.CDF
Evaluator that computes the Cumulative Distribution Function (CDF) of
a Student-t distribution with a fixed number of degrees of freedom
|
static class |
StudentTDistribution.MaximumLikelihoodEstimator
Estimates the parameters of the Student-t distribution from the given
data, where the degrees of freedom are estimated from the Kurtosis
of the sample data.
|
static class |
StudentTDistribution.PDF
Evaluator that computes the Probability Density Function (CDF) of
a Student-t distribution with a fixed number of degrees of freedom
|
static class |
StudentTDistribution.WeightedMaximumLikelihoodEstimator
Creates a UnivariateGaussian from weighted data
|
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_DEGREES_OF_FREEDOM
Default degrees of freedom, 3.0.
|
static double |
DEFAULT_MEAN
Default mean, 0.0.
|
static double |
DEFAULT_PRECISION
Default precision, 1.0.
|
protected double |
degreesOfFreedom
Degrees of freedom in the distribution, usually the number of
datapoints - 1, DOFs must be greater than zero.
|
protected double |
mean
Mean, or noncentrality parameter, of the distribution
|
protected double |
precision
Precision, which is proportionate to the inverseRootFinder of variance, of the
distribution, must be greater than zero.
|
| Constructor and Description |
|---|
StudentTDistribution()
Default degrees of freedom.
|
StudentTDistribution(double degreesOfFreedom)
Creates a new instance of StudentTDistribution
|
StudentTDistribution(double degreesOfFreedom,
double mean,
double precision)
Creates a new instance of StudentTDistribution
|
StudentTDistribution(StudentTDistribution other)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
StudentTDistribution |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
void |
convertFromVector(Vector parameters)
Sets the parameters of this PDF, which must be a
1-dimensional Vector containing the degrees of freedom
|
Vector |
convertToVector()
Returns the parameters of this PDF, which is a
1-dimensional Vector containing the degrees of freedom
|
StudentTDistribution.CDF |
getCDF()
Gets the CDF of a scalar distribution.
|
double |
getDegreesOfFreedom()
Getter for degreesOfFreedom
|
StudentTDistribution.MaximumLikelihoodEstimator |
getEstimator()
Gets an estimator associated with this distribution.
|
java.lang.Double |
getMaxSupport()
Gets the minimum support (domain or input) of the distribution.
|
double |
getMeanAsDouble()
Gets the mean of the distribution as a double.
|
java.lang.Double |
getMinSupport()
Gets the minimum support (domain or input) of the distribution.
|
double |
getPrecision()
Getter for precision
|
StudentTDistribution.PDF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
double |
getVariance()
Gets the variance of the distribution.
|
void |
sampleInto(java.util.Random random,
double[] output,
int start,
int length)
Samples values from this distribution as an array of doubles.
|
void |
setDegreesOfFreedom(double degreesOfFreedom)
Setter for degreesOfFreedom
|
void |
setMean(double mean)
Setter for mean
|
void |
setPrecision(double precision)
Setter for precision
|
java.lang.String |
toString() |
getMean, sampleAsDouble, sampleAsDoubles, sampleIntosample, sampleequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsample, sample, sampleIntopublic static final double DEFAULT_DEGREES_OF_FREEDOM
public static final double DEFAULT_MEAN
public static final double DEFAULT_PRECISION
protected double precision
protected double mean
protected double degreesOfFreedom
public StudentTDistribution()
public StudentTDistribution(double degreesOfFreedom)
degreesOfFreedom - Degrees of freedom in the distribution, usually the number of
datapoints - 1, DOFs must be greater than zero.public StudentTDistribution(double degreesOfFreedom,
double mean,
double precision)
degreesOfFreedom - Degrees of freedom in the distribution, usually the number of
datapoints - 1, DOFs must be greater than zero.mean - Mean, or noncentrality parameter, of the distributionprecision - Precision, inverseRootFinder variance, of the distribution, must be greater
than zero.public StudentTDistribution(StudentTDistribution other)
other - StudentTDistribution to copypublic StudentTDistribution clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface Vectorizableclone in interface CloneableSerializableclone in class AbstractClosedFormUnivariateDistribution<java.lang.Double>public double getDegreesOfFreedom()
public void setDegreesOfFreedom(double degreesOfFreedom)
degreesOfFreedom - Degrees of freedom in the distribution, usually the number of
datapoints - 1, DOFs must be greater than zero.public double getVariance()
UnivariateDistributiongetVariance in interface UnivariateDistribution<java.lang.Double>public Vector convertToVector()
convertToVector in interface Vectorizablepublic void convertFromVector(Vector parameters)
convertFromVector in interface Vectorizableparameters - 1-dimensional Vector containing the degrees of freedompublic void sampleInto(java.util.Random random,
double[] output,
int start,
int length)
SmoothUnivariateDistributionsampleInto in interface SmoothUnivariateDistributionrandom - Random number generator to use.output - The array to write the result into. Cannot be null.start - The offset in the array to start writing at. Cannot be negative.length - The number of values to sample. Cannot be negative.public StudentTDistribution.CDF getCDF()
UnivariateDistributiongetCDF in interface ClosedFormUnivariateDistribution<java.lang.Double>getCDF in interface SmoothUnivariateDistributiongetCDF in interface UnivariateDistribution<java.lang.Double>public StudentTDistribution.PDF getProbabilityFunction()
ComputableDistributiongetProbabilityFunction in interface ComputableDistribution<java.lang.Double>getProbabilityFunction in interface SmoothUnivariateDistributionpublic double getPrecision()
public void setPrecision(double precision)
precision - Precision, inverseRootFinder variance, of the distribution, must be greater
than zero.public void setMean(double mean)
mean - Mean, or noncentrality parameter, of the distributionpublic double getMeanAsDouble()
UnivariateDistributiongetMeanAsDouble in interface UnivariateDistribution<java.lang.Double>public java.lang.Double getMinSupport()
UnivariateDistributiongetMinSupport in interface UnivariateDistribution<java.lang.Double>public java.lang.Double getMaxSupport()
UnivariateDistributiongetMaxSupport in interface UnivariateDistribution<java.lang.Double>public java.lang.String toString()
toString in class java.lang.Objectpublic StudentTDistribution.MaximumLikelihoodEstimator getEstimator()
EstimableDistributiongetEstimator in interface EstimableDistribution<java.lang.Double,StudentTDistribution>