module Stats
Overview
Core module containing common statistics methods
Extended Modules
Defined in:
stats.crInstance Method Summary
-
#mean(input : Array(Int | Float32 | Float64)) : Float64
Returns a
Float64averaged value from a givenArray(Int | Float32 | Float64) -
#median(input : Array(Int | Float32 | Float64)) : Float64
Returns a
Float64median value from a givenArray(Int | Float32 | Float64) -
#mode(input : Array(Int | Float32 | Float64)) : Float64
Returns the most frequent value as a
Float64from a givenArray(Int | Float32 | Float64)
Instance Method Detail
def mean(input : Array(Int | Float32 | Float64)) : Float64
#
Returns a Float64 averaged value from a given Array(Int | Float32 | Float64)
Stats.mean [1,2,3,4] # => 2.5
def median(input : Array(Int | Float32 | Float64)) : Float64
#
Returns a Float64 median value from a given Array(Int | Float32 | Float64)
Stats.median [1,3,8,9] # => 5.5
def mode(input : Array(Int | Float32 | Float64)) : Float64
#
Returns the most frequent value as a Float64 from a given Array(Int | Float32 | Float64)
Stats.mode [1,3,8,9,3] # => 3.0
TODO Use generics to return value cast to original type
TODO Return multiple results on case of draw