| mixture | R Documentation |
Creates an S3 object representing a finite mixture distribution.
The density is f(x) = \sum_{k=1}^{K} w_k f_k(x) where
f_k are the component densities and w_k are the mixing
weights.
mixture(components, weights)
components |
A non-empty list of |
weights |
A numeric vector of non-negative mixing weights that
sum to 1 (within tolerance |
The class hierarchy is determined by the components: if all components are univariate (or multivariate, continuous, discrete), the mixture inherits those classes as well.
A mixture object with appropriate class hierarchy.
m <- mixture(
components = list(normal(0, 1), normal(5, 2)),
weights = c(0.3, 0.7)
)
mean(m)
vcov(m)
format(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.