Types in MathNet.Numerics.Distributions

Type Erlang

Namespace MathNet.Numerics.Distributions

Interfaces IContinuousDistribution

Continuous Univariate Erlang distribution. This distribution is a continuous probability distribution with wide applicability primarily due to its relation to the exponential and Gamma distributions..

Public Constructors

Erlang(int shape, double rate, Random randomSource)

Initializes a new instance of the Erlang class.
Parameters
`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

`Random` randomSource

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

Erlang(int shape, double rate)

Initializes a new instance of the Erlang class.
Parameters
`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

Public Static Functions

doubleCDF(int shape, double rate, double x)

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

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

`double` x

The location at which to compute the cumulative distribution function.

Return
`double`

the cumulative distribution at location x.

boolIsValidParameterSet(int shape, double rate)

Tests whether the provided values are valid parameters for this distribution.
Parameters
`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

doublePDF(int shape, double rate, double x)

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

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

`double` x

The location at which to compute the density.

Return
`double`

the density at x.

doublePDFLn(int shape, double rate, double x)

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

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

`double` x

The location at which to compute the density.

Return
`double`

the log density at x.

doubleSample(Random rnd, int shape, double rate)

Generates a sample from the distribution.
Parameters
`Random` rnd

The random number generator to use.

`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

Return
`double`

a sample from the distribution.

doubleSample(int shape, double rate)

Generates a sample from the distribution.
Parameters
`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

Return
`double`

a sample from the distribution.

IEnumerable<double>Samples(Random rnd, int shape, double rate)

Generates a sequence of samples from the distribution.
Parameters
`Random` rnd

The random number generator to use.

`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

Return
`IEnumerable<double>`

a sequence of samples from the distribution.

voidSamples(Random rnd, Double[] values, int shape, double rate)

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.

`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

Return
`void`

a sequence of samples from the distribution.

IEnumerable<double>Samples(int shape, double rate)

Generates a sequence of samples from the distribution.
Parameters
`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

Return
`IEnumerable<double>`

a sequence of samples from the distribution.

voidSamples(Double[] values, int shape, double rate)

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

The array to fill with the samples.

`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

Return
`void`

a sequence of samples from the distribution.

ErlangWithShapeRate(int shape, double rate, Random randomSource)

Constructs a Erlang distribution from a shape and inverse scale parameter. The distribution will be initialized with the default random number generator.
Parameters
`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` rate

The rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

`Random` randomSource

The random number generator which is used to draw random samples. Optional, can be null.

ErlangWithShapeScale(int shape, double scale, Random randomSource)

Constructs a Erlang distribution from a shape and scale parameter. The distribution will be initialized with the default random number generator.
Parameters
`int` shape

The shape (k) of the Erlang distribution. Range: k ≥ 0.

`double` scale

The scale (μ) of the Erlang distribution. Range: μ ≥ 0.

`Random` randomSource

The random number generator which is used to draw random samples. Optional, can be null.

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.

doubleSample()

Generates a sample from the Erlang distribution.
Return
`double`

a sample from the distribution.

voidSamples(Double[] values)

Fills an array with samples generated from the distribution.

IEnumerable<double>Samples()

Generates a sequence of samples from the Erlang distribution.
Return
`IEnumerable<double>`

a sequence of samples from the distribution.

stringToString()

A string representation of the distribution.
Return
`string`

a string representation of the distribution.

Public Properties

doubleEntropy get;

Gets the entropy of the distribution.

doubleMaximum get;

Gets the Maximum value.

doubleMean get;

Gets the mean of the distribution.

doubleMedian get;

Gets the median of the distribution.

doubleMinimum get;

Gets the minimum value.

doubleMode get;

Gets the mode of the distribution.

RandomRandomSource get; set;

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

doubleRate get;

Gets the rate or inverse scale (λ) of the Erlang distribution. Range: λ ≥ 0.

doubleScale get;

Gets the scale of the Erlang distribution.

intShape get;

Gets the shape (k) of the Erlang distribution. Range: k ≥ 0.

doubleSkewness get;

Gets the skewness of the distribution.

doubleStdDev get;

Gets the standard deviation of the distribution.

doubleVariance get;

Gets the variance of the distribution.