Class MixtureMultivariateNormalDistribution
- java.lang.Object
-
- org.apache.commons.math4.legacy.distribution.AbstractMultivariateRealDistribution
-
- org.apache.commons.math4.legacy.distribution.MixtureMultivariateRealDistribution<MultivariateNormalDistribution>
-
- org.apache.commons.math4.legacy.distribution.MixtureMultivariateNormalDistribution
-
- All Implemented Interfaces:
MultivariateRealDistribution
public class MixtureMultivariateNormalDistribution extends MixtureMultivariateRealDistribution<MultivariateNormalDistribution>
Multivariate normal mixture distribution. This class is mainly syntactic sugar.- Since:
- 3.2
- See Also:
MixtureMultivariateRealDistribution
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.commons.math4.legacy.distribution.MultivariateRealDistribution
MultivariateRealDistribution.Sampler
-
-
Constructor Summary
Constructors Constructor Description MixtureMultivariateNormalDistribution(double[] weights, double[][] means, double[][][] covariances)
Creates a multivariate normal mixture distribution.MixtureMultivariateNormalDistribution(List<Pair<Double,MultivariateNormalDistribution>> components)
Creates a mixture model from a list of distributions and their associated weights.
-
Method Summary
-
Methods inherited from class org.apache.commons.math4.legacy.distribution.MixtureMultivariateRealDistribution
createSampler, density, getComponents
-
Methods inherited from class org.apache.commons.math4.legacy.distribution.AbstractMultivariateRealDistribution
getDimension, sample
-
-
-
-
Constructor Detail
-
MixtureMultivariateNormalDistribution
public MixtureMultivariateNormalDistribution(List<Pair<Double,MultivariateNormalDistribution>> components) throws NotPositiveException, DimensionMismatchException
Creates a mixture model from a list of distributions and their associated weights.- Parameters:
components
- Distributions from which to sample.- Throws:
NotPositiveException
- if any of the weights is negative.DimensionMismatchException
- if not all components have the same number of variables.
-
MixtureMultivariateNormalDistribution
public MixtureMultivariateNormalDistribution(double[] weights, double[][] means, double[][][] covariances) throws NotPositiveException, DimensionMismatchException
Creates a multivariate normal mixture distribution.- Parameters:
weights
- Weights of each component.means
- Mean vector for each component.covariances
- Covariance matrix for each component.- Throws:
NotPositiveException
- if any of the weights is negative.DimensionMismatchException
- if not all components have the same number of variables.
-
-