public class StudentDist extends ContinuousDistribution
ContinuousDistribution for
the Student-t distribution
with n degrees of freedom, where n is a positive integer.
Its density is
GammaDist.
The non-static methods cdf and barF use
the same algorithm as in cdf.
decPrec| Constructor and Description |
|---|
StudentDist(int n)
Constructs a StudentDist object with n degrees of freedom.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
barF(int n,
double x)
Computes the complementary distribution function
bar(F)(x).
|
double |
cdf(double x)
Returns the distribution function F(x).
|
static double |
cdf(int n,
double x)
Returns an approximation
for the
Student-t distribution function with n degrees of freedom.
|
static double |
cdf2(int n,
int d,
double x)
Returns an approximation of the Student-t distribution
function with n degrees of freedom.
|
double |
density(double x)
Returns f (x), the density evaluated at x.
|
static double |
density(int n,
double x)
Computes the density function for a
Student-t distribution with n degrees of freedom.
|
static StudentDist |
getInstanceFromMLE(double[] x,
int m)
Creates a new instance of a Student-t distribution with parameter n
estimated using the maximum likelihood method based on the m observations
x[i],
i = 0, 1,…, m - 1.
|
static double[] |
getMaximumLikelihoodEstimate(double[] x,
int m)
Deprecated.
|
double |
getMean()
Returns the mean.
|
static double |
getMean(int n)
Returns the mean E[X] = 0 of the Student-t
distribution with parameter n.
|
static double[] |
getMLE(double[] x,
int m)
Estimates the parameter n of the Student-t distribution
using the maximum likelihood method, from the m observations
x[i],
i = 0, 1,…, m - 1.
|
int |
getN()
Returns the parameter n associated with this object.
|
double[] |
getParams()
Return a table containing the parameter of the current distribution.
|
double |
getStandardDeviation()
Returns the standard deviation.
|
static double |
getStandardDeviation(int n)
Computes and returns the standard deviation
of the Student-t distribution with parameter n.
|
double |
getVariance()
Returns the variance.
|
static double |
getVariance(int n)
Computes and returns the variance
Var[X] = n/(n - 2)
of the Student-t distribution with parameter n.
|
double |
inverseF(double u)
Returns the inverse distribution function
x = F-1(u).
|
static double |
inverseF(int n,
double u)
Returns an approximation of F-1(u), where F is the
Student-t distribution function with n degrees of freedom.
|
void |
setN(int n)
Sets the parameter n associated with this object.
|
java.lang.String |
toString() |
barF, getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsuppublic StudentDist(int n)
public double density(double x)
ContinuousDistributiondensity in class ContinuousDistributionx - value at which the density is evaluatedpublic double cdf(double x)
Distributionx - value at which the distribution function is evaluatedpublic double inverseF(double u)
ContinuousDistributioninverseF in interface DistributioninverseF in class ContinuousDistributionu - value at which the inverse distribution function is evaluatedpublic double getMean()
ContinuousDistributiongetMean in interface DistributiongetMean in class ContinuousDistributionpublic double getVariance()
ContinuousDistributiongetVariance in interface DistributiongetVariance in class ContinuousDistributionpublic double getStandardDeviation()
ContinuousDistributiongetStandardDeviation in interface DistributiongetStandardDeviation in class ContinuousDistributionpublic static double density(int n,
double x)
public static double cdf(int n,
double x)
public static double cdf2(int n,
int d,
double x)
| 2F(x) = | In/2, 1/2(n/(n + x2)) | for x < 0, |
| 2F(x) = | I1/2, n/2(x2/(n + x2)) | for x >= 0, |
BetaDist, which is approximated by calling
BetaDist.cdf.
The function tries to return d decimals digits of precision
(but there is no guarantee).
This method is much slower (twenty to forty times, depending on parameters)
than cdf, but could be used if precision is important.public static double barF(int n,
double x)
public static double inverseF(int n,
double u)
public static double[] getMLE(double[] x,
int m)
x - the list of observations to use to evaluate parametersm - the number of observations to use to evaluate parameters@Deprecated
public static double[] getMaximumLikelihoodEstimate(double[] x,
int m)
getMLE.public static StudentDist getInstanceFromMLE(double[] x, int m)
x - the list of observations to use to evaluate parametersm - the number of observations to use to evaluate parameterspublic static double getMean(int n)
public static double getVariance(int n)
public static double getStandardDeviation(int n)
public int getN()
public void setN(int n)
public double[] getParams()
public java.lang.String toString()
toString in class java.lang.ObjectTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.