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

Lognormal distribution random generator.

Pascal
procedure RandomLogNormal(const mu: double; const sigma: double; const Results: TDenseMtxVec; Seed: Integer = -1);

This routine generates Result.Length pseudo random numbers, using the lognormal distribution with parameters mu and sigma. 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 lognormal distribution with parameters Mu=3.0 and Sigma=2.4.

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