Overload List
| # | Signature | Description |
|---|---|---|
| 1 | procedure GammaFit(const X: TVec; out A: Double; out B: Double; var PCIA: TDoubleArray; var PCIB: TDoubleArray; MaxIter: Integer; Tolerance: Double; Alpha: Double); | Calculate parameters for Gamma distributed values. |
| 2 | procedure GammaFit(const X: TVec; out A: Double; out B: Double; MaxIter: Integer; Tolerance: Double); | Calculate parameters for Gamma distributed values using MLE. |
Overload 1: procedure GammaFit(const X: TVec; out A: Double; out B: Double; var PCIA: TDoubleArray; var PCIB: TDoubleArray; MaxIter: Integer; Tolerance: Double; Alpha: Double);
Calculate parameters for Gamma distributed values.
| # | Name | Description |
|---|---|---|
| 1 | X | Stores data which is assumed to be Gamma distributed. |
| 2 | A | Return Gamma distribution parameter estimator A. |
| 3 | B | Return Gamma distribution parameter estimator B. |
| 4 | MaxIter | Maximum number of iterations needed for deriving a and b. |
| 5 | Tolerance | Defines the acceptable tolerance for calculating a and b. |
| 6 | PCIA | A (1-Alpha)*100 percent confidence interval. |
| 7 | PCIB | B (1-Alpha)*100 percent confidence interval. |
| 8 | Alpha | Confidence interval percentage. |
Result: stored in self (calling object)
See Also: StatRandom.RandomGamma, Probabilities.GammaStat
Overload 2: procedure GammaFit(const X: TVec; out A: Double; out B: Double; MaxIter: Integer; Tolerance: Double);
Calculate parameters for Gamma distributed values using MLE.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec | |
| 2 | A | Double | |
| 3 | B | Double | |
| 4 | MaxIter | Integer | |
| 5 | Tolerance | Double | scalar |
Result: stored in self (calling object)
Examples
Uses StatRandom, Statistics, MtxExpr;
procedure Example;
var vec1: Vector;
resA, resB : double;
CIA,CIB: TTwoElmReal;
begin
// first, generate 1000 randomly gamma distributed
// numbers with parameters a=0.5 and b =1.2
vec1.Size(1000);
RandomGamma(0.5,1.2,vec1);
// Now extract the a,b and their 95% confidence intervals.
// Use at max 400 iterations and tolerance 0.0001
GammaFit(vec1,resA,resB,CIA,CIB,400,1e-4);
end;