Statistics::WeibullFit Function

Overload List

#SignatureDescription
1void WeibullFit(TVec *X, double &A, double &B, int MaxIter = 500, double Tolerance = 1E-8);Calculate parameters for Weibull distributed values using MLE.
2void WeibullFit(TVec *X, double &A, double &B, DewArray<double> &PCIA, DewArray<double> &PCIB, int MaxIter = 500, double Tolerance = 1E-8, double Alpha = 0.05);Calculate parameters for Weibull distributed values.

Overload 1: void WeibullFit(TVec *X, double &A, double &B, int MaxIter = 500, double Tolerance = 1E-8);

Calculate parameters for Weibull distributed values using MLE.

#NameTypeDescription
1XTVec *
2Adouble &
3Bdouble &
4MaxIter = 500int
5Tolerance = 1E-8double
Examples
#include "MtxExpr.h"
#include "Units.StatRandom.h"
#include "Units.Statistics.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatRandom;
using namespace Dew::Stats::Units::Statistics;

void Example()
{
    Vector vec1;
    double resA, resB;
    DewArray<double> CIA(2), CIB(2);

    // first, generate 1000 randomly Weibull distributed
    // numbers with parameters a=0.5 and b =1.2
    vec1.Size(1000);
    RandomWeibull(0.5,1.2,vec1);
    // Now extract the a,b and their 95% confidence intervals.
    // Use at max 400 iterations and tolerance 0.0001
    WeibullFit(vec1,resA,resB,CIA,CIB,400,1e-4,0.05);
}
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler

Overload 2: void WeibullFit(TVec *X, double &A, double &B, DewArray<double> &PCIA, DewArray<double> &PCIB, int MaxIter = 500, double Tolerance = 1E-8, double Alpha = 0.05);

Calculate parameters for Weibull distributed values.

#NameTypeDescription
1XTVec *Stores data which is assumed to be Weibull distributed.
2Adouble &Return Weibull distribution parameter estimator A.
3Bdouble &Return Weibull distribution parameter estimator B.
4PCIADewArray<double> &A (1-Alpha)*100 percent confidence interval.
5PCIBDewArray<double> &B (1-Alpha)*100 percent confidence interval.
6MaxIter = 500intMaximum number of iterations needed for deriving a and b.
7Tolerance = 1E-8doubleDefines the acceptable tolerance for calculating a and b.
8Alpha = 0.05doubleConfidence interval percentage.
Examples
#include "MtxExpr.h"
#include "Units.StatRandom.h"
#include "Units.Statistics.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Stats;
using namespace Dew::Stats::Units::StatRandom;
using namespace Dew::Stats::Units::Statistics;

void Example()
{
    Vector vec1(1000,false);
        // first, generate 1000 randomly gamma distributed
        // numbers with parameters a=0.5 and b =1.2
        RandomWeibull(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;
    DewArray<double> CIA(2);
    DewArray<double> CIB(2);
    WeibullFit(vec1,resA,resB,CIA,CIB,400,1e-4,0.05);
}
See Also: RandomWeibull, WeibullStat
Declared in Dew::Stats::Units::Statistics · Dew.Stats/Units.Statistics.h · Cross-compiler