Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Type aliases

Functions

Type aliases

accumulator

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

If provided a value, returns an updated sum of squared absolute values; otherwise, returns the current sum of squared absolute values.

param

value

returns

sum of squared absolute values

Type declaration

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

      • Optional x: undefined | number

      Returns number | null

Functions

Export assignment incrnansumabs2

  • Returns an accumulator function which incrementally computes a sum of squared absolute values, ignoring NaN values.

    Returns accumulator

    accumulator function

    Example

    var accumulator = incrnansumabs2();
    
    var v = accumulator();
    // returns null
    
    v = accumulator( 2.0 );
    // returns 4.0
    
    v = accumulator( NaN );
    // returns 4.0
    
    v = accumulator( -3.0 );
    // returns 13.0
    
    v = accumulator( -4.0 );
    // returns 29.0
    
    v = accumulator();
    // returns 29.0