module Numcry::Stats

Overview

Base stats methods.

Extended Modules

Direct including types

Defined in:

numcry/stats.cr

Instance Method Summary

Instance Method Detail

def mean(collection : Enumerable(T)) forall T #

Compute the mean for values contained within collection.

mean(1..6) # => 3.5

[View source]
def std(collection : Enumerable(T), ddof = 0.0) forall T #

Compute the standard deviation for values within collection.

std(1..6) # => 1.708

[View source]
def 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

[View source]