question: public static double calculateGiniCoefficient ( List < Double > valueList ) { int numberOfValues = valueList . size ( ) ; double sumOfValues = calculateSum ( valueList ) ; double arithmeticMean = sumOfValues / numberOfValues ; double sumOfAbsoluteDifferences = 0. ; for ( double i : valueList ) { for ( double j : valueList ) { double absoulteDifference = Math . abs ( i - j ) ; sumOfAbsoluteDifferences = sumOfAbsoluteDifferences + absoulteDifference ; } } double giniCoefficient = sumOfAbsoluteDifferences / ( 2 * Math . pow ( numberOfValues , 2 ) * arithmeticMean ) ; return giniCoefficient ; }
target:  Calculates Gini coefficient of the values of a given values. The Gini Coefficient is equals to the half of the relative mean absolute difference (RMD).