Loading

reducer.shannonentropy.0


reducer
Since v1.0.11
Available on all platforms
See also

The reducer.shannonentropy.0 computes the Shannon entropy of the values it receives from the framework REDUCE at each tick.

The values are considerred as occurences of an underlying symbol (or as values of a counter).

The returned entropy is normalized by being divided by log(N) where N is the number of values.

If N equals 1, then 0 is returned.

The input values must be of type LONG.

Signature

Examples

[ 1 3 <% 'j' STORE NEWGTS 0 10 <% 'i' STORE $i $j * 100 * NaN NaN NaN $i ADDVALUE %> FOR $j TOSTRING RENAME %> FOR ] [ SWAP [] reducer.shannonentropy.0 ] REDUCE