naginterfaces.library.rand.dist_​lognormal

naginterfaces.library.rand.dist_lognormal(n, xmu, var, statecomm)[source]

dist_lognormal generates a vector of pseudorandom numbers from a log-normal distribution with parameters and .

For full information please refer to the NAG Library document for g05sm

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/g05/g05smf.html

Parameters
nint

, the number of pseudorandom numbers to be generated.

xmufloat

, the mean of the distribution of .

varfloat

, the variance of the distribution of .

statecommdict, RNG communication object, modified in place

RNG communication structure.

This argument must have been initialized by a prior call to init_repeat() or init_nonrepeat().

Returns
xfloat, ndarray, shape

The pseudorandom numbers from the specified log-normal distribution.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, is too large to take the exponential of .

(errno )

On entry, .

Constraint: .

(errno )

On entry, [‘state’] vector has been corrupted or not initialized.

Notes

The distribution has PDF (probability density function)

i.e., is normally distributed with mean and variance . dist_lognormal evaluates , where the are generated by dist_normal() from a Normal distribution with mean and variance , for .

One of the initialization functions init_repeat() (for a repeatable sequence if computed sequentially) or init_nonrepeat() (for a non-repeatable sequence) must be called prior to the first call to dist_lognormal.

References

Kendall, M G and Stuart, A, 1969, The Advanced Theory of Statistics (Volume 1), (3rd Edition), Griffin

Knuth, D E, 1981, The Art of Computer Programming (Volume 2), (2nd Edition), Addison–Wesley