-
Notifications
You must be signed in to change notification settings - Fork 13
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
Random Number Generation Performance Issues #9
Comments
sorry my mistake, nevermind that comment. but note that the julia code here is very old and almost entirely replaced elsewhere, e.g. StatsFuns.jl |
Perhaps we should get rid of most of the Julia code, if it's not being used? |
that may make sense |
That would be helpful, since I first tracked down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are some issues with how the random number generating procedures are wrapped. To explain, look at how rpois is wrapped:
For reference, using rpois is like this: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Poisson.html
Two things to point out. One is that using a comprehensions gets rid of a lot of potential speedups. For example, it can re-use values if it makes more than 1 random number at a time, and so it should actually pass nn in and do something more as mentioned here. Also, Poisson random numbers should return ints, not Floats. Lastly, you should be able to pass it a p1 which is a vector. Also, to work like other random number algorithms in Julia, it should return a number and not a vector when nn is 1.
I suspect the other random number generating algorithms have similar problems.
The text was updated successfully, but these errors were encountered: