empirical-soft / empirical-lang

A language for time-series analysis
https://www.empirical-soft.com/
Other
168 stars 13 forks source link

Simple stats functions #97

Closed chrisaycock closed 4 years ago

chrisaycock commented 4 years ago

We'll need bigger aggregation routines to test the state management in streaming (#57).

>>> mean([1, 2, 3])
2.0

>>> mean([1, 2, nil])
1.5

>>> variance([1, 2 ,3])
0.6666667

>>> variance([1, 2, nil])
0.25

>>> stddev([1, 2, 3])
0.8164966

>>> stddev([1, 2, nil])
0.5