SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdist.StudentDist Class Reference

Extends the class ContinuousDistribution for the Student. More...

Inheritance diagram for umontreal.ssj.probdist.StudentDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution umontreal.ssj.probdist.StudentDistQuick

Public Member Functions

 StudentDist (int n)
 Constructs a StudentDist object with n degrees of freedom.
double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\).
double cdf (double x)
 Returns the distribution function \(F(x)\).
double barF (double x)
 Returns the complementary distribution function.
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\).
double getMean ()
 Returns the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
int getN ()
 Returns the parameter \(n\) associated with this object.
void setN (int n)
 Sets the parameter \(n\) associated with this object.
double[] getParams ()
 Return a table containing the parameter of the current distribution.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.ContinuousDistribution
double inverseBrent (double a, double b, double u, double tol)
 Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method.
double inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection.
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXinf (double xa)
 Sets the value \(x_a=\) xa, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXsup (double xb)
 Sets the value \(x_b=\) xb, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).

Static Public Member Functions

static double density (int n, double x)
 Computes the density function ( fstudent ) of a Student \(t\)-distribution with \(n\) degrees of freedom.
static double cdf (int n, double x)
 Computes the Student \(t\)-distribution function \(u=F(x)\) with.
static double cdf2 (int n, int d, double x)
 Same as cdf(n, x).
static double barF (int n, double x)
 Computes the complementary distribution function \(v = \bar{F}(x)\) with \(n\) degrees of freedom.
static double inverseF (int n, double u)
 Returns the inverse \(x = F^{-1}(u)\) of Student.
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.
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 getMean (int n)
 Returns the mean \(E[X] = 0\) of the Student \(t\)-distribution with parameter \(n\).
static double getVariance (int n)
 Computes and returns the variance \(\mbox{Var}[X] = n/(n - 2)\) of the Student \(t\)-distribution with parameter \(n\).
static double getStandardDeviation (int n)
 Computes and returns the standard deviation of the Student.

Detailed Description

Extends the class ContinuousDistribution for the Student.

\(t\)-distribution [96]  (page 362) with \(n\) degrees of freedom, where \(n\) is a positive integer. Its density is

\[ f (x) = \frac{\Gamma\left((n + 1)/2 \right)}{\Gamma(n/2) \sqrt{\pi n}} \left(1 + \frac{x^2}{n}\right)^{-(n+1)/2} \qquad\mbox{for } -\infty< x < \infty, \tag{fstudent} \]

where \(\Gamma(x)\) is the gamma function defined in ( Gamma ).

Definition at line 47 of file StudentDist.java.

Constructor & Destructor Documentation

◆ StudentDist()

umontreal.ssj.probdist.StudentDist.StudentDist ( int n)

Constructs a StudentDist object with n degrees of freedom.

Definition at line 112 of file StudentDist.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.StudentDist.barF ( double x)

Returns the complementary distribution function.

The default implementation computes \(\bar{F}(x) = 1 - F(x)\).

Parameters
xvalue at which the complementary distribution function is evaluated
Returns
complementary distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.StudentDistQuick.

Definition at line 124 of file StudentDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.StudentDist.barF ( int n,
double x )
static

Computes the complementary distribution function \(v = \bar{F}(x)\) with \(n\) degrees of freedom.

Gives 13 decimal digits of precision for \(n \le10^5\). For \(n > 10^5\), gives at least 6 decimal digits of precision everywhere, and at least 9 decimal digits of precision for all \(v > 10^{-15}\).

Reimplemented in umontreal.ssj.probdist.StudentDistQuick.

Definition at line 205 of file StudentDist.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.StudentDist.cdf ( double x)

Returns the distribution function \(F(x)\).

Parameters
xvalue at which the distribution function is evaluated
Returns
distribution function evaluated at x

Implements umontreal.ssj.probdist.Distribution.

Reimplemented in umontreal.ssj.probdist.StudentDistQuick.

Definition at line 120 of file StudentDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.StudentDist.cdf ( int n,
double x )
static

Computes the Student \(t\)-distribution function \(u=F(x)\) with.

\(n\) degrees of freedom. Gives 13 decimal digits of precision for \(n \le10^5\). For \(n > 10^5\), gives at least 6 decimal digits of precision everywhere, and at least 9 decimal digits of precision for all \(u > 10^{-15}\).

Reimplemented in umontreal.ssj.probdist.StudentDistQuick.

Definition at line 162 of file StudentDist.java.

◆ cdf2()

double umontreal.ssj.probdist.StudentDist.cdf2 ( int n,
int d,
double x )
static

Same as cdf(n, x).

Definition at line 192 of file StudentDist.java.

◆ density() [1/2]

double umontreal.ssj.probdist.StudentDist.density ( double x)

Returns \(f(x)\), the density evaluated at \(x\).

Parameters
xvalue at which the density is evaluated
Returns
density function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 116 of file StudentDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.StudentDist.density ( int n,
double x )
static

Computes the density function ( fstudent ) of a Student \(t\)-distribution with \(n\) degrees of freedom.

Definition at line 149 of file StudentDist.java.

◆ getInstanceFromMLE()

StudentDist umontreal.ssj.probdist.StudentDist.getInstanceFromMLE ( double[] x,
int m )
static

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\).

Parameters
xthe list of observations to use to evaluate parameters
mthe number of observations to use to evaluate parameters

Definition at line 316 of file StudentDist.java.

◆ getMean() [1/2]

double umontreal.ssj.probdist.StudentDist.getMean ( )

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 132 of file StudentDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.StudentDist.getMean ( int n)
static

Returns the mean \(E[X] = 0\) of the Student \(t\)-distribution with parameter \(n\).

Returns
the mean of the Student \(t\)-distribution \(E[X] = 0\)

Definition at line 327 of file StudentDist.java.

◆ getMLE()

double[] umontreal.ssj.probdist.StudentDist.getMLE ( double[] x,
int m )
static

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\). The estimate is returned in a one-element array.

Parameters
xthe list of observations to use to evaluate parameters
mthe number of observations to use to evaluate parameters
Returns
returns the parameter [ \(\hat{n}\)]

Definition at line 265 of file StudentDist.java.

◆ getN()

int umontreal.ssj.probdist.StudentDist.getN ( )

Returns the parameter \(n\) associated with this object.

Definition at line 359 of file StudentDist.java.

◆ getParams()

double[] umontreal.ssj.probdist.StudentDist.getParams ( )

Return a table containing the parameter of the current distribution.

Implements umontreal.ssj.probdist.Distribution.

Definition at line 376 of file StudentDist.java.

◆ getStandardDeviation() [1/2]

double umontreal.ssj.probdist.StudentDist.getStandardDeviation ( )

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 140 of file StudentDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.StudentDist.getStandardDeviation ( int n)
static

Computes and returns the standard deviation of the Student.

\(t\)-distribution with parameter \(n\).

Returns
the standard deviation of the Student \(t\)-distribution

Definition at line 352 of file StudentDist.java.

◆ getVariance() [1/2]

double umontreal.ssj.probdist.StudentDist.getVariance ( )

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 136 of file StudentDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.StudentDist.getVariance ( int n)
static

Computes and returns the variance \(\mbox{Var}[X] = n/(n - 2)\) of the Student \(t\)-distribution with parameter \(n\).

Returns
the variance of the Student \(t\)-distribution \(\mbox{Var}[X] = n / (n - 2)\)

Definition at line 340 of file StudentDist.java.

◆ inverseF() [1/2]

double umontreal.ssj.probdist.StudentDist.inverseF ( double u)

Returns the inverse distribution function \(x = F^{-1}(u)\).

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Reimplemented in umontreal.ssj.probdist.StudentDistQuick.

Definition at line 128 of file StudentDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.StudentDist.inverseF ( int n,
double u )
static

Returns the inverse \(x = F^{-1}(u)\) of Student.

\(t\)-distribution function with \(n\) degrees of freedom. Gives 13 decimal digits of precision for \(n \le10^5\), and at least 9 decimal digits of precision for \(n > 10^5\).

Reimplemented in umontreal.ssj.probdist.StudentDistQuick.

Definition at line 233 of file StudentDist.java.

◆ setN()

void umontreal.ssj.probdist.StudentDist.setN ( int n)

Sets the parameter \(n\) associated with this object.

Definition at line 366 of file StudentDist.java.

◆ toString()

String umontreal.ssj.probdist.StudentDist.toString ( )

Returns a String containing information about the current distribution.

Definition at line 384 of file StudentDist.java.


The documentation for this class was generated from the following file: