Probabilities::GammaPDF Function

Overload List

#SignatureDescription
1double GammaPDF(double x, double a, double b);Gamma distribution probability density function (PDF).
2void GammaPDF(TVec *X, double a, double b, TVec *Res);Gamma probability density function (PDF) - vectorized version.
3void GammaPDF(TDenseMtxVec *X, double A, double B, TDenseMtxVec *Res);Gamma distribution PDF (vectorized).

Overload 1: double GammaPDF(double x, double a, double b);

Gamma distribution probability density function (PDF).

#NameTypeDescription
1xdoubleDistribution domain, real value >= 0.
2adoubleShape parameter, real value > 0.
3bdoubleScale parameter, real value > 0.

Returns: 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
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler

Overload 2: void GammaPDF(TVec *X, double a, double b, TVec *Res);

Gamma probability density function (PDF) - vectorized version.

#NameTypeDescription
1XTVec *Distribution domain, vector of real positive values.
2adoubleDefines distribution scale parameter. a must be a positive scalar.
3bdoubleDefines distribution shape parameter. b must be a positive scalar.
4ResTVec *Result vector that will store the computed PDF values.

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
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler

Overload 3: void GammaPDF(TDenseMtxVec *X, double A, double B, TDenseMtxVec *Res);

Gamma distribution PDF (vectorized).

#NameTypeDescription
1XTDenseMtxVec *Defines distribution domain, real vector or matrix with real positive real values.
2AdoubleDefines distribution scale parameter. A must be a positive scalar.
3BdoubleDefines distribution shape parameter. B must be a positive scalar.
4ResTDenseMtxVec *After 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.
Declared in Dew::Math::Units::Probabilities · Dew.Math/Units.Probabilities.h · Cross-compiler