This function calculates the Shannon entropy of a forward range that is treated as frequency counts of a set of discrete observations.
double uniform3 = entropyCounts([4, 4, 4]); assert(approxEqual(uniform3, log2(3))); double uniform4 = entropyCounts([5, 5, 5, 5]); assert(approxEqual(uniform4, 2));
See Implementation
This function calculates the Shannon entropy of a forward range that is treated as frequency counts of a set of discrete observations.