Namespaces

Types in MathNet.Numerics.Distributions

Type Normal

Namespace MathNet.Numerics.Distributions

Interfaces IContinuousDistribution

Implements the univariate Normal (or Gaussian) distribution. For details about this distribution, see.

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. This might involve heavy computation. Optionally, by setting Control.CheckDistributionParameters to false , all parameter checks can be turned off.

Constructors

Static Functions

Methods

Properties

Public constructors

Normal(double mean, double stddev)

Initializes a new instance of the Normal class with a particular mean and standard deviation. The distribution will be initialized with the default random number generator.
Parameters
double mean

The mean of the normal distribution.

double stddev

The standard deviation of the normal distribution.

Normal()

Initializes a new instance of the Normal class. This is a normal distribution with mean 0.0 and standard deviation 1.0. The distribution will be initialized with the default random number generator.

Public static methods

double Sample(Random rnd, double mean, double stddev)

Generates a sample from the normal distribution using the algorithm.
Parameters
Random rnd

The random number generator to use.

double mean

The mean of the normal distribution from which to generate samples.

double stddev

The standard deviation of the normal distribution from which to generate samples.

Return
double

a sample from the distribution.

IEnumerable<double> Samples(Random rnd, double mean, double stddev)

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

The random number generator to use.

double mean

The mean of the normal distribution from which to generate samples.

double stddev

The standard deviation of the normal distribution from which to generate samples.

Return
IEnumerable<double>

a sequence of samples from the distribution.

Normal WithMeanPrecision(double mean, double precision)

Constructs a normal distribution from a mean and precision. The distribution will be initialized with the default random number generator.
Parameters
double mean

The mean of the normal distribution.

double precision

The precision of the normal distribution.

Return
Normal

a normal distribution.

Normal WithMeanStdDev(double mean, double stddev)

Constructs a normal distribution from a mean and standard deviation. The distribution will be initialized with the default random number generator.
Parameters
double mean

The mean of the normal distribution.

double stddev

The standard deviation of the normal distribution.

Return
Normal

a normal distribution.

Normal WithMeanVariance(double mean, double var)

Constructs a normal distribution from a mean and variance. The distribution will be initialized with the default random number generator.
Parameters
double mean

The mean of the normal distribution.

double var

The variance of the normal distribution.

Return
Normal

a normal distribution.

Public instance methods

double CumulativeDistribution(double x)

Computes the cumulative distribution function of the normal distribution.
Parameters
double x

The location at which to compute the cumulative density.

Return
double

the cumulative density at x.

double Density(double x)

Computes the density of the normal distribution.
Parameters
double x

The location at which to compute the density.

Return
double

the density at x.

double DensityLn(double x)

Computes the log density of the normal distribution.
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 cumulative distribution function of the normal distribution.
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 normal distribution using the algorithm.
Return
double

a sample from the distribution.

IEnumerable<double> Samples()

Generates a sequence of samples from the normal distribution using the algorithm.
Return
IEnumerable<double>

a sequence of samples from the distribution.

string ToString()

A string representation of the distribution.
Return
string

a string representation of the distribution.

Public properties

double Entropy get;

Gets the entropy of the normal distribution.

double Maximum get;

Gets the maximum of the normal distribution.

double Mean get; set;

Gets or sets the mean of the normal distribution.

double Median get;

Gets the median of the normal distribution.

double Minimum get;

Gets the minimum of the normal distribution.

double Mode get;

Gets the mode of the normal distribution.

double Precision get; set;

Gets or sets the precision of the normal distribution.

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

double StdDev get; set;

Gets or sets the standard deviation of the normal distribution.

double Variance get; set;

Gets or sets the variance of the normal distribution.