Click or drag to resize
RandomNextLogarithmic Method
Generate a pseudorandom number from a logarithmic distribution.

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
public virtual int NextLogarithmic(
	double a
)

Parameters

a
Type: SystemDouble
A double which specifies the parameter of the logarithmic distribution, 0 \lt a \lt 1.

Return Value

Type: Int32
A int which specifies a pseudorandom number from a logarithmic distribution.
Remarks

Method NextLogarithmic generates pseudorandom numbers from a logarithmic distribution with parameter a. The probability function is

f\left( x \right) =  - \frac{{a^x }}{{x\ln 
            \left( {1 - a} \right)}}

for x = 1, 2, 3, \ldots, and 0 \lt a \lt 1.

The methods used are described by Kemp (1981) and depend on the value of a. If a is less than 0.95, Kemp's algorithm LS, which is a "chop-down" variant of an inverse CDF technique, is used. Otherwise, Kemp's algorithm LK, which gives special treatment to the highly probable values of 1 and 2, is used.

See Also