naginterfaces.library.rand.dist_​normal

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

dist_normal generates a vector of pseudorandom numbers taken from a Normal (Gaussian) distribution with mean and variance .

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

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/g05/g05skf.html

Parameters
nint

, the number of pseudorandom numbers to be generated.

xmufloat

, the mean of the distribution.

varfloat

, the variance of the distribution.

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 Normal distribution.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

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

Notes

The distribution has PDF (probability distribution function)

dist_normal uses the algorithm of Wichura (1988).

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_normal.

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

Wichura, 1988, Algorithm AS 241: the percentage points of the Normal distribution, Appl. Statist. (37), 477–484