module

Numcry::Stats

Base stats methods.

Instance methods

mean(collection : Enumerable(T)) forall T

Compute the mean for values contained within collection.

mean(1..6) # => 3.5
Source
std(collection : Enumerable(T), ddof = 0.0) forall T

Compute the standard deviation for values within collection.

std(1..6) # => 1.708
Source
var(collection : Enumerable(T), ddof = 0.0) forall T

Compute the variance across values contained in collection.

Default normalisation (N) is applied such that this may be used directly on collections representing the full population. When working with a sample, ddof may be used to specify a delta degrees of freedom and correct bias.

var(1..6) # => 2.917
Source