List of utility methods to do Entropy Calculate
double | entropy(int total, double[] data) entropy double result = 0.0; int len = data.length; for (int i = 0; i < len; i++) { result += -(double) data[i] * log2(data[i] / len); return result; |
int | entropy(int[] histogram) entropy int total = 0; for (int value : histogram) { total += value; double sum = 0; for (int k : histogram) { if (k > 0) { double p = k * 1.0 / total; ... |
long | longPseudoEntropy() Not suited for cryptographic usage. return new Random().nextLong(); |