## Types in MathNet.Numerics.Distributions

Type StudentT

Namespace MathNet.Numerics.Distributions

Interfaces IContinuousDistribution

We use a slightly generalized version (compared to Wikipedia) of the Student t-distribution. Namely, one which also parameterizes the location and scale. See the book "Bayesian Data Analysis" by Gelman et al. for more details.

The density of the Student t-distribution p(x|mu,scale,dof) = Gamma((dof+1)/2) (1 + (x - mu)^2 / (scale * scale * dof))^(-(dof+1)/2) / (Gamma(dof/2)*Sqrt(dof*pi*scale)).

The distribution will use the Random by default. Users can get/set the random number generator by using the RandomSource property.

The statistics classes will check all the incoming parameters whether they are in the allowed range. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters to `false` , all parameter checks can be turned off.

### Public Constructors

#### StudentT(double location, double scale, double freedom, Random randomSource)

Initializes a new instance of the StudentT class with a particular location, scale and degrees of freedom.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

###### `Random` randomSource

The random number generator which is used to draw random samples.

#### StudentT()

Initializes a new instance of the StudentT class. This is a Student t-distribution with location 0.0 scale 1.0 and degrees of freedom 1.

#### StudentT(double location, double scale, double freedom)

Initializes a new instance of the StudentT class with a particular location, scale and degrees of freedom.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

### Public Static Functions

#### doubleCDF(double location, double scale, double freedom, double x)

Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

###### `double` x

The location at which to compute the cumulative distribution function.

##### Return
###### `double`

the cumulative distribution at location x.

#### doubleInvCDF(double location, double scale, double freedom, double p)

Computes the inverse of the cumulative distribution function (InvCDF) for the distribution at the given probability. This is also known as the quantile or percent point function.
WARNING: currently not an explicit implementation, hence slow and unreliable.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

###### `double` p

The location at which to compute the inverse cumulative density.

##### Return
###### `double`

the inverse cumulative density at p.

#### boolIsValidParameterSet(double location, double scale, double freedom)

Tests whether the provided values are valid parameters for this distribution.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

#### doublePDF(double location, double scale, double freedom, double x)

Computes the probability density of the distribution (PDF) at x, i.e. ∂P(X ≤ x)/∂x.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

###### `double` x

The location at which to compute the density.

##### Return
###### `double`

the density at x.

#### doublePDFLn(double location, double scale, double freedom, double x)

Computes the log probability density of the distribution (lnPDF) at x, i.e. ln(∂P(X ≤ x)/∂x).
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

###### `double` x

The location at which to compute the density.

##### Return
###### `double`

the log density at x.

#### doubleSample(Random rnd, double location, double scale, double freedom)

Generates a sample from the Student t-distribution.
##### Parameters
###### `Random` rnd

The random number generator to use.

###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

##### Return
###### `double`

a sample from the distribution.

#### doubleSample(double location, double scale, double freedom)

Generates a sample from the Student t-distribution.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

##### Return
###### `double`

a sample from the distribution.

#### IEnumerable<double>Samples(Random rnd, double location, double scale, double freedom)

Generates a sequence of samples from the Student t-distribution using the algorithm.
##### Parameters
###### `Random` rnd

The random number generator to use.

###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

##### Return
###### `IEnumerable<double>`

a sequence of samples from the distribution.

#### voidSamples(Random rnd, Double[] values, double location, double scale, double freedom)

Fills an array with samples generated from the distribution.
##### Parameters
###### `Random` rnd

The random number generator to use.

###### `Double[]` values

The array to fill with the samples.

###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

##### Return
###### `void`

a sequence of samples from the distribution.

#### IEnumerable<double>Samples(double location, double scale, double freedom)

Generates a sequence of samples from the Student t-distribution using the algorithm.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

##### Return
###### `IEnumerable<double>`

a sequence of samples from the distribution.

#### voidSamples(Double[] values, double location, double scale, double freedom)

Fills an array with samples generated from the distribution.
##### Parameters
###### `Double[]` values

The array to fill with the samples.

###### `double` location

The location (μ) of the distribution.

###### `double` scale

The scale (σ) of the distribution. Range: σ > 0.

###### `double` freedom

The degrees of freedom (ν) for the distribution. Range: ν > 0.

##### Return
###### `void`

a sequence of samples from the distribution.

### Public Methods

#### doubleCumulativeDistribution(double x)

Computes the cumulative distribution (CDF) of the distribution at x, i.e. P(X ≤ x).
##### Parameters
###### `double` x

The location at which to compute the cumulative distribution function.

##### Return
###### `double`

the cumulative distribution at location x.

#### doubleDensity(double x)

Computes the probability density of the distribution (PDF) at x, i.e. ∂P(X ≤ x)/∂x.
##### Parameters
###### `double` x

The location at which to compute the density.

##### Return
###### `double`

the density at x.

#### doubleDensityLn(double x)

Computes the log probability density of the distribution (lnPDF) at x, i.e. ln(∂P(X ≤ x)/∂x).
##### Parameters
###### `double` x

The location at which to compute the log density.

##### Return
###### `double`

the log density at x.

#### doubleInverseCumulativeDistribution(double p)

Computes the inverse of the cumulative distribution function (InvCDF) for the distribution at the given probability. This is also known as the quantile or percent point function.
WARNING: currently not an explicit implementation, hence slow and unreliable.
##### Parameters
###### `double` p

The location at which to compute the inverse cumulative density.

##### Return
###### `double`

the inverse cumulative density at p.

#### doubleSample()

Generates a sample from the Student t-distribution.
##### Return
###### `double`

a sample from the distribution.

#### IEnumerable<double>Samples()

Generates a sequence of samples from the Student t-distribution.
##### Return
###### `IEnumerable<double>`

a sequence of samples from the distribution.

#### voidSamples(Double[] values)

Fills an array with samples generated from the distribution.

#### stringToString()

A string representation of the distribution.
##### Return
###### `string`

a string representation of the distribution.

### Public Properties

#### doubleDegreesOfFreedom get;

Gets the degrees of freedom (ν) of the Student t-distribution. Range: ν > 0.

#### doubleEntropy get;

Gets the entropy of the Student t-distribution.

#### doubleLocation get;

Gets the location (μ) of the Student t-distribution.

#### doubleMaximum get;

Gets the maximum of the Student t-distribution.

#### doubleMean get;

Gets the mean of the Student t-distribution.

#### doubleMedian get;

Gets the median of the Student t-distribution.

#### doubleMinimum get;

Gets the minimum of the Student t-distribution.

#### doubleMode get;

Gets the mode of the Student t-distribution.

#### RandomRandomSource get; set;

Gets or sets the random number generator which is used to draw random samples.

#### doubleScale get;

Gets the scale (σ) of the Student t-distribution. Range: σ > 0.

#### doubleSkewness get;

Gets the skewness of the Student t-distribution.

#### doubleStdDev get;

Gets the standard deviation of the Student t-distribution.

#### doubleVariance get;

Gets the variance of the Student t-distribution.