rvmsinmix {BAMBI} | R Documentation |
The bivariate von Mises sine model mixtures
Description
The bivariate von Mises sine model mixtures
Usage
rvmsinmix(n, kappa1, kappa2, kappa3, mu1, mu2, pmix, method = "naive")
dvmsinmix(x, kappa1, kappa2, kappa3, mu1, mu2, pmix, log = FALSE)
Arguments
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 |
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? |
Details
All the argument vectors pmix, kappa1, kappa2, kappa3, mu1
and mu2
must be of
the same length ( = component size of the mixture model), with -th element corresponding to the
-th component of the mixture distribution.
The bivariate von Mises sine model mixture distribution with component size K = length(p.mix)
has density
where the sum extends over ;
; and
respectively denote the mixing proportion,
the three concentration parameters and the two mean parameter for the
-th component,
,
and
denotes the density function of the von Mises sine model
with concentration parameters
and mean parameters
.
Value
dvmsinmix
computes the density (vector if x is a two column matrix with more than one row)
and rvmsinmix
generates random deviates from the mixture density.
Examples
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
dvmsinmix(x, kappa1, kappa2, kappa3, mu1, mu2, pmix)
# number of observations generated from the mixture distribution is n
rvmsinmix(n, kappa1, kappa2, kappa3, mu1, mu2, pmix)