Class: StatCounter

eclairjs/util. StatCounter

A class for tracking the statistics of a set of numbers (count, mean and variance) in a numerically robust way. Includes support for merging two StatCounters. Based on Welford and Chan's [[http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance algorithms]] for running variance.

Constructor

new StatCounter()

Source:

Methods

(static) apply(…values) → {module:eclairjs/util.StatCounter}

Build a StatCounter from a list of values passed as variable-length arguments.
Parameters:
Name Type Attributes Description
values number <repeatable>
Source:
Returns:
Type
module:eclairjs/util.StatCounter

copy() → {module:eclairjs/util.StatCounter}

Clone this StatCounter
Source:
Returns:
Type
module:eclairjs/util.StatCounter

count() → {integer}

Source:
Returns:
Type
integer

max() → {number}

Source:
Returns:
Type
number

mean() → {number}

Source:
Returns:
Type
number

merge(value) → {module:eclairjs/util.StatCounter}

Add a value into this StatCounter, updating the internal statistics.
Parameters:
Name Type Description
value float | module:eclairjs/util.StatCounter
Source:
Returns:
Type
module:eclairjs/util.StatCounter

min() → {number}

Source:
Returns:
Type
number

sampleStdev() → {number}

Return the sample standard deviation of the values, which corrects for bias in estimating the variance by dividing by N-1 instead of N.
Source:
Returns:
Type
number

sampleVariance() → {number}

Return the sample variance, which corrects for bias in estimating the variance by dividing by N-1 instead of N.
Source:
Returns:
Type
number

stdev() → {number}

Return the standard deviation of the values.
Source:
Returns:
Type
number

sum() → {number}

Source:
Returns:
Type
number

toString() → {string}

Source:
Returns:
Type
string

variance() → {number}

Return the variance of the values.
Source:
Returns:
Type
number