Overload List
| # | Signature | Description |
|---|---|---|
| 1 | double GammaPDF(double x, double a, double b); | Gamma distribution probability density function (PDF). |
| 2 | void GammaPDF(TVec *X, double a, double b, TVec *Res); | Gamma probability density function (PDF) - vectorized version. |
| 3 | void 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).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | x | double | Distribution domain, real value >= 0. |
| 2 | a | double | Shape parameter, real value > 0. |
| 3 | b | double | Scale 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.
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.
Overload 2: void GammaPDF(TVec *X, double a, double b, TVec *Res);
Gamma probability density function (PDF) - vectorized version.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec * | Distribution domain, vector of real positive values. |
| 2 | a | double | Defines distribution scale parameter. a must be a positive scalar. |
| 3 | b | double | Defines distribution shape parameter. b must be a positive scalar. |
| 4 | Res | TVec * | 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.
Calculates the Gamma distribution probability density function for each element in vector X, defined by the equation:
where Gamma denotes the Math387::Gamma function.
This is the vectorized version that operates on entire vectors for improved performance.
Overload 3: void GammaPDF(TDenseMtxVec *X, double A, double B, TDenseMtxVec *Res);
Gamma distribution PDF (vectorized).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TDenseMtxVec * | Defines distribution domain, real vector or matrix with real positive real values. |
| 2 | A | double | Defines distribution scale parameter. A must be a positive scalar. |
| 3 | B | double | Defines distribution shape parameter. B must be a positive scalar. |
| 4 | Res | TDenseMtxVec * | 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. |