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
DOC: stats.truncnorm: add example about truncation points #18477
Conversation
@YoussefAli1 since this is a doc-only PR, please include This change may be helpful, but since this issue keeps coming up, I'm not sure if this slight rewording (while helpful) is enough. In gh-18316, I suggested an example. Can you add something like that to this PR? |
Hi @mdhaber, first off, thanks for the clarifying how I should structure my commits. Also, after rereading my edit, I think you’re right in that it’s too small of a change. I will word it better, keeping the example you posted in the thread in mind. |
Hi @mdhaber, I've edited the notes and added some code examples of the function's workings with explanatory text, similar to the one you posted in the thread you linked. If these are acceptable, I'll resubmit these edits for a pull request. class truncnorm_gen(rv_continuous):
|
Look at the current documentation of We would not want to replace that example entirely but extend it. Your new text should go after this line. It would be better to use a different value for I would suggest beginning with a bridge between the examples that are already there and the example you are adding. Something like:
(make the histogram again with those values) Continue by explaining why the truncation points appear to have changed and how to interpret them. Finish by showing how we can make the truncation points actually be Please go ahead and try that, then push the changes here. (Actually, before you make another commit, please merge upstream/main. E.g. check out your branch, |
Since CircleCI is not working, can someone build the documentation locally and post a screenshot? |
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.
Technically, the parameter names should have single backticks, but that's not how the rest of this documentation was before, so let's just be consistent.
[skip ci]
Reference issue
Attempted to solve the documentation problem outlined in issue #18316. The author of this thread was confused on the functionality of scipy.stats.truncnorm.rvs(), and thought that the a, b arguments represented raw values at which the normal distribution is to be cut off, whereas these arguments actually represented the number of standard deviations below and above the mean value at which the distribution is to be truncated.
What does this implement/fix?
Attempted to clarify the documentation to better communicate the purpose of these arguments and forgo any confusion.
Additional information
This is my first open-source contribution. Please let me know how I can better help your project!