Package jline.util
Class GMMUtils
java.lang.Object
jline.util.GMMUtils
Utility functions for Gaussian Mixture Model operations.
This class provides static methods that correspond to the MATLAB gmm_* functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleCalculates the maximum value with high probability (99.999 percentile).static doublegmmMeanMax(GMM gmm, int k) Calculates the mean of the maximum of k independent samples from the GMM.static doublegmmMeanMin(GMM gmm, int k) Calculates the mean of the minimum of k independent samples from the GMM.static doubleCalculates the median (50th percentile).static doubleCalculates the minimum value with high probability (0.001 percentile).static doublegmmPercentile(GMM gmm, double p) Calculates the specified percentile of the GMM distribution.static doubleCalculates the variance of the maximum of k independent samples from the GMM.static doubleCalculates the variance of the minimum of k independent samples from the GMM.static MatrixsgmmConvolve(Matrix sgmm1, Matrix sgmm2) Convolves two simplified GMMs (sum of independent random variables).static doubleCalculates the first moment (E[X]) of a simplified GMM.static doubleCalculates the second moment (E[X²]) of a simplified GMM.static doubleCalculates the mean of a simplified GMM directly from matrix representation.static MatrixsgmmMixture(Matrix sgmm1, Matrix sgmm2, double p1, double p2) Creates a mixture of two simplified GMMs.static double[]Generates random samples from a simplified GMM representation.static doubleCalculates the standard deviation of a simplified GMM.static doubleCalculates the variance of a simplified GMM.
-
Constructor Details
-
GMMUtils
public GMMUtils()
-
-
Method Details
-
gmmMin
Calculates the minimum value with high probability (0.001 percentile). -
gmmMax
Calculates the maximum value with high probability (99.999 percentile). -
gmmMedian
Calculates the median (50th percentile). -
gmmPercentile
Calculates the specified percentile of the GMM distribution.- Parameters:
gmm- the GMM distributionp- the percentile (0-100)- Returns:
- the value at the specified percentile
-
gmmMeanMin
Calculates the mean of the minimum of k independent samples from the GMM. This is an approximation using extreme value theory. -
gmmMeanMax
Calculates the mean of the maximum of k independent samples from the GMM. This is an approximation using extreme value theory. -
gmmVarMin
Calculates the variance of the minimum of k independent samples from the GMM. -
gmmVarMax
Calculates the variance of the maximum of k independent samples from the GMM. -
sgmmRand
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
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
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
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
Calculates the variance of a simplified GMM.- Parameters:
sgmm- Matrix where each row is [weight, mean, variance]- Returns:
- The variance
-
sgmmStd
Calculates the standard deviation of a simplified GMM.- Parameters:
sgmm- Matrix where each row is [weight, mean, variance]- Returns:
- The standard deviation
-
sgmmConvolve
Convolves two simplified GMMs (sum of independent random variables).- Parameters:
sgmm1- First GMM matrixsgmm2- Second GMM matrix- Returns:
- Convolved GMM matrix
-
sgmmMixture
Creates a mixture of two simplified GMMs.- Parameters:
sgmm1- First GMM matrixsgmm2- Second GMM matrixp1- Weight for first GMMp2- Weight for second GMM- Returns:
- Mixed GMM matrix
-