Namespaces

Types in MathNet.Numerics.Distributions

Type Beta

Namespace MathNet.Numerics.Distributions

Interfaces IContinuousDistribution

Continuous Univariate Beta distribution. For details about this distribution, see.
There are a few special cases for the parameterization of the Beta distribution. When both shape parameters are positive infinity, the Beta distribution degenerates to a point distribution at 0.5. When one of the shape parameters is positive infinity, the distribution degenerates to a point distribution at the positive infinity. When both shape parameters are 0.0, the Beta distribution degenerates to a Bernoulli distribution with parameter 0.5. When one shape parameter is 0.0, the distribution degenerates to a point distribution at the non-zero shape parameter.

Constructors

Static Functions

Methods

Properties

Public Constructors

Beta(double a, double b, Random randomSource)

Initializes a new instance of the Beta class.
Parameters
double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Random randomSource

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

Beta(double a, double b)

Initializes a new instance of the Beta class.
Parameters
double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Public Static Functions

double CDF(double a, double b, double x)

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

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

double x

The location at which to compute the cumulative distribution function.

Return
double

the cumulative distribution at location x.

double InvCDF(double a, double b, 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 a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

double p

The location at which to compute the inverse cumulative density.

Return
double

the inverse cumulative density at p.

bool IsValidParameterSet(double a, double b)

Tests whether the provided values are valid parameters for this distribution.
Parameters
double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

double PDF(double a, double b, double x)

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

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

double x

The location at which to compute the density.

Return
double

the density at x.

double PDFLn(double a, double b, double x)

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

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

double x

The location at which to compute the density.

Return
double

the log density at x.

double Sample(double a, double b)

Generates a sample from the distribution.
Parameters
double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Return
double

a sample from the distribution.

double Sample(Random rnd, double a, double b)

Generates a sample from the distribution.
Parameters
Random rnd

The random number generator to use.

double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Return
double

a sample from the distribution.

IEnumerable<double> Samples(Random rnd, double a, double b)

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

The random number generator to use.

double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Return
IEnumerable<double>

a sequence of samples from the distribution.

IEnumerable<double> Samples(double a, double b)

Generates a sequence of samples from the distribution.
Parameters
double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Return
IEnumerable<double>

a sequence of samples from the distribution.

void Samples(Double[] values, double a, double b)

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

The array to fill with the samples.

double a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Return
void

a sequence of samples from the distribution.

void Samples(Random rnd, Double[] values, double a, double b)

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 a

The α shape parameter of the Beta distribution. Range: α ≥ 0.

double b

The β shape parameter of the Beta distribution. Range: β ≥ 0.

Return
void

a sequence of samples from the distribution.

Public Methods

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

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

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

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

double Sample()

Generates a sample from the Beta distribution.
Return
double

a sample from the distribution.

IEnumerable<double> Samples()

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

a sequence of samples from the distribution.

void Samples(Double[] values)

Fills an array with samples generated from the distribution.

string ToString()

A string representation of the distribution.
Return
string

A string representation of the Beta distribution.

Public Properties

double A get;

Gets the α shape parameter of the Beta distribution. Range: α ≥ 0.

double B get;

Gets the β shape parameter of the Beta distribution. Range: β ≥ 0.

double Entropy get;

Gets the entropy of the Beta distribution.

double Maximum get;

Gets the maximum of the Beta distribution.

double Mean get;

Gets the mean of the Beta distribution.

double Median get;

Gets the median of the Beta distribution.

double Minimum get;

Gets the minimum of the Beta distribution.

double Mode get;

Gets the mode of the Beta distribution; when there are multiple answers, this routine will return 0.5.

Random RandomSource get; set;

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

double Skewness get;

Gets the skewness of the Beta distribution.

double StdDev get;

Gets the standard deviation of the Beta distribution.

double Variance get;

Gets the variance of the Beta distribution.