Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "stats/base/dists/discrete-uniform/entropy/docs/types/index.d"

Index

Functions

Functions

entropy

  • entropy(a: number, b: number): number
  • Returns the entropy of a discrete uniform distribution.

    Notes

    • If a or b is not an integer value, the function returns NaN.
    • If provided a >= b, the function returns NaN.

    Parameters

    • a: number

      minimum support

    • b: number

      maximum support

    Returns number

    entropy

    Example

    var v = entropy( 0, 1 );
    // returns ~0.693

    Example

    var v = entropy( 4, 12 );
    // returns ~2.197

    Example

    var v = entropy( -4, 4 );
    // returns ~2.197

    Example

    var v = entropy( 1, 2.5 );
    // returns NaN

    Example

    var v = entropy( -0.1, 1 );
    // returns NaN

    Example

    var v = entropy( 2, NaN );
    // returns NaN

    Example

    var v = entropy( NaN, 2 );
    // returns NaN