Namespaces

Types

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.

Methods

Properties

Public instance methods

double InverseCumulativeDistribution(double p)

Computes the inverse cumulative distribution function of the normal distribution.
Parameters
return double the inverse cumulative density at p.
double p The location at which to compute the inverse cumulative density.

Public static methods

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

Generates a sample from the normal distribution using the algorithm.
Parameters
return double a sample from the distribution.
Random rng 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.

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

Generates a sequence of samples from the normal distribution using the algorithm.
Parameters
return IEnumerable<double> a sequence of samples from the distribution.
Random rng 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.

Normal WithMeanAndPrecision(double mean, double prec)

Constructs a normal distribution from a mean and precision. The distribution will be initialized with the default random number generator.
Parameters
return Normal a normal distribution.
double mean The mean of the normal distribution.
double prec The precision of the 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
return Normal a normal distribution.
double mean The mean of the normal distribution.
double stddev The standard deviation of the 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
return Normal a normal distribution.
double mean The mean of the normal distribution.
double var The variance of the normal distribution.

Public properties

double Entropy get;

Gets the entropy of the normal distribution.
return double

double Maximum get;

Gets the maximum of the normal distribution.
return double

double Mean get; set;

Gets or sets the mean of the normal distribution.
return double

double Median get;

Gets the median of the normal distribution.
return double

double Minimum get;

Gets the minimum of the normal distribution.
return double

double Mode get;

Gets the mode of the normal distribution.
return double

double Precision get; set;

Gets or sets the precision of the normal distribution.
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 normal distribution.
return double

double StdDev get; set;

Gets or sets the standard deviation of the normal distribution.
return double

double Variance get; set;

Gets or sets the variance of the normal distribution.
return double