faast.js

faast.js

  • Docs
  • API
  • Community
  • GitHub
  • Blog

faastjs > Statistics

Statistics class

Incrementally updated statistics on a set of values.

Signature:

export declare class Statistics 

Constructors

Constructor

Modifiers

Description

(constructor)(printFixedPrecision)

Incrementally track mean, stdev, min, max, of a sequence of values.

Properties

Property

Modifiers

Type

Description

max

number

The maximum value observed. Initialized to Number.NEGATIVE_INFINITY.

mean

number

The mean (average) of the values observed.

min

number

The minimum value observed. Initialized to Number.POSITIVE_INFINITY.

printFixedPrecision

protected

number

The number of decimal places to print in Statistics.toString()

samples

number

Number of values observed.

stdev

number

The standard deviation of the values observed.

variance

number

The variance of the values observed.

Methods

Method

Modifiers

Description

toString()

Print the mean of the observations seen, with the precision specified in the constructor.

update(value)

Update statistics with a new value in the sequence.

  • Statistics class
  • Constructors
  • Properties
  • Methods
faast.js
Docs
IntroductionAPI ReferenceContributingExamples
Community
DiscordTwitterStack Overflow
More
BlogUser Showcase
Copyright © 2025 Andy Chou