tech.v3.datatype.functional
Simple math primitives.
descriptive-statistics
(descriptive-statistics stats v)
Given a sequence of desired stats return a map of statname->value.
Example:
cljs.user> (dfn/descriptive-statistics [:min :max :mean :n-values] (range 10))
{:min 0, :max 9, :mean 4.5, :n-values 10}
equals
(equals lhs rhs & [error-bar])
Numeric equals - the distance between x,y must be less than error-bar which defaults to 0.001.
percentiles
(percentiles percentages options v)
(percentiles percentages v)
Percentiles are given in whole numbers:
tech.v3.datatype.functional> (percentiles [0 25 50 75 100] (range 10))
[0.0 1.75 4.5 7.25 9.0]
shift
(shift rdr n)
Shift by n and fill in with the first element for n>0 or last element for n<0.
Examples:
user> (dfn/shift (range 10) 2)
[0 0 0 1 2 3 4 5 6 7]
user> (dfn/shift (range 10) -2)
[2 3 4 5 6 7 8 9 9 9]
standard-deviation
(standard-deviation v)
Nan-aware standard-deviation. Nan's will be skipped.