online-std
Standard deviation calculation (piece-by-piece)
Based on the online Welford's algorithm for variance calculation (see online-variance
package)
Usage
const Std = const s1 = const s2 = // Direct call:;1 2 3 4 5// or via .fit();1 2 3 4 5 console // ~> 1.41421 1.41421
Population vs Sample std
Use a parameter ddof: 1
to calculate sample standard deviation
const s3 = // Delta degrees of freedom. The divisor used in calculations (N - ddof), where N - number of elements;1 2 3 4 5 console // ~> 1.58114