<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Oh yeah, I'd love contributions and feedback! I'm essentially implementing this as I learn things in stats 101 so it's probably woefully inadequate. ðŸ˜…</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">-- Harlan</div><div><br>On Oct 10, 2016, at 1:04 PM, Michael Ilseman &lt;<a href="mailto:milseman@apple.com">milseman@apple.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><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=""><a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></blockquote></body></html>