Package smile.stat.distribution
Class GaussianMixture
java.lang.Object
smile.stat.distribution.Mixture
smile.stat.distribution.ExponentialFamilyMixture
smile.stat.distribution.GaussianMixture
- All Implemented Interfaces:
Serializable
,Distribution
Finite univariate Gaussian mixture. The EM algorithm is provided to learn
the mixture model from data. BIC score is employed to estimate the number
of components.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class smile.stat.distribution.Mixture
Mixture.Component
-
Field Summary
Fields inherited from class smile.stat.distribution.ExponentialFamilyMixture
bic, L
Fields inherited from class smile.stat.distribution.Mixture
components
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GaussianMixture
fit
(double[] x) Fits the Gaussian mixture model with the EM algorithm.static GaussianMixture
fit
(int k, double[] x) Fits the Gaussian mixture model with the EM algorithm.Methods inherited from class smile.stat.distribution.ExponentialFamilyMixture
fit, fit
Methods inherited from class smile.stat.distribution.Mixture
bic, cdf, entropy, length, logp, map, mean, p, posteriori, quantile, rand, size, toString, variance
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface smile.stat.distribution.Distribution
inverseTransformSampling, likelihood, logLikelihood, quantile, quantile, rand, rejectionSampling, sd
-
Constructor Details
-
GaussianMixture
Constructor.- Parameters:
components
- a list of multivariate Gaussian distributions.
-
-
Method Details
-
fit
Fits the Gaussian mixture model with the EM algorithm.- Parameters:
k
- the number of components.x
- the training data.- Returns:
- the distribution.
-
fit
Fits the Gaussian mixture model with the EM algorithm. The number of components will be selected by BIC.- Parameters:
x
- the training data.- Returns:
- the distribution.
-