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
nag_rand_init_repeat (g05kf) (for a repeatable sequence if computed sequentially) or
nag_rand_init_nonrepeat (g05kg) (for a non-repeatable sequence) must be called prior to the first call to
nag_rand_dist_vonmises (g05sr).
Best D J and Fisher N I (1979) Efficient simulation of the von Mises distribution Appl. Statist. 28 152–157
None.
Not applicable.
For a given number of random variates the generation time increases slightly with increasing .
This example prints the first five pseudorandom numbers from a von Mises distribution with
, generated by a single call to
nag_rand_dist_vonmises (g05sr), after initialization by
nag_rand_init_repeat (g05kf).
function g05sr_example
fprintf('g05sr example results\n\n');
seed = [int64(1762543)];
genid = int64(1);
subid = int64(1);
[state, ifail] = g05kf( ...
genid, subid, seed);
n = int64(5);
vk = 1;
[state, x, ifail] = g05sr( ...
n, vk, state);
disp('Variates');
disp(x);