Learn R Programming

CircularDDM (version 0.1.0)

rvm: Generate random deviates for the von Mises distribution

Description

Generate random deviates for the von Mises distribution.

Usage

rvm(n, mu, k)

Arguments

n

number of observations.

mu

mean direction of the distribution.

k

non-negative numeric value for the concentration parameter of the distribution

Value

a vector

Details

A random variable for circular normal distribution has the form: $$f(theta; mu, kappa) = 1 / (2 * pi * I0(kappa)) * exp(kappa * cos(theta-mu))$$ theta is withins 0 and 2 * pi.

I0(kappa) in the normalizing constant is the modified Bessel function of the first kind and order zero.

Examples

Run this code
# NOT RUN {
n  <- 100
mu <- 0
k  <- 10
vm3_de <- rvm(n, mu, k)       ## in degree unit
vm3_pi <- vm3_de %% (2 * pi)  ## in radian unit
# }

Run the code above in your browser using DataLab