GammaDistribution Class

Represents a Gamma distribution.

Definition

Namespace: Meta.Numerics.Statistics.Distributions
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public sealed class GammaDistribution : ContinuousDistribution
Inheritance
Object    UnivariateDistribution    ContinuousDistribution    GammaDistribution

Remarks

The sum of n exponentially distributed variates is a Gamma distributed variate with shape parameter n.

When the shape parameter is an integer, the Gamma distribution is also called the Erlang distribution. When the shape parameter is one, the Gamma distribution reduces to the exponential distribution.

With large shape parameters, the Gamma distribution becomes approximately Gaussian.

With shape parameters less than one, the Gamma distribution becomes ever more strongly peaked near zero.

With very small shape parameters, say below about 0.01, the distribution becomes peaked so strongly near zero that a non-negligible fraction consists of unrepresentatably small numbers that round to zero. For a shape parameter of 0.001, for example, almost half the area under the curve corresponds to number smaller than 10-324. This can cause problems if the distinction between zero and such small values is relevent to your application. For example, if you do a KolmogorovSmirnovTest(IReadOnlyListDouble, ContinuousDistribution) on deviates generated from this distribution, you will get D ~ 0.47 and may conclude that the sample is nonreprestative. But this happened only because 47% of the values rounded to zero, making the KS test compute P(0) = 0 for the 47th percentile value. Without rouding the 47th percentile value would have been P(~1.0E-324) ~ 0.47 resulting in an unremarkable D value.

Constructors

GammaDistribution(Double) Initializes a new instance of the standard Gamma distribution.
GammaDistribution(Double, Double) Initializes a new instance of a Gamma distribution with the given parameters.

Properties

ExcessKurtosis Gets the excess kurtosis of the distribution.
(Overrides UnivariateDistributionExcessKurtosis)
Mean Gets the mean of the distribution.
(Overrides UnivariateDistributionMean)
Median Gets the median of the distribution.
(Inherited from ContinuousDistribution)
Scale Gets the scale parameter for the distribution.
Shape Gets the shape parameter for the distribution.
Skewness Gets the skewness of the distribution.
(Overrides UnivariateDistributionSkewness)
StandardDeviation Gets the standard deviation of the distribution.
(Inherited from UnivariateDistribution)
Support Gets the interval over which the distribution is non-vanishing.
(Overrides ContinuousDistributionSupport)
Variance Gets the variance of the distribution.
(Overrides UnivariateDistributionVariance)

Methods

CentralMoment Computes a central moment of the distribution.
(Overrides ContinuousDistributionCentralMoment(Int32))
Cumulant Computes a cumulant of the distribution.
(Overrides UnivariateDistributionCumulant(Int32))
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
ExpectationValue Computes the expectation value of the given function.
(Inherited from ContinuousDistribution)
FitToSample Computes the Gamma distribution that best fits the given sample.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetRandomValue Generates a random variate.
(Overrides ContinuousDistributionGetRandomValue(Random))
GetRandomValues Generates the given number of random variates.
(Inherited from ContinuousDistribution)
GetTypeGets the Type of the current instance.
(Inherited from Object)
Hazard Computes the hazard function.
(Inherited from ContinuousDistribution)
InverseLeftProbability Returns the point at which the cumulative distribution function attains a given value.
(Overrides ContinuousDistributionInverseLeftProbability(Double))
InverseRightProbability Returns the point at which the right probability function attains the given value.
(Inherited from ContinuousDistribution)
LeftProbability Returns the cumulative probability to the left of (below) the given point.
(Overrides ContinuousDistributionLeftProbability(Double))
ProbabilityDensity Returns the probability density at the given point.
(Overrides ContinuousDistributionProbabilityDensity(Double))
RawMoment Computes a raw moment of the distribution.
(Overrides ContinuousDistributionRawMoment(Int32))
RightProbability Returns the cumulative probability to the right of (above) the given point.
(Overrides ContinuousDistributionRightProbability(Double))
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also