Description Usage Arguments Details Value Supported Conjugate PriorLikelihood Pairs See Also Examples
Density, cumulative distribution function, quantile function and random number generation for supported mixture distributions. (d/p/q/r)mix are generic and work with any mixture supported by BesT (see table below).
1 2 3 4 5 6 7 8 9 10 
mix 
mixture distribution object 
x, q 
vector of quantiles 
log, log.p 
logical; if 
lower.tail 
logical; if 
p 
vector of probabilities 
n 
number of observations. If 
... 
components to subset given mixture. 
rescale 
logical; if 
A mixture distribution is defined as a linear superposition of K densities of the same distributional class. The mixture distributions supported have the form
f(x,w,a,b) = ∑_{k=1}^K w_k * f(x,a_k,b_k).
The w_k are the mixing coefficients which must sum to 1. Moreover, each density f is assumed to be parametrized by two parameters such that each component k is defined by a triplet, (w_k,a_k,b_k).
Individual mixture components can be extracted using the [[
operator, see examples below.
The supported densities are normal, beta and gamma which can be
instantiated with mixnorm
, mixbeta
, or
mixgamma
, respectively. In addition, the respective
predictive distributions are supported. These can be obtained by
calling preddist
which returns appropriate normal,
betabinomial or Poissongamma mixtures.
For convenience a summary
function is defined for all
mixtures. It returns the mean, standard deviation and the requested
quantiles which can be specified with the argument probs
.
dmix
gives the weighted sum of the densities of each
component.
pmix
calculates the distribution function by
evaluating the weighted sum of each components distribution
function.
qmix
returns the quantile for the given p
by using that the distribution function is monotonous and hence a
gradient based minimization scheme can be used to find the matching
quantile q
.
rmix
generates a random sample of size
n
by first sampling a latent component indicator in the
range 1..K for each draw and then the function samples from
each component a random draw using the respective sampling
function. The rnorm
function returns the random draws as
numerical vector with an additional attribute ind
which
gives the sampled component indicator.
Prior/Posterior  Likelihood  Predictive  Summaries 
Beta  Binomial  BetaBinomial  n , r 
Normal  Normal (fixed σ)  Normal  n , m , se 
Gamma  Poisson  GammaPoisson  n , m 
Gamma  Exponential  GammaExp (not supported)  n , m

Other mixdist:
mixbeta()
,
mixcombine()
,
mixgamma()
,
mixnorm()
,
plot.mix()
1 2 3 4 5 6 7 8 9 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.