Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void GammaFit(TVec X, ref Double A, ref Double B, ref Double[] PCIA, ref Double[] PCIB, Int32 MaxIter, Double Tolerance, Double Alpha) | Calculate parameters for Gamma distributed values. |
| 2 | void GammaFit(TVec X, ref Double A, ref Double B, Int32 MaxIter, Double Tolerance) | Calculate parameters for Gamma distributed values using MLE. |
Overload 1: void GammaFit(TVec X, ref Double A, ref Double B, ref Double[] PCIA, ref Double[] PCIB, Int32 MaxIter, Double Tolerance, Double Alpha)
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)
Examples
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples;
{
private void Example()
{
Vector vec1 = new Vector(0);
// first, generate 1000 randomly gamma distributed
// numbers with parameters a=0.5 and b =1.2
vec1.Size(1000, false);
StatRandom.RandomGamma(0.5, 1.2, vec1, -1);
// Now extract the a,b and their 95% confidence intervals.
// Use at max 400 iterations and tolerance 0.0001
double resA, resB;
double[] CIA = new double[2];
double[] CIB = new double[2];
Statistics.GammaFit(vec1, out resA, out resB, out CIA, out CIB, 400, 1e-4, 0.05);
}
}
See Also: StatRandom.RandomGamma, Probabilities.GammaStat
Overload 2: void GammaFit(TVec X, ref Double A, ref Double B, Int32 MaxIter, Double Tolerance)
Calculate parameters for Gamma distributed values using MLE.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec | source TVec |
| 2 | A | Double (ref) | output |
| 3 | B | Double (ref) | output |
| 4 | MaxIter | Int32 | |
| 5 | Tolerance | Double | scalar |
Result: stored in self (calling object)