MathUtils { public static double logWeightedGeometricMean(double[] weights, double[] logScores) { return weightedArithmeticMean(weights, logScores); } private  MathUtils(); static long binomialCoeff(int n, int k); static double logSumExp(double[] scores); static double logWeightedGeometricMean(double[] weights, double[] logScores); static double weightedArithmeticMean(double[] weights, double[] scores); static double weightedGeometricMean(double[] weights, double[] scores); static double weightedLogSumExp(double[] weights, double[] scores); static double logprob(double input); static double clamp(double input, double min, double max); static double sigmoid(double t);  }
@Test public void testLogWeightedGeometricMean() { assertEquals(Math.log(4), MathUtils.logWeightedGeometricMean(new double[] {2,1}, new double[] { Math.log(2), Math.log(4) }), 0.1); }