vonmisesmix {cylcop} | R Documentation |
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)
Arguments
n |
integer value, the number of random samples to be
generated with |
mu |
|
kappa |
|
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. |
Value
dvonmisesmix()
gives a vector of lengthlength(theta)
containing the density attheta
.pvonmisesmix()
gives a vector of lengthlength(theta)
containing the distribution function at the corresponding values oftheta
.qvonmisesmix()
gives a vector of lengthlength(p)
containing the quantiles at the corresponding values ofp
.rvonmisesmix()
generates a vector of lengthn
containing the random samples, i.e. angles in[-\pi, \pi)
.
Examples
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))