GammaDistribution Constructor

Definition

Namespace: Numerics.NET.Statistics.Distributions
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.10.0
Constructs a new GammaDistribution.

Overload List

GammaDistribution(Double) Constructs a new standard GammaDistribution with the specified order parameter.
GammaDistribution(Vector<Double>) Estimates the parameters of the distribution of a variable assuming it follows a gamma distribution using the method of matching moments.
GammaDistribution(Double, Double) Constructs a new GammaDistribution with the specified order and scale parameter.
GammaDistribution(Vector<Double>, EstimationMethod) Estimates the parameters of the distribution of a variable assuming it follows a gamma distribution.
GammaDistribution(Double, Double, Double) Constructs a new GammaDistribution with the specified order, scale, and location parameters.

GammaDistribution(Double)

Constructs a new standard GammaDistribution with the specified order parameter.
C#
public GammaDistribution(
	double order
)

Parameters

order  Double
The order of the distribution. Must be strictly greater than zero.

Remarks

order must be strictly greater than zero. The location parameter of the distribution is set to zero. The scale parameter is set to 1.

Exceptions

ArgumentOutOfRangeException

The order order is less than or equal to zero.

GammaDistribution(Vector<Double>)

Estimates the parameters of the distribution of a variable assuming it follows a gamma distribution using the method of matching moments.
C#
public GammaDistribution(
	Vector<double> variable
)

Parameters

variable  Vector<Double>
The sample observations used to estimate the distribution parameters.

Remarks

This overload uses Default, which selects matching moments with population variance. It estimates shape and scale with location fixed at zero. To obtain maximum likelihood estimates, use the overload accepting an EstimationMethod and specify MaximumLikelihood.

Exceptions

ArgumentNullException

variable is null.

GammaDistribution(Double, Double)

Constructs a new GammaDistribution with the specified order and scale parameter.
C#
public GammaDistribution(
	double order,
	double scale
)

Parameters

order  Double
The order of the distribution. Must be strictly greater than zero.
scale  Double
The scale parameter. Must be strictly greater than zero.

Remarks

order and scale must be strictly greater than zero. The location parameter of the distribution is set to zero.

Exceptions

ArgumentOutOfRangeException

The order order or the scale factor scale is less than or equal to zero.

GammaDistribution(Vector<Double>, EstimationMethod)

Estimates the parameters of the distribution of a variable assuming it follows a gamma distribution.
C#
public GammaDistribution(
	Vector<double> variable,
	EstimationMethod method
)

Parameters

variable  Vector<Double>
The sample observations used to estimate the distribution parameters.
method  EstimationMethod
A EstimationMethod value that specifies the method used to estimate the distribution's parameters.

Remarks

Default and MatchingMoments both use matching moments. With sample mean m and population variance v (divisor equal to the sample count), the fitted shape is m * m / v and the scale is v / m. Maximum likelihood is used only when MaximumLikelihood is explicitly requested.

The fitted distribution uses the shape-scale parameterization: ShapeParameter is the shape and ScaleParameter is the scale, rather than a rate. LocationParameter is fixed at zero for both estimation methods. The estimation method selects how these distribution parameters are obtained; it does not change their meaning.

Exceptions

ArgumentNullException

variable is null.

GammaDistribution(Double, Double, Double)

Constructs a new GammaDistribution with the specified order, scale, and location parameters.
C#
public GammaDistribution(
	double order,
	double scale,
	double location
)

Parameters

order  Double
The order of the distribution. Must be strictly greater than zero.
scale  Double
The scale parameter. Must be strictly greater than zero.
location  Double
The location parameter.

Remarks

order and scale must be strictly greater than zero.

Exceptions

ArgumentOutOfRangeException

order is NaN or less than or equal to zero.

-or-

scale is NaN or less than or equal to zero.

See Also