Top Description Constructors Methods
org.apache.commons.math3.distribution

public Class MixtureMultivariateNormalDistribution

extends MixtureMultivariateRealDistribution<MultivariateNormalDistribution>
Class Inheritance
Imports
java.util.ArrayList, .List, org.apache.commons.math3.exception.DimensionMismatchException, .NotPositiveException, org.apache.commons.math3.random.RandomGenerator, org.apache.commons.math3.util.Pair

Multivariate normal mixture distribution. This class is mainly syntactic sugar.
Since
3.2
See Also
MixtureMultivariateRealDistribution

Constructor Summary

AccessConstructor and Description
public
MixtureMultivariateNormalDistribution(double[]
Weights of each component.
weights
,
double[][]
Mean vector for each component.
means
,
double[][][]
Covariance matrix for each component.
covariances
)

Creates a multivariate normal mixture distribution.

public
MixtureMultivariateNormalDistribution(List<Pair<Double, MultivariateNormalDistribution>>
List of (weight, distribution) pairs from which to sample.
components
)

Creates a mixture model from a list of distributions and their associated weights.

public
MixtureMultivariateNormalDistribution(RandomGenerator
Random number generator.
rng
,
List<Pair<Double, MultivariateNormalDistribution>>
Distributions from which to sample.
components
)

Creates a mixture model from a list of distributions and their associated weights.

Method Summary

Modifier and TypeMethod and Description
private static List<Pair<Double, MultivariateNormalDistribution>>

Returns:

the list of components.
createComponents
(double[]
Weights of each component.
weights
,
double[][]
Mean vector for each component.
means
,
double[][][]
Covariance matrix for each component.
covariances
)

Inherited from org.apache.commons.math3.distribution.MixtureMultivariateRealDistribution:
densitygetComponentsreseedRandomGeneratorsample

Constructor Detail

MixtureMultivariateNormalDistributionback to summary
public MixtureMultivariateNormalDistribution(double[] weights, double[][] means, double[][][] covariances)

Creates a multivariate normal mixture distribution.

Note

this constructor will implicitly create an instance of Well19937c as random generator to be used for sampling only (see sample() and sample(int)). In case no sampling is needed for the created distribution, it is advised to pass null as random generator via the appropriate constructors to avoid the additional initialisation overhead.

Parameters
weights:double[]

Weights of each component.

means:double[][]

Mean vector for each component.

covariances:double[][][]

Covariance matrix for each component.

MixtureMultivariateNormalDistributionback to summary
public MixtureMultivariateNormalDistribution(List<Pair<Double, MultivariateNormalDistribution>> components)

Creates a mixture model from a list of distributions and their associated weights.

Note

this constructor will implicitly create an instance of Well19937c as random generator to be used for sampling only (see sample() and sample(int)). In case no sampling is needed for the created distribution, it is advised to pass null as random generator via the appropriate constructors to avoid the additional initialisation overhead.

Parameters
components:List<Pair<Double, MultivariateNormalDistribution>>

List of (weight, distribution) pairs from which to sample.

MixtureMultivariateNormalDistributionback to summary
public MixtureMultivariateNormalDistribution(RandomGenerator rng, List<Pair<Double, MultivariateNormalDistribution>> components) throws NotPositiveException, DimensionMismatchException

Creates a mixture model from a list of distributions and their associated weights.

Parameters
rng:RandomGenerator

Random number generator.

components:List<Pair<Double, MultivariateNormalDistribution>>

Distributions from which to sample.

Exceptions
NotPositiveException:
if any of the weights is negative.
DimensionMismatchException:
if not all components have the same number of variables.

Method Detail

createComponentsback to summary
private static List<Pair<Double, MultivariateNormalDistribution>> createComponents(double[] weights, double[][] means, double[][][] covariances)
Parameters
weights:double[]

Weights of each component.

means:double[][]

Mean vector for each component.

covariances:double[][][]

Covariance matrix for each component.

Returns:List<Pair<Double, MultivariateNormalDistribution>>

the list of components.