Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Type aliases

Functions

Type aliases

accumulator

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

If provided a value, the accumulator function returns updated minimum and maximum absolute values. If not provided a value, the accumulator function returns the current minimum and maximum absolute values.

Notes

  • If provided NaN, the minimum and maximum absolute values are equal to NaN for all future invocations.
param

input value

returns

output array or null

Type declaration

    • (x?: undefined | number): ArrayLike<number> | null
    • Parameters

      • Optional x: undefined | number

      Returns ArrayLike < number > | null

Functions

Export assignment incrmminmaxabs

  • Returns an accumulator function which incrementally computes moving minimum and maximum absolute values.

    Notes

    • The W parameter defines the number of values over which to compute moving minimum and maximum absolute values.
    • As W values are needed to fill the window buffer, the first W-1 returned minimum and maximum values are calculated from smaller sample sizes. Until the window is full, each returned minimum and maximum is calculated from all provided values.
    throws

    window size must be a positive integer

    Parameters

    • out: ArrayLike<number>

      output array

    • window: number

      window size

    Returns accumulator

    accumulator function

    Example

    var accumulator = incrmminmaxabs( 3 );
    
    var mm = accumulator();
    // returns null
    
    mm = accumulator( 2.0 );
    // returns [ 2.0, 2.0 ]
    
    mm = accumulator( -5.0 );
    // returns [ 2.0, 5.0 ]
    
    mm = accumulator( 3.0 );
    // returns [ 2.0, 5.0 ]
    
    mm = accumulator( 5.0 );
    // returns [ 3.0, 5.0 ]
    
    mm = accumulator();
    // returns [ 3.0, 5.0 ]
  • Returns an accumulator function which incrementally computes moving minimum and maximum absolute values.

    Notes

    • The W parameter defines the number of values over which to compute moving minimum and maximum absolute values.
    • As W values are needed to fill the window buffer, the first W-1 returned minimum and maximum values are calculated from smaller sample sizes. Until the window is full, each returned minimum and maximum is calculated from all provided values.
    throws

    window size must be a positive integer

    Parameters

    • window: number

      window size

    Returns accumulator

    accumulator function

    Example

    var accumulator = incrmminmaxabs( 3 );
    
    var mm = accumulator();
    // returns null
    
    mm = accumulator( 2.0 );
    // returns [ 2.0, 2.0 ]
    
    mm = accumulator( -5.0 );
    // returns [ 2.0, 5.0 ]
    
    mm = accumulator( 3.0 );
    // returns [ 2.0, 5.0 ]
    
    mm = accumulator( 5.0 );
    // returns [ 3.0, 5.0 ]
    
    mm = accumulator();
    // returns [ 3.0, 5.0 ]