Namespaces

Types in MathNet.Numerics.Distributions

Type Dirichlet

Namespace MathNet.Numerics.Distributions

Interfaces IDistribution

Multivariate Dirichlet distribution. For details about this distribution, see.

Constructors

Static Functions

Methods

Properties

Public Constructors

Dirichlet(Double[] alpha)

Initializes a new instance of the Dirichlet class. The distribution will be initialized with the default random number generator.
Parameters
Double[] alpha

An array with the Dirichlet parameters.

Dirichlet(Double[] alpha, Random randomSource)

Initializes a new instance of the Dirichlet class. The distribution will be initialized with the default random number generator.
Parameters
Double[] alpha

An array with the Dirichlet parameters.

Random randomSource

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

Dirichlet(double alpha, int k)

Initializes a new instance of the Dirichlet class. random number generator.
Parameters
double alpha

The value of each parameter of the Dirichlet distribution.

int k

The dimension of the Dirichlet distribution.

Dirichlet(double alpha, int k, Random randomSource)

Initializes a new instance of the Dirichlet class. random number generator.
Parameters
double alpha

The value of each parameter of the Dirichlet distribution.

int k

The dimension of the Dirichlet distribution.

Random randomSource

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

Public Static Functions

bool IsValidParameterSet(Double[] alpha)

Tests whether the provided values are valid parameters for this distribution. No parameter can be less than zero and at least one parameter should be larger than zero.
Parameters
Double[] alpha

The parameters of the Dirichlet distribution.

Double[] Sample(Random rnd, Double[] alpha)

Samples a Dirichlet distributed random vector.
Parameters
Random rnd

The random number generator to use.

Double[] alpha

The Dirichlet distribution parameter.

Return
Double[]

a sample from the distribution.

Public Methods

double Density(Double[] x)

Computes the density of the distribution.
The Dirichlet distribution requires that the sum of the components of x equals 1. You can also leave out the last x component, and it will be computed from the others.
Parameters
Double[] x

The locations at which to compute the density.

Return
double

the density at x.

double DensityLn(Double[] x)

Computes the log density of the distribution.
Parameters
Double[] x

The locations at which to compute the density.

Return
double

the density at x.

bool Equals(object obj)

int GetHashCode()

Type GetType()

Double[] Sample()

Samples a Dirichlet distributed random vector.
Return
Double[]

A sample from this distribution.

string ToString()

Returns a String that represents this instance.
Return
string

A String that represents this instance.

Public Properties

Double[] Alpha get;

Gets or sets the parameters of the Dirichlet distribution.

int Dimension get;

Gets the dimension of the Dirichlet distribution.

double Entropy get;

Gets the entropy of the distribution.

Double[] Mean get;

Gets the mean of the Dirichlet distribution.

Random RandomSource get; set;

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

Double[] Variance get;

Gets the variance of the Dirichlet distribution.