UNPKG

@stdlib/stats

Version:

Standard library statistical functions.

34 lines (24 loc) 543 B
{{alias}}( a, b ) Returns the entropy of a discrete uniform distribution. If `a > b`, the function returns `NaN`. If `a` or `b` is not an integer value, the function returns `NaN`. Parameters ---------- a: integer Minimum support. b: integer Maximum support. Returns ------- out: number Entropy. Examples -------- > var v = {{alias}}( 0, 1 ) ~0.693 > v = {{alias}}( 4, 12 ) ~2.197 > v = {{alias}}( 2, 8 ) ~1.946 See Also --------