<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Oct 8, 2016, at 11:29 AM, Georgios Moschovitis via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hey everyone,<br class=""><br class="">I would like to implement a few statistics functions in Swift (e.g. variance, standardDeviation, etc) that are computed over a collection.<br class=""><br class="">I am aware of this library:<br class=""><br class=""><a href="https://github.com/evgenyneu/SigmaSwiftStatistics" class="">https://github.com/evgenyneu/SigmaSwiftStatistics</a><br class=""><br class="">My problem is that it only supports Doubles and Arrays. Also the API doesn’t look very ‘swifty' to me.<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div>You might find this library to be more Swifty:&nbsp;<a href="https://github.com/harlanhaskins/Probably" class="">https://github.com/harlanhaskins/Probably</a></div><div><br class=""></div><div>It’s not as generic as possible nor has all the features you might need, but the author is very responsive to feedback.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I am wondering how would someone implement such functionality in a more generic way: to allow usage of multiple collections (even custom, e.g. a RingBuffer) and multiple value types (e.g. Decimal, Double). Extra points for being 'swifty'.<br class=""><br class="">Thanks in advance for any ideas.<br class=""><br class="">-g.</div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>