public class org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization extends java.lang.Object
{
private static final int DEFAULT_MAX_ITERATIONS;
private static final double DEFAULT_THRESHOLD;
private final double[][] data;
private org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution fittedModel;
private double logLikelihood;
public void <init>(double[][]) throws org.apache.commons.math.exception.NotStrictlyPositiveException, org.apache.commons.math.exception.DimensionMismatchException, org.apache.commons.math.exception.NumberIsTooSmallException
{
java.lang.Integer v, v, v;
org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization v;
org.apache.commons.math.exception.NotStrictlyPositiveException v;
double[][] v, v, v;
double[] v, v, v, v, v, v, v, v, v, v;
org.apache.commons.math.exception.NumberIsTooSmallException v;
int v, v, v, v, v, v, v, v, v, v, v, v, v;
org.apache.commons.math.exception.util.LocalizedFormats v;
org.apache.commons.math.exception.DimensionMismatchException v;
v := @this: org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization;
v := @parameter: double[][];
specialinvoke v.<java.lang.Object: void <init>()>();
v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double logLikelihood> = 0.0;
v = lengthof v;
if v >= 1 goto label;
v = new org.apache.commons.math.exception.NotStrictlyPositiveException;
v = lengthof v;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
specialinvoke v.<org.apache.commons.math.exception.NotStrictlyPositiveException: void <init>(java.lang.Number)>(v);
throw v;
label:
v = lengthof v;
v = v[0];
v = lengthof v;
v = newmultiarray (double)[v][v];
v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data> = v;
v = 0;
label:
v = lengthof v;
if v >= v goto label;
v = v[v];
v = lengthof v;
v = v[0];
v = lengthof v;
if v == v goto label;
v = new org.apache.commons.math.exception.DimensionMismatchException;
v = v[v];
v = lengthof v;
v = v[0];
v = lengthof v;
specialinvoke v.<org.apache.commons.math.exception.DimensionMismatchException: void <init>(int,int)>(v, v);
throw v;
label:
v = v[v];
v = lengthof v;
if v >= 2 goto label;
v = new org.apache.commons.math.exception.NumberIsTooSmallException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats NUMBER_TOO_SMALL>;
v = v[v];
v = lengthof v;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(2);
specialinvoke v.<org.apache.commons.math.exception.NumberIsTooSmallException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Number,java.lang.Number,boolean)>(v, v, v, 1);
throw v;
label:
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data>;
v = v[v];
v = v[v];
v = lengthof v;
v = staticinvoke <org.apache.commons.math.util.MathArrays: double[] copyOf(double[],int)>(v, v);
v[v] = v;
v = v + 1;
goto label;
label:
return;
}
public void fit(org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution, int, double) throws org.apache.commons.math.linear.SingularMatrixException, org.apache.commons.math.exception.NotStrictlyPositiveException, org.apache.commons.math.exception.DimensionMismatchException
{
java.lang.Integer v;
byte v, v, v;
org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution v, v, v, v, v;
double[][][] v;
org.apache.commons.math.exception.ConvergenceException v;
org.apache.commons.math.linear.RealMatrix[] v;
org.apache.commons.math.linear.RealMatrix v, v, v, v, v, v, v, v;
double[][] v, v, v, v, v, v, v, v, v, v;
java.lang.Double v;
double[] v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
org.apache.commons.math.distribution.MultivariateNormalDistribution v;
org.apache.commons.math.linear.Array2DRowRealMatrix v, v;
org.apache.commons.math.exception.DimensionMismatchException v;
org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization v;
java.util.List v, v, v, v;
org.apache.commons.math.exception.NotStrictlyPositiveException v, v;
org.apache.commons.math.distribution.MultivariateNormalDistribution[] v;
int v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
double v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
java.lang.Object v, v, v, v, v, v;
v := @this: org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization;
v := @parameter: org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution;
v := @parameter: int;
v := @parameter: double;
if v >= 1 goto label;
v = new org.apache.commons.math.exception.NotStrictlyPositiveException;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
specialinvoke v.<org.apache.commons.math.exception.NotStrictlyPositiveException: void <init>(java.lang.Number)>(v);
throw v;
label:
v = v cmpg 4.9E-324;
if v >= 0 goto label;
v = new org.apache.commons.math.exception.NotStrictlyPositiveException;
v = staticinvoke <java.lang.Double: java.lang.Double valueOf(double)>(v);
specialinvoke v.<org.apache.commons.math.exception.NotStrictlyPositiveException: void <init>(java.lang.Number)>(v);
throw v;
label:
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data>;
v = lengthof v;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data>;
v = v[0];
v = lengthof v;
v = virtualinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: java.util.List getComponents()>();
v = interfaceinvoke v.<java.util.List: int size()>();
v = virtualinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: java.util.List getComponents()>();
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(0);
v = virtualinvoke v.<org.apache.commons.math.util.Pair: java.lang.Object getSecond()>();
v = virtualinvoke v.<org.apache.commons.math.distribution.MultivariateNormalDistribution: double[] getMeans()>();
v = lengthof v;
if v == v goto label;
v = new org.apache.commons.math.exception.DimensionMismatchException;
specialinvoke v.<org.apache.commons.math.exception.DimensionMismatchException: void <init>(int,int)>(v, v);
throw v;
label:
v = 0;
v = 0.0;
v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double logLikelihood> = #-Infinity;
v = new org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution;
v = virtualinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: java.util.List getComponents()>();
specialinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: void <init>(java.util.List)>(v);
v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution fittedModel> = v;
label:
v = v;
v = v + 1;
if v > v goto label;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double logLikelihood>;
v = v - v;
v = staticinvoke <java.lang.Math: double abs(double)>(v);
v = v cmpl v;
if v <= 0 goto label;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double logLikelihood>;
v = 0.0;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution fittedModel>;
v = virtualinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: java.util.List getComponents()>();
v = newarray (double)[v];
v = newarray (org.apache.commons.math.distribution.MultivariateNormalDistribution)[v];
v = 0;
label:
if v >= v goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = virtualinvoke v.<org.apache.commons.math.util.Pair: java.lang.Object getFirst()>();
v = virtualinvoke v.<java.lang.Double: double doubleValue()>();
v[v] = v;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = virtualinvoke v.<org.apache.commons.math.util.Pair: java.lang.Object getSecond()>();
v[v] = v;
v = v + 1;
goto label;
label:
v = newmultiarray (double)[v][v];
v = newarray (double)[v];
v = newmultiarray (double)[v][v];
v = 0;
label:
if v >= v goto label;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution fittedModel>;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data>;
v = v[v];
v = virtualinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: double density(double[])>(v);
v = staticinvoke <java.lang.Math: double log(double)>(v);
v = v + v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v[v];
v = v[v];
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data>;
v = v[v];
v = virtualinvoke v.<org.apache.commons.math.distribution.MultivariateNormalDistribution: double density(double[])>(v);
v = v * v;
v = v / v;
v[v] = v;
v = v[v];
v = v[v];
v = v[v];
v = v + v;
v[v] = v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v[v];
v = v[v];
v = v[v];
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data>;
v = v[v];
v = v[v];
v = v * v;
v = v + v;
v[v] = v;
v = v + 1;
goto label;
label:
v = v + 1;
goto label;
label:
v = v + 1;
goto label;
label:
v = v / v;
v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double logLikelihood> = v;
v = newarray (double)[v];
v = newmultiarray (double)[v][v];
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v / v;
v[v] = v;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v[v];
v = v[v];
v = v[v];
v = v / v;
v[v] = v;
v = v + 1;
goto label;
label:
v = v + 1;
goto label;
label:
v = newarray (org.apache.commons.math.linear.RealMatrix)[v];
v = 0;
label:
if v >= v goto label;
v = new org.apache.commons.math.linear.Array2DRowRealMatrix;
specialinvoke v.<org.apache.commons.math.linear.Array2DRowRealMatrix: void <init>(int,int)>(v, v);
v[v] = v;
v = v + 1;
goto label;
label:
v = 0;
label:
if v >= v goto label;
v = 0;
label:
if v >= v goto label;
v = new org.apache.commons.math.linear.Array2DRowRealMatrix;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double[][] data>;
v = v[v];
v = v[v];
v = staticinvoke <org.apache.commons.math.util.MathArrays: double[] ebeSubtract(double[],double[])>(v, v);
specialinvoke v.<org.apache.commons.math.linear.Array2DRowRealMatrix: void <init>(double[])>(v);
v = interfaceinvoke v.<org.apache.commons.math.linear.RealMatrix: org.apache.commons.math.linear.RealMatrix transpose()>();
v = interfaceinvoke v.<org.apache.commons.math.linear.RealMatrix: org.apache.commons.math.linear.RealMatrix multiply(org.apache.commons.math.linear.RealMatrix)>(v);
v = v[v];
v = v[v];
v = interfaceinvoke v.<org.apache.commons.math.linear.RealMatrix: org.apache.commons.math.linear.RealMatrix scalarMultiply(double)>(v);
v = v[v];
v = interfaceinvoke v.<org.apache.commons.math.linear.RealMatrix: org.apache.commons.math.linear.RealMatrix add(org.apache.commons.math.linear.RealMatrix)>(v);
v[v] = v;
v = v + 1;
goto label;
label:
v = v + 1;
goto label;
label:
v = newmultiarray (double)[v][v][v];
v = 0;
label:
if v >= v goto label;
v = v[v];
v = v[v];
v = 1.0 / v;
v = interfaceinvoke v.<org.apache.commons.math.linear.RealMatrix: org.apache.commons.math.linear.RealMatrix scalarMultiply(double)>(v);
v[v] = v;
v = v[v];
v = interfaceinvoke v.<org.apache.commons.math.linear.RealMatrix: double[][] getData()>();
v[v] = v;
v = v + 1;
goto label;
label:
v = new org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution;
specialinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: void <init>(double[],double[][],double[][][])>(v, v, v);
v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution fittedModel> = v;
goto label;
label:
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double logLikelihood>;
v = v - v;
v = staticinvoke <java.lang.Math: double abs(double)>(v);
v = v cmpl v;
if v <= 0 goto label;
v = new org.apache.commons.math.exception.ConvergenceException;
specialinvoke v.<org.apache.commons.math.exception.ConvergenceException: void <init>()>();
throw v;
label:
return;
}
public void fit(org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution) throws org.apache.commons.math.linear.SingularMatrixException, org.apache.commons.math.exception.NotStrictlyPositiveException
{
org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization v;
org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution v;
v := @this: org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization;
v := @parameter: org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution;
virtualinvoke v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: void fit(org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution,int,double)>(v, 1000, 1.0E-5);
return;
}
public static org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution estimate(double[][], int) throws org.apache.commons.math.exception.NotStrictlyPositiveException, org.apache.commons.math.exception.DimensionMismatchException
{
org.apache.commons.math.stat.correlation.Covariance v;
java.lang.Integer v, v, v, v, v;
org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution v;
org.apache.commons.math.exception.NumberIsTooLargeException v;
org.apache.commons.math.exception.NotStrictlyPositiveException v;
org.apache.commons.math.linear.RealMatrix v;
double[][] v, v, v;
java.lang.Double v;
double[] v, v, v, v, v;
org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization$DataRow[] v;
java.util.ArrayList v;
org.apache.commons.math.exception.NumberIsTooSmallException v;
int v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v;
org.apache.commons.math.distribution.MultivariateNormalDistribution v;
org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization$DataRow v, v;
double v, v, v, v, v;
org.apache.commons.math.util.Pair v;
v := @parameter: double[][];
v := @parameter: int;
v = lengthof v;
if v >= 2 goto label;
v = new org.apache.commons.math.exception.NotStrictlyPositiveException;
v = lengthof v;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
specialinvoke v.<org.apache.commons.math.exception.NotStrictlyPositiveException: void <init>(java.lang.Number)>(v);
throw v;
label:
if v >= 2 goto label;
v = new org.apache.commons.math.exception.NumberIsTooSmallException;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(2);
specialinvoke v.<org.apache.commons.math.exception.NumberIsTooSmallException: void <init>(java.lang.Number,java.lang.Number,boolean)>(v, v, 1);
throw v;
label:
v = lengthof v;
if v <= v goto label;
v = new org.apache.commons.math.exception.NumberIsTooLargeException;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = lengthof v;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
specialinvoke v.<org.apache.commons.math.exception.NumberIsTooLargeException: void <init>(java.lang.Number,java.lang.Number,boolean)>(v, v, 1);
throw v;
label:
v = lengthof v;
v = v[0];
v = lengthof v;
v = newarray (org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization$DataRow)[v];
v = 0;
label:
if v >= v goto label;
v = new org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization$DataRow;
v = v[v];
specialinvoke v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization$DataRow: void <init>(double[])>(v);
v[v] = v;
v = v + 1;
goto label;
label:
staticinvoke <java.util.Arrays: void sort(java.lang.Object[])>(v);
v = 1.0 / v;
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = 0;
label:
if v >= v goto label;
v = v * v;
v = v / v;
v = v + 1;
v = v * v;
v = v / v;
v = v - v;
v = newmultiarray (double)[v][v];
v = newarray (double)[v];
v = v;
v = 0;
label:
if v >= v goto label;
v = 0;
label:
if v >= v goto label;
v = v[v];
v = virtualinvoke v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization$DataRow: double[] getRow()>();
v = v[v];
v = v[v];
v = v + v;
v[v] = v;
v = v[v];
v[v] = v;
v = v + 1;
goto label;
label:
v = v + 1;
v = v + 1;
goto label;
label:
v = 1.0 / v;
staticinvoke <org.apache.commons.math.util.MathArrays: void scaleInPlace(double,double[])>(v, v);
v = new org.apache.commons.math.stat.correlation.Covariance;
specialinvoke v.<org.apache.commons.math.stat.correlation.Covariance: void <init>(double[][])>(v);
v = virtualinvoke v.<org.apache.commons.math.stat.correlation.Covariance: org.apache.commons.math.linear.RealMatrix getCovarianceMatrix()>();
v = interfaceinvoke v.<org.apache.commons.math.linear.RealMatrix: double[][] getData()>();
v = new org.apache.commons.math.distribution.MultivariateNormalDistribution;
specialinvoke v.<org.apache.commons.math.distribution.MultivariateNormalDistribution: void <init>(double[],double[][])>(v, v);
v = new org.apache.commons.math.util.Pair;
v = staticinvoke <java.lang.Double: java.lang.Double valueOf(double)>(v);
specialinvoke v.<org.apache.commons.math.util.Pair: void <init>(java.lang.Object,java.lang.Object)>(v, v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
v = v + 1;
goto label;
label:
v = new org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution;
specialinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: void <init>(java.util.List)>(v);
return v;
}
public double getLogLikelihood()
{
org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization v;
double v;
v := @this: org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: double logLikelihood>;
return v;
}
public org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution getFittedModel()
{
org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization v;
java.util.List v;
org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution v, v;
v := @this: org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization;
v = new org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution;
v = v.<org.apache.commons.math.distribution.fitting.MultivariateNormalMixtureExpectationMaximization: org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution fittedModel>;
v = virtualinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: java.util.List getComponents()>();
specialinvoke v.<org.apache.commons.math.distribution.MixtureMultivariateNormalDistribution: void <init>(java.util.List)>(v);
return v;
}
}