gonum / stat

Statistics package for Go [DEPRECATED]
195 stars 23 forks source link

Median function in `stats` #187

Closed rikonor closed 7 years ago

rikonor commented 7 years ago

Hi,

I was wondering - is there a desire to have a Median([]float64) float64 function in stats? I find myself in need of it and instead of implementing it (which, admittedly, is simple enough) in my code was thinking it'd be nicer to be able to use a standard stats implementation.

I'm happy to open a PR but thought I'd ask before as there may be a reason there isn't one already.

Or

kortschak commented 7 years ago

Does https://godoc.org/gonum.org/v1/gonum/stat#Quantile not work for you?


From: Or Rikon notifications@github.com Sent: Wednesday, July 12, 2017 10:43:42 AM To: gonum/stat Cc: Subscribed Subject: [gonum/stat] Median function in stats (#187)

Hi,

I was wondering - is there a desire to have a Median([]float64) float64 function in stats? I find myself in need of it and instead of implementing it (which, admittedly, is simple enough) in my code was thinking it'd be nicer to be able to use a standard stats implementation.

I'm happy to open a PR but thought I'd ask before as there may be a reason there isn't one already.

Or

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/gonum/stat/issues/187, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAQzFepZcdEbnriWI2Xdp6z8kW-PaZgaks5sNBa-gaJpZM4OU_It.

rikonor commented 7 years ago

@kortschak Yes, I believe it will. I wasn't aware of that function - thanks for pointing it out.

On another note - it would seem to me that the naive way to find a median seems more performant then Quantile.

Closing the issue.

kortschak commented 7 years ago

If it becomes an issue for your user case, please reopen this.