module Numcry::Stats
Overview
Base stats methods.
Extended Modules
Direct including types
Defined in:
numcry/stats.crInstance Method Summary
-
#mean(collection : Enumerable(T)) forall T
Compute the mean for values contained within collection.
-
#std(collection : Enumerable(T), ddof = 0.0) forall T
Compute the standard deviation for values within collection.
-
#var(collection : Enumerable(T), ddof = 0.0) forall T
Compute the variance across values contained in collection.
Instance Method Detail
def mean(collection : Enumerable(T)) forall T
#
Compute the mean for values contained within collection.
mean(1..6) # => 3.5
Compute the standard deviation for values within collection.
std(1..6) # => 1.708
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