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

2016-10-11 Thread Georgios Moschovitis via swift-users
OK there seem to be some useful ideas in these two examples, let me study them :) Thank you. ___ swift-users mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-users

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

2016-10-10 Thread Nevin Brackett-Rozinsky via swift-users
…and of course I typoed the minus sign when switching things over. That should be: private(set) var minimum: Number = Number.infinity private(set) var maximum: Number = -Number.infinity Nevin On Mon, Oct 10, 2016 at 4:02 PM, Nevin Brackett-Rozinsky < [email protected]> wr

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

2016-10-10 Thread Nevin Brackett-Rozinsky via swift-users
I rolled my own (rather simple) statistics struct. It had been using Double and Array, but I just went back and made it work generically with FloatingPoint and Sequence. Here’s what it looks like: struct Statistic { private var ssqDev: Number = 0 private(set) var count: Number = 0 priv

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

2016-10-10 Thread Harlan Haskins via swift-users
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 wrote: > > >> On Oct 8, 2016, at 11:29 AM, Georgios Moschovitis via swift-users >>

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

2016-10-10 Thread Michael Ilseman via swift-users
> On Oct 8, 2016, at 11:29 AM, Georgios Moschovitis via swift-users > 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.

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

2016-10-10 Thread Georgios Moschovitis via swift-users
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