#Statistics libraries for Zig?

1 messages · Page 1 of 1 (latest)

latent stump
#

Looking for a library that implements various statistics functions, like standard deviation calculation, medians, quantiles, etc.

mystic acorn
#

I'm not sure if this exists, mostly because these are pretty easy functions to implement yourself, and there are many, many possible ways to store your data

#

So a library wouldn't be able to cover all the possible datastructures you might want to operate on

latent stump
#

Figured, I searched around but couldn't find anything. You're not wrong but sometimes it's nice not having to reinvent the wheel 😄

#

I was only considering operating on simple f64 slices, but you're right that that's not always the case.

mystic acorn
#

You could go far by abstracting over an iterator with a next function, but that still probably wouldn't cover everything, and it's just a bit cumbersome

hollow vessel
#

i think median can get somewhat involved, there are special algorithms for that

mystic acorn
#

and tbh these functions are like, less than 5 lines each

mystic acorn
hollow vessel
mystic acorn
#

oh, interesting

hollow vessel
mystic acorn
#

why are c++ people like this

#

it was a pretty nice looking function like half way through, then it all went to hell lmao

#

neat alg tho, though I'm pretty sure you can do better than introselect (also apparently C++'s "introselect" is actually normally not introselect??? weird)

#

Might have a play around

mystic acorn
#

having thought a bit more and realised I am very silly, introselect probably is the best way to do this yeah :)

#

would be a nice alg to have added to std.sort

ocean hearth
hollow vessel