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

Docs not clear on usage of Poisson Object #1564

Closed
Aman-Pandey-afk opened this issue Jun 14, 2022 · 2 comments
Closed

Docs not clear on usage of Poisson Object #1564

Aman-Pandey-afk opened this issue Jun 14, 2022 · 2 comments

Comments

@Aman-Pandey-afk
Copy link

https://github.com/JuliaStats/Distributions.jl/blob/f889f9e56b0243d770c195b3eee8baef4880bd2e/src/univariate/discrete/poisson.jl#L1-L22
Hi, I think the docs should be more clear on the Poisson Object that is generated when Poisson ($\lambda$) is executed. In Python we use numpy.random.poisson and give it an argument to generate an iterable over the Poisson Distribution, but here the function just takes one argument and the returned Poisson object has only one field ( $\lambda$ itself). I later found out that the object can be used as an argument for rand to generate the iterable. A newcomer might get stuck as there is no help regarding the nature of the Poisson Object in Docs.
I think a line like this in the docs might work:
The Poisson Object is of type UnivariateDistribution which can be passed to the rand() function as an argument along with an integer N, to generate an iterable of size N.
I will make a pull request if the issue is considerable.

@devmotion
Copy link
Member

This design is not specific to Poisson but applies to any distribution in Distributions.jl. So I guess it might be better to improve the general documentation if this is unclear than adding a line to the docs of Poisson. There is an example with normal distributions in the "Getting started" section (https://juliastats.org/Distributions.jl/stable/starting/#Starting-With-a-Normal-Distribution) and the use with rand (and other functions) is listed in the section for univariate distributions (https://juliastats.org/Distributions.jl/stable/univariate/). Maybe we should make it even clearer?

@Aman-Pandey-afk
Copy link
Author

Yeah, adding a line to Poisson will not be right, as it applies for all kinds of distributions. Although, in getting started guide it is only explicitly shown for Normal, and in using other distributions, using rand is not mentioned. But I guess it is not that necessary too, one can follow the working of normal if he/she has generating samples in mind. I can close the issue if it is so. I guess the example is clear, just a reference to it being used in all kind of distributions was what I thought, so specifically I asked for Poisson.

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

No branches or pull requests

2 participants