@Test public void medianWithNansTest() { for (int i = 0; i < MEDIANS_NANS.length; i++) { double mean = mean(MATRIX[i], false); assertEquals(MEDIANS_NANS[i], mean, 0d); } }
public static double mean(double[] data, boolean excludeNan) { double sum = 0; if(excludeNan) { data = removeNan(data); } for (int i = 0; i < data.length; i++) { sum += data[i]; } return sum / data.length; }
MatrixUtils { public static double mean(double[] data, boolean excludeNan) { double sum = 0; if(excludeNan) { data = removeNan(data); } for (int i = 0; i < data.length; i++) { sum += data[i]; } return sum / data.length; } }
MatrixUtils { public static double mean(double[] data, boolean excludeNan) { double sum = 0; if(excludeNan) { data = removeNan(data); } for (int i = 0; i < data.length; i++) { sum += data[i]; } return sum / data.length; }  }
MatrixUtils { public static double mean(double[] data, boolean excludeNan) { double sum = 0; if(excludeNan) { data = removeNan(data); } for (int i = 0; i < data.length; i++) { sum += data[i]; } return sum / data.length; }  static double max(double[][] matrix); static double max(double[] array); static double min(double[][] matrix); static double min(double[] array); static double[][] transform(double[][] matrix,
		Function<Double, Double> transformation
	); static double[][] center(double[][] matrix,
		BiFunction<double[], Boolean, Double> centering, boolean excludeNan
	); static double mean(double[] data, boolean excludeNan); static double median(double[] data, boolean excludeNan); static Object[][] removeColumn(int column, Object[][] data); static String[][] asStringMatrix(Object[][] matrix); static double[] asPrimitiveArray(List<Double> list); }
MatrixUtils { public static double mean(double[] data, boolean excludeNan) { double sum = 0; if(excludeNan) { data = removeNan(data); } for (int i = 0; i < data.length; i++) { sum += data[i]; } return sum / data.length; }  static double max(double[][] matrix); static double max(double[] array); static double min(double[][] matrix); static double min(double[] array); static double[][] transform(double[][] matrix,
		Function<Double, Double> transformation
	); static double[][] center(double[][] matrix,
		BiFunction<double[], Boolean, Double> centering, boolean excludeNan
	); static double mean(double[] data, boolean excludeNan); static double median(double[] data, boolean excludeNan); static Object[][] removeColumn(int column, Object[][] data); static String[][] asStringMatrix(Object[][] matrix); static double[] asPrimitiveArray(List<Double> list);  }