Class MixtureMultivariateRealDistribution<T extends MultivariateRealDistribution>

    • Constructor Detail

      • MixtureMultivariateRealDistribution

        public MixtureMultivariateRealDistribution​(List<Pair<Double,​T>> 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 AbstractMultivariateRealDistribution.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.

        components - List of (weight, distribution) pairs from which to sample.
      • MixtureMultivariateRealDistribution

        public MixtureMultivariateRealDistribution​(RandomGenerator rng,
                                                   List<Pair<Double,​T>> components)
        Creates a mixture model from a list of distributions and their associated weights.
        rng - Random number generator.
        components - Distributions from which to sample.
        MathIllegalArgumentException - if any of the weights is negative.
        MathIllegalArgumentException - if not all components have the same number of variables.
    • Method Detail

      • density

        public double density​(double[] values)
        Returns the probability density function (PDF) of this distribution evaluated at the specified point x. In general, the PDF is the derivative of the cumulative distribution function. If the derivative does not exist at x, then an appropriate replacement should be returned, e.g. Double.POSITIVE_INFINITY, Double.NaN, or the limit inferior or limit superior of the difference quotient.
        values - Point at which the PDF is evaluated.
        the value of the probability density function at point x.
      • getComponents

        public List<Pair<Double,​T>> getComponents()
        Gets the distributions that make up the mixture model.
        the component distributions and associated weights.