Class MultivariateMixture
java.lang.Object
smile.stat.distribution.MultivariateMixture
- All Implemented Interfaces:
Serializable, MultivariateDistribution
- Direct Known Subclasses:
MultivariateExponentialFamilyMixture
The finite mixture of multivariate distributions.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA component in the mixture distribution is defined by a distribution and its weight in the mixture. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal MultivariateMixture.Component[]The components of finite mixture model. -
Constructor Summary
ConstructorsConstructorDescriptionMultivariateMixture(MultivariateMixture.Component... components) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoublebic(double[][] data) Returns the BIC score.doublecdf(double[] x) Cumulative distribution function.cov()The covariance matrix of distribution.doubleentropy()Shannon entropy.intlength()The number of parameters of the distribution.doublelogp(double[] x) The density at x in log scale, which may prevents the underflow problem.intmap(double[] x) Returns the index of component with maximum a posteriori probability.double[]mean()The mean vector of distribution.doublep(double[] x) The probability density function for continuous distribution or probability mass function for discrete distribution at x.double[]posteriori(double[] x) Returns the posteriori probabilities.intsize()Returns the number of components in the mixture.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface MultivariateDistribution
likelihood, logLikelihood
-
Field Details
-
components
The components of finite mixture model.
-
-
Constructor Details
-
MultivariateMixture
Constructor.- Parameters:
components- a list of multivariate distributions.
-
-
Method Details
-
posteriori
public double[] posteriori(double[] x) Returns the posteriori probabilities.- Parameters:
x- a real vector.- Returns:
- the posteriori probabilities.
-
map
public int map(double[] x) Returns the index of component with maximum a posteriori probability.- Parameters:
x- a real vector.- Returns:
- the index of component with maximum a posteriori probability.
-
mean
public double[] mean()Description copied from interface:MultivariateDistributionThe mean vector of distribution.- Specified by:
meanin interfaceMultivariateDistribution- Returns:
- the mean vector.
-
cov
Description copied from interface:MultivariateDistributionThe covariance matrix of distribution.- Specified by:
covin interfaceMultivariateDistribution- Returns:
- the covariance matrix.
-
entropy
public double entropy()Shannon entropy. Not supported.- Specified by:
entropyin interfaceMultivariateDistribution- Returns:
- Shannon entropy
-
p
public double p(double[] x) Description copied from interface:MultivariateDistributionThe probability density function for continuous distribution or probability mass function for discrete distribution at x.- Specified by:
pin interfaceMultivariateDistribution- Parameters:
x- a real vector.- Returns:
- the desnity.
-
logp
public double logp(double[] x) Description copied from interface:MultivariateDistributionThe density at x in log scale, which may prevents the underflow problem.- Specified by:
logpin interfaceMultivariateDistribution- Parameters:
x- a real vector.- Returns:
- the log density.
-
cdf
public double cdf(double[] x) Description copied from interface:MultivariateDistributionCumulative distribution function. That is the probability to the left of x.- Specified by:
cdfin interfaceMultivariateDistribution- Parameters:
x- a real vector.- Returns:
- the probability.
-
length
public int length()Description copied from interface:MultivariateDistributionThe number of parameters of the distribution. The "length" is in the sense of the minimum description length principle.- Specified by:
lengthin interfaceMultivariateDistribution- Returns:
- the number of parameters of the distribution.
-
size
public int size()Returns the number of components in the mixture.- Returns:
- the number of components.
-
bic
public double bic(double[][] data) Returns the BIC score.- Parameters:
data- the data to calculate likelihood.- Returns:
- the BIC score.
-
toString
-