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

Erlang distribution random generator.

Pascal
procedure RandomErlang(const k: Integer; const lambda: double; const Results: TDenseMtxVec; Seed: Integer = -1);

Generates Result.Length pseudo random numbers, using the Erlang distribution with parameters k and lambda. The random numbers are stored in the Results vector. An exception is raised if Result vector is complex.

Generate 2000 random numbers by using the Erlang distribution with parameters k = 2, lambda=1.23.

Uses MtxExpr, StatRandom;
procedure Example;
  var Res: Vector;
begin
  Res.Size(2000);
  RandomErlang(2,1.23, Res);
end;
#include "MtxExpr.hpp"
#include "StatRandom.hpp"
void __fastcall Example()
{
  sVector Res;
  Res.Size(2000,false);
  RandomErlang(2,1.23, Res,-1);
}
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!