Namespaces

Types

Type Bernoulli

Namespace MathNet.Numerics.Distributions

Interfaces IDiscreteDistribution

The Bernoulli distribution is a distribution over bits. The parameter p specifies the probability that a 1 is generated.

The distribution will use the Random by default. Users can 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. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters to false, all parameter checks can be turned off.

Methods

Properties

Public static methods

int Sample(Random rnd, double p)

Samples a Bernoulli distributed random variable.
Parameters
return int A sample from the Bernoulli distribution.
Random rnd The random number generator to use.
double p The probability of generating a 1.

IEnumerable<int> Samples(Random rnd, double p)

Samples an array of Bernoulli distributed random variables.
Parameters
return IEnumerable<int> a sequence of samples from the distribution.
Random rnd The random number generator to use.
double p The probability of generating a 1.

Public properties

double Entropy get;

Gets the entropy of the distribution.
return double

int Maximum get;

Gets the largest element in the domain of the distributions which can be represented by an integer.
return int

double Mean get;

Gets the mean of the distribution.
return double

int Median get;

The median of the distribution.
return int

int Minimum get;

Gets the smallest element in the domain of the distributions which can be represented by an integer.
return int

int Mode get;

The mode of the distribution.
return int

double P get; set;

Gets or sets the probability of generating a one.
return double

Random RandomSource get; set;

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

double Skewness get;

Gets the skewness of the distribution.
return double

double StdDev get;

Gets the standard deviation of the distribution.
return double

double Variance get;

Gets the variance of the distribution.
return double