Namespaces

Types

Type Gamma

Namespace MathNet.Numerics.Distributions

Interfaces IContinuousDistribution

Implements the univariate Gamma distribution. For details about this distribution, see.

The Gamma distribution is parametrized by a shape and inverse scale parameter. When we want to specify a Gamma distribution which is a point distribution we set the shape parameter to be the location of the point distribution and the inverse scale as positive infinity. The distribution with shape and inverse scale both zero is undefined.

Random number generation for the Gamma distribution is based on the algorithm in: "A Simple Method for Generating Gamma Variables" - Marsaglia & Tsang ACM Transactions on Mathematical Software, Vol. 26, No. 3, September 2000, Pages 363–372.

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 static methods

Gamma WithShapeInvScale(double shape, double invScale)

Constructs a Gamma distribution from a shape and inverse scale parameter. The distribution will be initialized with the default random number generator.
Parameters
return Gamma a normal distribution.
double shape The shape of the Gamma distribution.
double invScale The inverse scale of the Gamma distribution.

Gamma WithShapeScale(double shape, double scale)

Constructs a Gamma distribution from a shape and scale parameter. The distribution will be initialized with the default random number generator.
Parameters
return Gamma a normal distribution.
double shape The shape of the Gamma distribution.
double scale The scale of the Gamma distribution.

Public properties

double Entropy get;

Gets the entropy of the Gamma distribution.
return double

double InvScale get; set;

Gets or sets the inverse scale of the Gamma distribution.
return double

double Maximum get;

Gets the maximum of the Gamma distribution.
return double

double Mean get;

Gets the mean of the Gamma distribution.
return double

double Median get;

Gets the median of the Gamma distribution.
return double

double Minimum get;

Gets the minimum of the Gamma distribution.
return double

double Mode get;

Gets the mode of the Gamma distribution.
return double

Random RandomSource get; set;

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

double Scale get; set;

Gets or sets the scale of the Gamma distribution.
return double

double Shape get; set;

Gets or sets the shape of the Gamma distribution.
return double

double Skewness get;

Gets the skewness of the Gamma distribution.
return double

double StdDev get;

Gets the standard deviation of the Gamma distribution.
return double

double Variance get;

Gets the variance of the Gamma distribution.
return double