Package jline.util

Class GMMUtils

  • All Implemented Interfaces:

    
    public class GMMUtils
    
                        

    Utility functions for Gaussian Mixture Model operations. This class provides static methods that correspond to the MATLAB gmm_* functions.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      GMMUtils()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static double gmmMin(GMM gmm) Calculates the minimum value with high probability (0.001 percentile).
      static double gmmMax(GMM gmm) Calculates the maximum value with high probability (99.999 percentile).
      static double gmmMedian(GMM gmm) Calculates the median (50th percentile).
      static double gmmPercentile(GMM gmm, double p) Calculates the specified percentile of the GMM distribution.
      static double gmmMeanMin(GMM gmm, int k) Calculates the mean of the minimum of k independent samples from the GMM.
      static double gmmMeanMax(GMM gmm, int k) Calculates the mean of the maximum of k independent samples from the GMM.
      static double gmmVarMin(GMM gmm, int k) Calculates the variance of the minimum of k independent samples from the GMM.
      static double gmmVarMax(GMM gmm, int k) Calculates the variance of the maximum of k independent samples from the GMM.
      static Array<double> sgmmRand(Matrix sgmm, int n) Generates random samples from a simplified GMM representation.
      static double sgmmMean(Matrix sgmm) Calculates the mean of a simplified GMM directly from matrix representation.
      static double sgmmE1(Matrix sgmm) Calculates the first moment (E[X]) of a simplified GMM.
      static double sgmmE2(Matrix sgmm) Calculates the second moment (E[X²]) of a simplified GMM.
      static double sgmmVar(Matrix sgmm) Calculates the variance of a simplified GMM.
      static double sgmmStd(Matrix sgmm) Calculates the standard deviation of a simplified GMM.
      static Matrix sgmmConvolve(Matrix sgmm1, Matrix sgmm2) Convolves two simplified GMMs (sum of independent random variables).
      static Matrix sgmmMixture(Matrix sgmm1, Matrix sgmm2, double p1, double p2) Creates a mixture of two simplified GMMs.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GMMUtils

        GMMUtils()
    • Method Detail

      • gmmMin

         static double gmmMin(GMM gmm)

        Calculates the minimum value with high probability (0.001 percentile).

      • gmmMax

         static double gmmMax(GMM gmm)

        Calculates the maximum value with high probability (99.999 percentile).

      • gmmMedian

         static double gmmMedian(GMM gmm)

        Calculates the median (50th percentile).

      • gmmPercentile

         static double gmmPercentile(GMM gmm, double p)

        Calculates the specified percentile of the GMM distribution.

        Parameters:
        gmm - the GMM distribution
        p - the percentile (0-100)
        Returns:

        the value at the specified percentile

      • gmmMeanMin

         static double gmmMeanMin(GMM gmm, int k)

        Calculates the mean of the minimum of k independent samples from the GMM. This is an approximation using extreme value theory.

      • gmmMeanMax

         static double gmmMeanMax(GMM gmm, int k)

        Calculates the mean of the maximum of k independent samples from the GMM. This is an approximation using extreme value theory.

      • gmmVarMin

         static double gmmVarMin(GMM gmm, int k)

        Calculates the variance of the minimum of k independent samples from the GMM.

      • gmmVarMax

         static double gmmVarMax(GMM gmm, int k)

        Calculates the variance of the maximum of k independent samples from the GMM.

      • sgmmRand

         static Array<double> sgmmRand(Matrix sgmm, int n)

        Generates random samples from a simplified GMM representation.

        Parameters:
        sgmm - Matrix where each row is [weight, mean, variance]
        n - Number of samples to generate
        Returns:

        Array of random samples

      • sgmmMean

         static double sgmmMean(Matrix sgmm)

        Calculates the mean of a simplified GMM directly from matrix representation.

        Parameters:
        sgmm - Matrix where each row is [weight, mean, variance]
        Returns:

        The weighted mean

      • sgmmE1

         static double sgmmE1(Matrix sgmm)

        Calculates the first moment (E[X]) of a simplified GMM.

        Parameters:
        sgmm - Matrix where each row is [weight, mean, variance]
        Returns:

        The first moment (mean)

      • sgmmE2

         static double sgmmE2(Matrix sgmm)

        Calculates the second moment (E[X²]) of a simplified GMM.

        Parameters:
        sgmm - Matrix where each row is [weight, mean, variance]
        Returns:

        The second moment

      • sgmmVar

         static double sgmmVar(Matrix sgmm)

        Calculates the variance of a simplified GMM.

        Parameters:
        sgmm - Matrix where each row is [weight, mean, variance]
        Returns:

        The variance

      • sgmmStd

         static double sgmmStd(Matrix sgmm)

        Calculates the standard deviation of a simplified GMM.

        Parameters:
        sgmm - Matrix where each row is [weight, mean, variance]
        Returns:

        The standard deviation

      • sgmmConvolve

         static Matrix sgmmConvolve(Matrix sgmm1, Matrix sgmm2)

        Convolves two simplified GMMs (sum of independent random variables).

        Parameters:
        sgmm1 - First GMM matrix
        sgmm2 - Second GMM matrix
        Returns:

        Convolved GMM matrix

      • sgmmMixture

         static Matrix sgmmMixture(Matrix sgmm1, Matrix sgmm2, double p1, double p2)

        Creates a mixture of two simplified GMMs.

        Parameters:
        sgmm1 - First GMM matrix
        sgmm2 - Second GMM matrix
        p1 - Weight for first GMM
        p2 - Weight for second GMM
        Returns:

        Mixed GMM matrix