-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing types for RNGs #11
Comments
I don't think we want to change Rmath code ourselves. |
This leads to obvious type problems whenever using the StatsFuns RNGs like |
Maybe @tkelman has a comment on whether RMath is planned to stick around with |
That's entirely a function of the amount of work that goes into replacing it. If there's a major performance regression between what worked on 0.4 and how things are currently set up on 0.5 then we can adjust how we build and package things, but I'm the wrong person to ask any other questions here. |
Got it. Wasn't sure if you were in charge of deprecating Rmath or just moving it out of Base (or what entirely is happening there). That's an issue for StatsFuns. Is there a reason why "I don't think we want to change Rmath code ourselves"? The RNGs were already modified to use a different underlying generator of random uniform numbers. Changing the types to be the right kind would make sense as well because "everything is a float" isn't true in Julia, and in this case we have a lot of integers represented as floats. |
There are no instabilities. Rmath (the C library) returns a Cdouble (ie a Float64) and Distributions.jl converts it to an Int. I haven't timed it, but given how complicated the algorithm is, I don't think the overhead will be particularly large. I don't think modifying Rmath code is time well spent, since it's never going to be upstreamed (due to R's inherent design), and then we have the pain of maintaining our own fork. |
The RNG changes are in a separate file (and Rmath was designed to allow for custom RNGs) |
Got it. I was just tracking Poisson generation performance at this example and was wondering if more performance can be gained by this change. But it sounds like it would be a hassle to keep this change when Rmath will keep getting updated. A related question is whether Julia's |
This is related to JuliaStats/Rmath.jl#9. There are a lot of RNG functions which are returning inappropriate types, i.e. floats instead of ints. For example, rpois, rnbinom, rnbinom_mu, rgeom should all be returning ints.
The text was updated successfully, but these errors were encountered: