Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "stats/incr/cv/docs/types/index.d"

Index

Type aliases

Functions

Type aliases

accumulator

accumulator: (x?: undefined | number) => number | null

If provided a value, the accumulator function returns an updated accumulated value. If not provided a value, the accumulator function returns the current accumulated value.

Notes

  • If provided NaN or a value which, when used in computations, results in NaN, the accumulated value is NaN for all future invocations.
param

value

returns

accumulated value or null

Type declaration

    • (x?: undefined | number): number | null
    • Parameters

      • Optional x: undefined | number

      Returns number | null

Functions

Export assignment incrcv

  • Returns an accumulator function which incrementally computes the coefficient of variation (CV).

    Parameters

    • Optional mean: undefined | number

      mean value

    Returns accumulator

    accumulator function

    Example

    var accumulator = incrcv();
    
    var cv = accumulator();
    // returns null
    
    cv = accumulator( 2.0 );
    // returns 0.0
    
    cv = accumulator( 1.0 );
    // returns ~0.47
    
    cv = accumulator();
    // returns ~0.47

    Example

    var accumulator = incrcv( 3.14 );