Learn R Programming

cylcop (version 0.2.0)

vonmisesmix: Density, Distribution, Quantiles and Random Number Generation for the mixed von Mises Distribution

Description

The number of components in the mixed von Mises distribution is specified by the length of the parameter vectors. The quantiles are numerically obtained from the distribution function using monotone cubic splines.

Usage

rvonmisesmix(n, mu, kappa, prop)

dvonmisesmix(theta, mu, kappa, prop)

pvonmisesmix(theta, mu, kappa, prop)

qvonmisesmix(p, mu, kappa, prop)

Value

  • dvonmisesmix() gives a vector of length length(theta) containing the density at theta.

  • pvonmisesmix() gives a vector of length length(theta) containing the distribution function at the corresponding values of theta.

  • qvonmisesmix() gives a vector of length length(p) containing the quantiles at the corresponding values of p.

  • rvonmisesmix() generates a vector of length n containing the random samples, i.e. angles in \([-\pi, \pi)\).

Arguments

n

integer value, the number of random samples to be generated with rvonmisesmix().

mu

numeric vector holding the mean directions.

kappa

numeric vector holding the concentration parameters.

prop

numeric vector, holding the mixing proportions of the components.

theta

numeric vector giving the angles where the density or distribution function is evaluated.

p

numeric vector giving the probabilities where the quantile function is evaluated.

Examples

Run this code

rvonmisesmix(10, mu = c(0, pi, pi/2), kappa = c(2, 2, 4), prop = c(0.6, 0.3, 0.1))

dvonmisesmix(c(0, 2, pi, 1), mu = c(0, pi), kappa = c(2, 2), prop = c(0.6, 0.4))

prob <- pvonmisesmix(c(0.1, pi), mu = c(0, pi, pi/2), kappa = c(2, 2, 4), prop = c(0.6, 0.3, 0.1))
prob
qvonmisesmix(prob, mu = c(0, pi, pi/2), kappa = c(2, 2, 4), prop = c(0.6, 0.3, 0.1))

Run the code above in your browser using DataLab