Random_Weibull Routines
Generates a random variate from the Weibull distribution with probability density: a a-1 -x f(x) = a.x e

Unit
QESBPCSRandom

Overloaded Variants
Function Random_Weibull(const a: Extended): Extended;
Function Random_Weibull(const a: Extended; RandomGenerator: TRandomGenFunction): Extended;

Declaration
Function Random_Weibull(const a: Extended): Extended;

Parameters
Parameter for Weibull Distribution. Cannot be 0.
RandomGenerator Optional Function to use for Uniform Random Number Generator. If omitted, Delphi's Random function is used, and if this is done remember to call Randomize if you don't want repeated values.

Category
Arithmetic Routines for Floats

Implementation

function Random_Weibull (const a: Extended): Extended;
begin
     Result := Random_Weibull (a, DelphiRandom);
End;

Declaration
Function Random_Weibull(const a: Extended; RandomGenerator: TRandomGenFunction): Extended;

Implementation

function Random_Weibull (const a: Extended;
     RandomGenerator: TRandomGenFunction): Extended;
begin
     if Abs (a) <= VSmall then
          raise EMathError.Create (rsInvalidValue);

     Result := XtoY (Random_Exponential (RandomGenerator), 1.0 / a);
End;


HTML generated by Time2HELP
http://www.time2help.com