Skip to content
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

fix typo: statrs::distribution::Gamma sample_unchecked #132

Merged
merged 1 commit into from Apr 25, 2021

Conversation

doraneko94
Copy link
Contributor

I might find a mistake of sign in the random value generation function in statrs::distribution::Gamma.
Please refer to another implementation of "Marsaglia and Tsang’s Method", for example

https://gist.github.com/fasiha/f289c1d4b9c244a42abee54d1d6206ed

or

https://www.hongliangjie.com/2012/12/19/how-to-generate-gamma-random-variables/

@vks
Copy link
Contributor

vks commented Apr 12, 2021

For what it's worth, the sign proposed in this PR is the one that the Rand implementation used until we switched to a different algorithm.

@boxtown Does it make sense for statrs to use sampling algorithms in rand_distr?

@troublescooter troublescooter merged commit 8e51645 into statrs-dev:master Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants