Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That stuff is actually the easy stuff. If you write standard Julia code for those kinds of algorithms you'll hit C or Fortran speeds your first time if you know what you're doing. Lower levels kernels like BLAS have a lot of cache optimizations with how they do things like blocking, so it took awhile for things like StaticArrays to be used in a way to recreate what's going on there. There is still some work needed on mutable stack allocated buffers in order to handle to optimize more of the cache handling but it is quite close now!


If it's so easy can you show me an example code for it? The speed doesn't matter, it's the algorithm that's important. Please make sure that you handle all the numerical instabilities, and show me the Julia code for binomial and trinomial normal CDF computation that is not using integration, but a fast, correct and precise approximation.


Did you not look at StatFuns.jl? Bivariate is here: https://github.com/JuliaStats/StatsFuns.jl/blob/e21bc26b1773... . For trivariate you'd just do the same kind of translation process if you have a Fortran code which has an appropriate license of course. If you have an example of a Fortran file for trivariate, we can open an issue on StatFuns.jl and get an undergrad via Google Summer of Code to translate it over, or implement from scratch from a paper's description.

The reason why this kind of code is easy to translate is because there is a direct mapping of language features (difficult to translate code is code that uses unique language structures). The only real difficulty of mapping (non-object oriented non-distributed) Fortran into a higher level language is keeping the speed.


It's cool, thank you very much!

I was looking at Distributions.jl when I was searching for it, but didn't find it there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: