View source: R/all_vmcos_fns.R
rvmcosmix | R Documentation |
The bivariate von Mises cosine model mixtures
rvmcosmix(n, kappa1, kappa2, kappa3, mu1, mu2, pmix, method = "naive", ...) dvmcosmix(x, kappa1, kappa2, kappa3, mu1, mu2, pmix, log = FALSE, ...)
n |
number of observations. |
kappa1, kappa2, kappa3 |
vectors of concentration parameters; |
mu1, mu2 |
vectors of mean parameters. |
pmix |
vector of mixture proportions. |
method |
Rejection sampling method to be used. Available choices are |
... |
additional arguments to be passed to dvmcos. See details. |
x |
matrix of angles (in radians) where the density is to be evaluated, with each row being a single bivariate vector of angles. |
log |
logical. Should the log density be returned instead? |
All the argument vectors pmix, kappa1, kappa2, kappa3, mu1
and mu2
must be of
the same length ( = component size of the mixture model), with j-th element corresponding to the
j-th component of the mixture distribution.
The bivariate von Mises cosine model mixture distribution with component size K = length(pmix)
has density
g(x) = ∑ p[j] * f(x; κ_1[j], κ_2[j], κ_3[j], μ_1[j], μ_2[j])
where the sum extends over j; p[j]; κ_1[j], κ_2[j], κ_3[j]; and μ_1[j], μ_2[j] respectively denote the mixing proportion, the three concentration parameters and the two mean parameter for the j-th cluster, j = 1, ..., K, and f(. ; κ_1, κ_2, κ_3, μ_1, μ_2) denotes the density function of the von Mises cosine model with concentration parameters κ_1, κ_2, κ_3 and mean parameters μ_1, μ_2.
dvmcosmix
computes the density and rvmcosmix
generates random deviates from the mixture density.
kappa1 <- c(1, 2, 3) kappa2 <- c(1, 6, 5) kappa3 <- c(0, 1, 2) mu1 <- c(1, 2, 5) mu2 <- c(0, 1, 3) pmix <- c(0.3, 0.4, 0.3) x <- diag(2, 2) n <- 10 # mixture densities calculated at the rows of x dvmcosmix(x, kappa1, kappa2, kappa3, mu1, mu2, pmix) # number of observations generated from the mixture distribution is n rvmcosmix(n, kappa1, kappa2, kappa3, mu1, mu2, pmix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.