Skip to content

ENH: impl random.logistic #522

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

Merged
merged 1 commit into from
Jan 23, 2021
Merged

Conversation

samir-nasibli
Copy link

@samir-nasibli samir-nasibli commented Jan 22, 2021

Description

logistic([loc, scale, size]) Draw samples from a logistic distribution.

  • disabled (incorrect check for dpnp.random.logistic functionality):
    • random/tests/test_random.py::TestRandomDist::test_logistic - AssertionError: (external)
    • random/tests/test_randomstate.py::TestRandomDist::test_logistic - AssertionError (external)

TODO

  • array_like of floats for loc and scale params
  • tests for backend dpnp_rng_logistic_c (in other PR, after backend/tests/test_random.cpp refactoring)

Reproduce

>>> loc = 2.56
>>> scale = 0.8
>>> np.mean(dpnp.random.logistic(loc, scale, size=10**6)); np.mean(np.random.logistic(loc, scale, size=10**6))
2.5602924600878927
2.5601147009097946
>>> np.var(dpnp.random.logistic(loc, scale, size=10**6)); np.var(np.random.logistic(loc, scale, size=10**6))
2.1036530371566946
2.1000260033560956

Checklist

  • Docstrings for all functions
  • Gallery example in ./doc/examples (new features only)
  • Unit tests:
  • Clean style in the spirit of PEP8

@samir-nasibli samir-nasibli requested a review from shssf January 22, 2021 17:09
@shssf shssf merged commit 50762cd into master Jan 23, 2021
@shssf shssf deleted the samir-nasibli/enh/logisitic_random branch January 23, 2021 00:46
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.

2 participants