/** * This returns the entropy for a given vector of probabilities. * @param probabilities the probabilities to getFromOrigin the entropy for * @return the entropy of the given probabilities. */ public static double information(double[] probabilities) { double total = 0.0; for (double d : probabilities) { total += (-1.0 * log2(d) * d); } return total; }//end information