[swift-users] Implementing a few statistics functions in Swift

Harlan Haskins harlan at harlanhaskins.com
Mon Oct 10 12:13:26 CDT 2016


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. 😅

-- Harlan

> On Oct 10, 2016, at 1:04 PM, Michael Ilseman <milseman at apple.com> wrote:
> 
> 
>> On Oct 8, 2016, at 11:29 AM, Georgios Moschovitis via swift-users <swift-users at swift.org> wrote:
>> 
>> Hey everyone,
>> 
>> I would like to implement a few statistics functions in Swift (e.g. variance, standardDeviation, etc) that are computed over a collection.
>> 
>> I am aware of this library:
>> 
>> https://github.com/evgenyneu/SigmaSwiftStatistics
>> 
>> My problem is that it only supports Doubles and Arrays. Also the API doesn’t look very ‘swifty' to me.
>> 
> 
> You might find this library to be more Swifty: https://github.com/harlanhaskins/Probably
> 
> It’s not as generic as possible nor has all the features you might need, but the author is very responsive to feedback.
> 
> 
>> 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'.
>> 
>> Thanks in advance for any ideas.
>> 
>> -g.
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161010/a4575f4d/attachment.html>


More information about the swift-users mailing list