Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "stats/incr/mmeanstdev/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 an updated moving arithmetic mean and corrected sample standard deviation. If not provided a value, the accumulator function returns the current moving arithmetic mean and corrected sample standard deviation.

Notes

  • If provided NaN, the moving arithmetic mean and corrected sample standard deviation 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 incrmmeanstdev

  • Returns an accumulator function which incrementally computes a moving arithmetic mean and corrected sample standard deviation.

    Notes

    • The W parameter defines the number of values over which to compute the moving arithmetic mean and corrected sample standard deviation.
    • As W values are needed to fill the window buffer, the first W-1 returned moving arithmetic mean and corrected sample standard deviation are calculated from smaller sample sizes. Until the window is full, each returned moving arithmetic mean and corrected sample standard deviation 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 Float64Array = require( `@stdlib/array/float64` );
    
    var accumulator = incrmmeanstdev( new Float64Array( 2 ), 3 );
    
    var mm = accumulator();
    // returns null
  • Returns an accumulator function which incrementally computes a moving arithmetic mean and corrected sample standard deviation.

    Notes

    • The W parameter defines the number of values over which to compute the moving arithmetic mean and corrected sample standard deviation.
    • As W values are needed to fill the window buffer, the first W-1 returned moving arithmetic mean and corrected sample standard deviation are calculated from smaller sample sizes. Until the window is full, each returned moving arithmetic mean and corrected sample standard deviation 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 = incrmmeanstdev( 3 );
    
    var v = accumulator();
    // returns null
    
    v = accumulator( 2.0 );
    // returns [ 2.0, 0.0 ]
    
    v = accumulator( -5.0 );
    // returns [ -1.5, ~4.95 ]
    
    v = accumulator( 3.0 );
    // returns [ 0.0, ~4.36 ]
    
    v = accumulator( 5.0 );
    // returns [ 1.0, ~5.29 ]
    
    v = accumulator();
    // returns [ 1.0, ~5.29 ]