You are here: Symbol Reference > Statistics Namespace > Functions > Statistics.WeibullFit Function
Stats Master VCL
ContentsIndex
PreviousUpNext
Statistics.WeibullFit Function

Calculate parameters for Weibull distributed values.

Pascal
procedure WeibullFit(const X: TVec; out A: double; out B: double; var PCIA: TTwoElmReal; var PCIB: TTwoElmReal; MaxIter: Integer = 500; Tolerance: double = 1e-8; Alpha: double = 0.05); overload;
Parameters 
Description 
Stores data which is assumed to be Weibull distributed. 
Return Weibull distribution parameter estimator A. 
Return Weibull distribution parameter estimator B. 
PCIA 
A (1-Alpha)*100 percent confidence interval. 
PCIB 
B (1-Alpha)*100 percent confidence interval. 
MaxIter 
Maximum number of iterations needed for deriving a and b. 
Tolerance 
Defines the acceptable tolerance for calculating a and b. 
Alpha 
Confidence interval percentage. 

RandomWeibull, WeibullStat

The following example generates 1000 random Weibull distributed values and then uses WeibullFit routine to extract used a and b parameters

Uses MtxExpr, Math387, Statistics;
procedure Example;
var vec1: Vector;
  resA, resB : double;
  CIA,CIB: TTwoElmReal;
begin
    // 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);
end;
#include "StatRandom.hpp"
#include "MtxExpr.hpp"
#include "Statistics.hpp"
void __fastcall Example();
{
    sVector vec1;
    // first, generate 1000 randomly gamma distributed
    // numbers with parameters a=0.5 and b =1.2
    vec1.Size(1000,false);
    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
    double resA, resB;
    TTwoElmReal CIA,CIB;
    WeibullFit(vec1,resA,resB,CIA,CIB,400,1e-4,0.05);
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!