Namespaces

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.

Constructors

Static Functions

Methods

Properties

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

double CDF(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.

IContinuousDistribution FindSpecializedDistribution(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.

double InvCDF(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.

bool IsValidParameterSet(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

double PDF(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.

double PDFLn(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.

double Sample(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.

double Sample(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.

void Samples(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.

void Samples(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

double CumulativeDistribution(double x)

double Density(double x)

double DensityLn(double x)

bool Equals(object obj)

int GetHashCode()

Type GetType()

double InverseCumulativeDistribution(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.

double Sample()

IEnumerable<double> Samples()

void Samples(Double[] values)

string ToString()

A string representation of the distribution.
Return
string

a string representation of the distribution.

Public Properties

double Entropy get;

double Location get;

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

double Maximum get;

double Mean get;

double Median get;

double Minimum get;

double Mode get;

double P get;

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

double Q get;

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

Random RandomSource get; set;

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

double Scale get;

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

double Skew get;

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

double Skewness get;

double StdDev get;

double Variance get;