Closed danieroux closed 5 years ago
c
and s
are count and sum respectively. The arithmetic mean is the sum divided by the count, so (/ s c)
is correct. The test here verifies the implementation against a straightforward equivalent.
It is not computing the sum divided by count:
(kixi/mean [1 2 3]) => 1/2
Ah.
(transduce identity kixi.stats.core/mean [1 2 3]) => 2.0
Thank you.
https://github.com/MastodonC/kixi.stats/blob/15772f411397546964c0a1216d0e5a7d68a3d9f6/src/kixi/stats/core.cljc#L96
That should be
(/ c s)
?