Re: Statistics primitives ("Elusive Eight")
Lassi Kortela 16 Mar 2024 14:36 UTC
> Racket's math library has been designed by a statistician, IIRC, and
> these functions are included (and much much more)
> Should be even easier to port to scheme than C.
Thanks.
The mathematician in question is Neil Toronto:
https://www.cs.umd.edu/~ntoronto/. (A very well explained research
agenda BTW.)
The libraries are here: https://docs.racket-lang.org/math/
It would be ideal to use the Racket names of the functions in Scheme
instead of the cryptic C names from Cephes. However, at a glance, the
correspondence is not 1:1 and I'm not positive every function is covered.
I put together a quick proof of concept here:
https://github.com/pre-srfi/statistics8
That repo has the requisite Cephes files and a Gambit FFI wrapper. I was
able to compile the wrapper and play with it from the REPL. It was easy.
Equivalent wrappers can surely be made for other implementations since
the functions merely pass "double" values.
I may play around with these later to code some formulas in Scheme and
plot them unless someone beats me to it. Feel free to send PRs to that repo.