/** * Mean * * @return mean */ public int mean() { return Int.mean(values, end); }
/** * Mean * * @return mean */ public int mean() { return Int.mean(values, end); }
/** * Mean * * @return mean */ public int mean() { return Int.mean(values, end); }
public static double variance(Collection<?> inputList, String propertyPath) { double mean = mean(inputList, propertyPath); double temp = 0; double a; if (propertyPath.contains(".") || propertyPath.contains("[")) { String[] properties = StringScanner.splitByDelimiters(propertyPath, ".[]"); for (Object o : inputList) { a =BeanUtils.getPropertyInt(o, properties); temp += (mean-a)*(mean-a); } } else { Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject(inputList.iterator().next()); FieldAccess fieldAccess = fields.get(propertyPath); for (Object o : inputList) { a = fieldAccess.getInt(o); temp += (mean-a)*(mean-a); } } return Math.round(temp / inputList.size()); }
public static double variance(Collection<?> inputList, String propertyPath) { double mean = mean(inputList, propertyPath); double temp = 0; double a; if (propertyPath.contains(".") || propertyPath.contains("[")) { String[] properties = StringScanner.splitByDelimiters(propertyPath, ".[]"); for (Object o : inputList) { a =BeanUtils.getPropertyInt(o, properties); temp += (mean-a)*(mean-a); } } else { Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject(inputList.iterator().next()); FieldAccess fieldAccess = fields.get(propertyPath); for (Object o : inputList) { a = fieldAccess.getInt(o); temp += (mean-a)*(mean-a); } } return Math.round(temp / inputList.size()); }
public static double variance(Collection<?> inputList, String propertyPath) { double mean = mean(inputList, propertyPath); double temp = 0; double a; if (propertyPath.contains(".") || propertyPath.contains("[")) { String[] properties = StringScanner.splitByDelimiters(propertyPath, ".[]"); for (Object o : inputList) { a =BeanUtils.getPropertyInt(o, properties); temp += (mean-a)*(mean-a); } } else { Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject(inputList.iterator().next()); FieldAccess fieldAccess = fields.get(propertyPath); for (Object o : inputList) { a = fieldAccess.getInt(o); temp += (mean-a)*(mean-a); } } return Math.round(temp / inputList.size()); }