Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rmixedvm

Random Generation from the Mixed von Mises Distribution


Description

Generates pseudo-random numbers from a mixture of two von Mises distributions.

Usage

rmixedvm(n, mu1, mu2, kappa1, kappa2, p)

Arguments

n

number of random variables to generate.

mu1

mean direction in radians of one of the two von Mises distributions.

mu2

mean direction in radians of the other von Mises distribution.

kappa1

concentration parameter of one of the two von Mises distributions.

kappa2

concentration parameter of the other von Mises distribution.

p

mixing proportion.

Details

Simulates random variables with the density function p*VM(mu1, kappa1) + (1-p)*VM(mu2, kappa2), where VM is the von Mises density function.

A uniform random variable on (0,1) is generated. If it is less than p, then a variable is generated from VM(mu1, kappa1), else a variable is generated from VM(mu2, kappa2). Simulation from the von Mises distribution is done via the algorithm due to Best and Fisher (1979).

Value

Returns a vector of n independent random variables generated from a mixture of two von Mises distributions.

References

Best, D. and Fisher, N. (1979). Efficient simulation of the von Mises distribution. Applied Statistics, 24, 152-157.

See Also


CircStats

Circular Statistics, from "Topics in Circular Statistics" (2001)

v0.2-6
GPL-2
Authors
S-plus original by Ulric Lund <ulund@calpoly.edu>, R port by Claudio Agostinelli <claudio.agostinelli@unitn.it>
Initial release
2018-06-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.