Package jline.util

Class GMMUtils

java.lang.Object
jline.util.GMMUtils

public class GMMUtils extends Object
Utility functions for Gaussian Mixture Model operations. This class provides static methods that correspond to the MATLAB gmm_* functions.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    gmmMax(GMM gmm)
    Calculates the maximum value with high probability (99.999 percentile).
    static double
    gmmMeanMax(GMM gmm, int k)
    Calculates the mean of the maximum of k independent samples from the GMM.
    static double
    gmmMeanMin(GMM gmm, int k)
    Calculates the mean of the minimum of k independent samples from the GMM.
    static double
    Calculates the median (50th percentile).
    static double
    gmmMin(GMM gmm)
    Calculates the minimum value with high probability (0.001 percentile).
    static double
    gmmPercentile(GMM gmm, double p)
    Calculates the specified percentile of the GMM distribution.
    static double
    gmmVarMax(GMM gmm, int k)
    Calculates the variance 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 Matrix
    sgmmConvolve(Matrix sgmm1, Matrix sgmm2)
    Convolves two simplified GMMs (sum of independent random variables).
    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
    Calculates the mean of a simplified GMM directly from matrix representation.
    static Matrix
    sgmmMixture(Matrix sgmm1, Matrix sgmm2, double p1, double p2)
    Creates a mixture of two simplified GMMs.
    static double[]
    sgmmRand(Matrix sgmm, int n)
    Generates random samples from a simplified GMM representation.
    static double
    Calculates the standard deviation of a simplified GMM.
    static double
    Calculates the variance of a simplified GMM.

    Methods inherited from class java.lang.Object

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

    • GMMUtils

      public GMMUtils()
  • Method Details

    • gmmMin

      public static double gmmMin(GMM gmm)
      Calculates the minimum value with high probability (0.001 percentile).
    • gmmMax

      public static double gmmMax(GMM gmm)
      Calculates the maximum value with high probability (99.999 percentile).
    • gmmMedian

      public static double gmmMedian(GMM gmm)
      Calculates the median (50th percentile).
    • gmmPercentile

      public 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

      public 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

      public 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

      public static double gmmVarMin(GMM gmm, int k)
      Calculates the variance of the minimum of k independent samples from the GMM.
    • gmmVarMax

      public static double gmmVarMax(GMM gmm, int k)
      Calculates the variance of the maximum of k independent samples from the GMM.
    • sgmmRand

      public static 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

      public 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

      public 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

      public 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

      public 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

      public 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

      public 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

      public 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