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.
Usage
mixture(components, weights)
Value
A mixture object with appropriate class hierarchy.
Arguments
components
A non-empty list of dist objects.
weights
A numeric vector of non-negative mixing weights that
sum to 1 (within tolerance 1e-10). Must have the same
length as components.
Details
The class hierarchy is determined by the components: if all components
are univariate (or multivariate, continuous, discrete), the mixture
inherits those classes as well.