Probabilities.GammaPDF Method

Overload List

#SignatureDescription
1procedure GammaPDF(const X: TDenseMtxVec; A: Double; B: Double; const Res: TDenseMtxVec);Gamma distribution PDF (vectorized).
2procedure GammaPDF(const X: TVec; a: Double; b: Double; const Res: TVec);Gamma probability density function (PDF) - vectorized version.
3function GammaPDF(x: Double; a: Double; b: Double): Double;Gamma distribution probability density function (PDF).

Overload 1: procedure GammaPDF(const X: TDenseMtxVec; A: Double; B: Double; const Res: TDenseMtxVec);

Gamma distribution PDF (vectorized).

#NameDescription
1XDefines distribution domain, real vector or matrix with real positive real values.
2ADefines distribution scale parameter. A must be a positive scalar.
3BDefines distribution shape parameter. B must be a positive scalar.
4ResAfter calculation stores the PDF calculated from X, a and b. Length and Complex properties of Res are adjusted automatically to match Length and Complex properties of X.

Result: stored in self (calling object)

Overload 2: procedure GammaPDF(const X: TVec; a: Double; b: Double; const Res: TVec);

Gamma probability density function (PDF) - vectorized version.

#NameDescription
1XDistribution domain, vector of real positive values.
2aDefines distribution scale parameter. a must be a positive scalar.
3bDefines distribution shape parameter. b must be a positive scalar.
4ResResult vector that will store the computed PDF values.

Result: stored in self (calling object)

Returns: Computes the Gamma probability density function (PDF) for vector of x values using the parameters a and b.

Remarks:

Calculates the Gamma distribution probability density function for each element in vector X, defined by the equation:

PDF(xa,b)=1baΓ(a)xa1exp(x/b)\text{PDF}\left(x| a,b \right)= \frac{1}{b^a \Gamma (a)} x^{a-1}\cdot \exp (-x/b)

where Gamma denotes the Math387.Gamma function.

This is the vectorized version that operates on entire vectors for improved performance.

See Also: Probabilities.GammaPDF, Probabilities.GammaCDF, Probabilities.GammaCDFInv

Overload 3: function GammaPDF(x: Double; a: Double; b: Double): Double;

Gamma distribution probability density function (PDF).

#NameDescription
1xDistribution domain, real value >= 0.
2aShape parameter, real value > 0.
3bScale parameter, real value > 0.

Returns: Double - the Gamma probability density function (PDF) at x for SHAPE parameter a and SCALE parameter b. Returns NAN when a <= 0 or b <= 0, returns 0 for x < 0, and +INF at x=0 when a < 1.

Remarks:

Computes the Gamma PDF with shape a and scale b:

PDF(x| a,b )= 1/(b^a Gamma (a)) x^(a-1)* exp (-x/b)

where Gamma is the Math387.Gamma function. Domain: x >= 0, a > 0, b > 0. Behaviour: NAN for a <= 0 or b <= 0; 0 for x < 0; at x=0 the density is 0 for a > 1, equals 1/b for a=1, and diverges (+INF) for a < 1. The exponential (a=1) and chi-squared (a=nu/2, b=2) distributions are special cases. A scalar form (this one) and a vectorized TDenseMtxVec overload are provided.

See Also: Probabilities.GammaCDF, Probabilities.GammaCDFInv