Dew Stats Master .NET
WeibullFit Routines
Summary
Calculate parameters for Weibull distributed values.

Unit
Statistics

Declaration
Procedure WeibullFit(X: TVec; out A, B: TSample; out PCIA, PCIB: TTwoElmReal; MaxIter: Integer = 500; Tolerance: TSample = 1e-8; alpha: TSample = 0.05);
 Parameter  Description 
Stores data which is assumed to be Weibull distributed. 
A,B Return Weibull distribution parameter estimators. 
MaxIter Maximum number of iterations needed for deriving a and b. 
Tolerance Defines the acceptable tolerance for calculating a and b. 
PCIA,PCIB a and b (1-Alpha)*100 percent confidence intervals. 
Alpha Confidence interval percentage. 

Description
Calculate parameters for Weibull distributed values.
Categories
Distribution parameters estimation
 See Also 
RandomWeibull 
MVWeibull 

Example 1

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 : TSample; 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 "MtxVecCpp.h" #include "Statistics.hpp" void __fastcall Example(); { Vector 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; double CIA[2]; double CIB[2]; WeibullFit(vec1,resA,resB,CIA,CIB,400,1e-4,0.05); }
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples; { private void Example() { Vector vec1 = new Vector(1000,false); // first, generate 1000 randomly gamma distributed // numbers with parameters a=0.5 and b =1.2 StatRandom.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; double[2] CIA; double[2] CIB; Statistics.WeibullFit(vec1,out resA,out resB,out CIA,out CIB,400,1e-4,0.05); } }



Declaration
Procedure WeibullFit(X: TVec; out A, B: TSample; MaxIter: Integer = 500; Tolerance: TSample = 1e-8);

Copyright 2008 Dew Research
http://www.dewresearch.com