numpy.random.vonmises

numpy.random.vonmises(mu, kappa, size=None)

Draw samples from a von Mises distribution.

Samples are drawn from a von Mises distribution with specified mode (mu) and dispersion (kappa), on the interval [-pi, pi].

The von Mises distribution (also known as the circular normal distribution) is a continuous probability distribution on the unit circle. It may be thought of as the circular analogue of the normal distribution.

Parameters :

mu : float

Mode (“center”) of the distribution.

kappa : float

Dispersion of the distribution, has to be >=0.

size : int or tuple of int

Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.

Returns :

samples : scalar or ndarray

The returned samples, which are in the interval [-pi, pi].

See also

scipy.stats.distributions.vonmises
probability density function, distribution, or cumulative density function, etc.

Notes

The probability density for the von Mises distribution is

p(x) = \frac{e^{\kappa cos(x-\mu)}}{2\pi I_0(\kappa)},

where \mu is the mode and \kappa the dispersion, and I_0(\kappa) is the modified Bessel function of order 0.

The von Mises is named for Richard Edler von Mises, who was born in Austria-Hungary, in what is now the Ukraine. He fled to the United States in 1939 and became a professor at Harvard. He worked in probability theory, aerodynamics, fluid mechanics, and philosophy of science.

References

Abramowitz, M. and Stegun, I. A. (ed.), Handbook of Mathematical Functions, New York: Dover, 1965.

von Mises, R., Mathematical Theory of Probability and Statistics, New York: Academic Press, 1964.

Examples

Previous topic

numpy.random.uniform

Next topic

numpy.random.wald

This Page