-
Notifications
You must be signed in to change notification settings - Fork 21
ENH: added random.gamma
#170
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #170 +/- ##
==========================================
- Coverage 52.36% 0.00% -52.37%
==========================================
Files 20 20
Lines 1352 1368 +16
Branches 384 392 +8
==========================================
- Hits 708 0 -708
- Misses 357 1368 +1011
+ Partials 287 0 -287
Continue to review full report at Codecov.
|
Need to be redesigned, because supported devices are Host and CPU. https://software.intel.com/content/www/us/en/develop/documentation/oneapi-mkl-dpcpp-developer-reference/top/random-number-generators/distributions/oneapi-mkl-rng-gamma.html |
Something is amiss. Basic moments do not match:
|
@oleksandr-pavlyk Thank you for the report. I fixed it. >>> np.var(np.random.gamma(shape=2.56, scale=0.8, size=10**6))
1.6414887360289188
>>> np.mean(np.random.gamma(shape=2.56, scale=0.8, size=10**6))
2.0480613902279794
>>> np.var(dpnp.random.gamma(shape=2.56, scale=0.8, size=10**6))
1.6337041157687837
>>> np.mean(dpnp.random.gamma(shape=2.56, scale=0.8, size=10**6))
2.049404203568917 @oleksandr-pavlyk You set a great example to test. Is it worth checking the basic moments based on this sample? I can add test suit. |
Expectations of bounded functions, or moments for light-tailed distributions is appropriate. An appropriate check is that sample expectation is within several numbers (say 5) of standard deviations of the estimator from its mean. The mean needs to be known analytically, while the standard deviation may be estimated from the sample |
Having built
I was expecting It would greatly enhance user's experience if these C++ exceptions where intercepted and rethrown as Python exceptions. |
Random number generation is not honoring @shssf I think this is a problem. |
Added issue #201 for this. Will be fixed in other PR |
|
AttributeError: type object 'dpnp.dparray' has no attribute 'zeros'. |
Fill works.
you could simply write
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further changes must be done outside of this PR.
Description
gamma(shape[, scale, size]) Draw samples from a Gamma distribution.
TODO:
scale
andshape
paramsChecklist