## Types in MathNet.Numerics.Distributions

Type SkewedGeneralizedT

Namespace MathNet.Numerics.Distributions

Interfaces IContinuousDistribution

Continuous Univariate Skewed Generalized T-distribution. Implements the univariate Skewed Generalized t-distribution. For details about this distribution, see. The skewed generalized t-distribution contains many different distributions within it as special cases based on the parameterization chosen.

This implementation is based on the R package dsgt and corresponding viginette, see. Compared to that implementation, the options for mean adjustment and variance adjustment are always true. The location (μ) is the mean of the distribution. The scale (σ) squared is the variance of the distribution.

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.

### Public Constructors

#### SkewedGeneralizedT(double location, double scale, double skew, double p, double q)

Initializes a new instance of the SkewedGeneralizedT class with a particular location, scale, skew and kurtosis parameters. Different parameterizations result in different distributions.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

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

###### `double` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

#### SkewedGeneralizedT()

Initializes a new instance of the SkewedGeneralizedT class. This is a skewed generalized t-distribution with location=0.0, scale=1.0, skew=0.0, p=2.0 and q=Inf (a standard normal distribution).

### Public Static Functions

#### doubleCDF(double location, double scale, double skew, double p, double q, 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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

###### `double` x

The location at which to compute the cumulative distribution function.

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

the cumulative distribution at location x.

#### IContinuousDistributionFindSpecializedDistribution(double location, double scale, double skew, double p, double q)

Given a parameter set, returns the distribution that matches this parameterization.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

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

###### `double` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

##### Return
###### `IContinuousDistribution`

Null if no known distribution matches the parameterization, else the distribution.

#### doubleInvCDF(double location, double scale, double skew, double p, double q, double pr)

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.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

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

###### `double` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

###### `double` pr

The location at which to compute the inverse cumulative density.

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

the inverse cumulative density at p.

#### boolIsValidParameterSet(double location, double scale, double skew, double p, double q)

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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

#### doublePDF(double location, double scale, double skew, double p, double q, 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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

###### `double` x

The location at which to compute the density.

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

the density at x.

#### doublePDFLn(double location, double scale, double skew, double p, double q, 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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

###### `double` x

The location at which to compute the density.

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

the density at x.

#### doubleSample(Random rnd, double location, double scale, double skew, double p, double q)

Generates a sample from the Skew Generalized 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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

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

a sample from the distribution.

#### doubleSample(double location, double scale, double skew, double p, double q)

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

The location (μ) of the distribution.

###### `double` scale

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

###### `double` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

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

a sample from the distribution.

#### voidSamples(Double[] values, double location, double scale, double skew, double p, double q)

Fills an array with samples from the Skew Generalized t-distribution using inverse transform.
##### 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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

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

a sequence of samples from the distribution.

#### voidSamples(Random rnd, Double[] values, double location, double scale, double skew, double p, double q)

Fills an array with samples from the Skew Generalized t-distribution using inverse transform.
##### 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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

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

a sequence of samples from the distribution.

#### IEnumerable<double>Samples(Random rnd, double location, double scale, double skew, double p, double q)

Generates a sequence of samples from the Skew Generalized t-distribution using inverse transform.
##### 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` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

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

a sequence of samples from the distribution.

#### IEnumerable<double>Samples(double location, double scale, double skew, double p, double q)

Generates a sequence of samples from the Skew Generalized t-distribution using inverse transform.
##### Parameters
###### `double` location

The location (μ) of the distribution.

###### `double` scale

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

###### `double` skew

The skew, 1 > λ > -1

###### `double` p

First parameter that controls kurtosis. Range: p > 0

###### `double` q

Second parameter that controls kurtosis. Range: q > 0

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

a sequence of samples from the distribution.

### Public Methods

#### 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.
##### Parameters
###### `double` p

The location at which to compute the inverse cumulative density.

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

the inverse cumulative density at p.

#### stringToString()

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

a string representation of the distribution.

### Public Properties

#### doubleLocation get;

Gets the location (μ) of the Skewed Generalized t-distribution.

#### doubleP get;

Gets the first parameter that controls the kurtosis of the distribution. Range: p > 0.

#### doubleQ get;

Gets the second parameter that controls the kurtosis of the distribution. Range: q > 0.

#### RandomRandomSource get; set;

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

#### doubleScale get;

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

#### doubleSkew get;

Gets the skew (λ) of the Skewed Generalized t-distribution. Range: 1 > λ > -1.