Statistics.GammaFit Method

Overload List

#SignatureDescription
1void 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.
2void 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.

#NameDescription
1XStores data which is assumed to be Gamma distributed.
2AReturn Gamma distribution parameter estimator A.
3BReturn Gamma distribution parameter estimator B.
4MaxIterMaximum number of iterations needed for deriving a and b.
5ToleranceDefines the acceptable tolerance for calculating a and b.
6PCIAA (1-Alpha)*100 percent confidence interval.
7PCIBB (1-Alpha)*100 percent confidence interval.
8AlphaConfidence 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.

#NameTypeDescription
1XTVecsource TVec
2ADouble (ref)output
3BDouble (ref)output
4MaxIterInt32
5ToleranceDoublescalar

Result: stored in self (calling object)