Click or drag to resize
RandomNextLogNormal Method
Generate a pseudorandom number from a lognormal distribution.

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
public virtual double NextLogNormal(
	double mean,
	double stdev
)

Parameters

mean
Type: SystemDouble
A double which specifies the mean of the underlying normal distribution.
stdev
Type: SystemDouble
A double which specifies the standard deviation of the underlying normal distribution. It must be positive.

Return Value

Type: Double
A double which specifies a pseudorandom number from a lognormal distribution.
Remarks

Method NextLogNormal generates pseudorandom numbers from a lognormal distribution with parameters mean and stdev. The scale parameter in the underlying normal distribution, stdev, must be positive. The method is to generate normal deviates with mean mean and standard deviation stdev and then to exponentiate the normal deviates.

With \mu = mean and \sigma = stdev, the probability density function for the lognormal distribution is

f\left( x \right) = \frac{1}{{\sigma 
            x\sqrt {2\pi } }}\exp \left[ { - \frac{1}{{2\sigma ^2 }}\left( {\ln 
            x - \mu } \right)^2 } \right]\,\,for\,x > 0

The mean and variance of the lognormal distribution are \rm exp(\mu + \sigma2/2) and \rm exp(2\mu+ 2\sigma2) - \rm exp(2\mu+ \sigma2), respectively.

See Also