naginterfaces.library.rand.dist_​vonmises

naginterfaces.library.rand.dist_vonmises(n, vk, statecomm)[source]

dist_vonmises generates a vector of pseudorandom numbers from a von Mises distribution with concentration parameter .

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

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/g05/g05srf.html

Parameters
nint

, the number of pseudorandom numbers to be generated.

vkfloat

, the concentration parameter of the required von Mises 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 von Mises distribution.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, or too large: .

(errno )

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

Notes

The von Mises distribution is a symmetric distribution used in the analysis of circular data. The PDF (probability density function) of this distribution on the circle with mean direction and concentration parameter , can be written as:

where is reduced modulo so that and . For very small the distribution is almost the uniform distribution, whereas for all the probability is concentrated at one point.

The variates, , are generated using an envelope rejection method with a wrapped Cauchy target distribution as proposed by Best and Fisher (1979) and described by Dagpunar (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_vonmises.

References

Best, D J and Fisher, N I, 1979, Efficient simulation of the von Mises distribution, Appl. Statist. (28), 152–157

Dagpunar, J, 1988, Principles of Random Variate Generation, Oxford University Press

Mardia, K V, 1972, Statistics of Directional Data, Academic Press