Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Interfaces

Type aliases

Functions

Type aliases

accumulator

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

If provided a value, the accumulator function returns an updated summary; otherwise, the accumulator function returns the current summary.

Notes

  • The returned summary is an object containing the following fields:

    • window: window size.
    • max: maximum value.
    • min: minimum value.
    • range: range.
    • midrange: mid-range.
    • sum: sum.
    • mean: arithmetic mean.
    • variance: unbiased sample variance.
    • stdev: corrected sample standard deviation.
    • skewness: corrected sample skewness.
    • kurtosis: corrected sample excess kurtosis.
param

value

returns

updated summary

Type declaration

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

      • Optional x: undefined | number

      Returns Summary | null

Functions

Export assignment incrmsummary

  • Returns an accumulator function which incrementally computes a moving statistical summary.

    Notes

    • The W parameter defines the number of values over which to compute the moving statistical summary.
    • If provided a value, the accumulator function returns an updated moving statistical summary. If not provided a value, the accumulator function returns the current moving statistical summary.
    • As W values are needed to fill the window buffer, the first W-1 returned summaries are calculated from smaller sample sizes. Until the window is full, each returned summary is calculated from all provided values.
    throws

    must provide a positive integer

    Parameters

    • W: number

      window size

    Returns accumulator

    accumulator function

    Example

    var accumulator = incrmsummary( 3 );
    
    var summary = accumulator();
    // returns {}
    
    summary = accumulator( 2.0 );
    // returns {...}
    
    summary = accumulator( -5.0 );
    // returns {...}
    
    summary = accumulator();
    // returns {...}