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

Probability Distribution and Statistical Functions -- Uniform Distribution Module #593

Merged
merged 3 commits into from
Dec 12, 2021

Conversation

Jim-215-Fisher
Copy link
Contributor

This is a minor update version to correct precision issue. Based on the conversation here, we should provide all precision for pdf and cdf functions. Originally, uniform distribution provides only single precision for pdf and cdf.

jim-215-fisher added 2 commits December 11, 2021 00:08

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thank you.

Copy link
Contributor

@gareth-nx gareth-nx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for this!

I noticed some minor issues:

  • In the documentation for pdf_uniform, there is no explanation of what the loc parameter does. I think you just need to say something like: f(x) is zero for x<loc or x > (loc+scale), and otherwise .... (continue to current definition).
  • In the documentation for cdf_uniform, you should also mention that it is zero for x < loc, and one for x > (loc+scale).

I also have a question about MESSENE_NUMBER which is used to normalise the random integers to produce uniform random variables. Currently it is always double precision. Does this reflect that the random number algorithm is fundamentally double precision (like in the case of the normal distribution module). If yes, could you please add a statement in the documentation to that effect? Or, should we have the precision of MESSENE_NUMBER varying with the precision of the inputs?

@Jim-215-Fisher
Copy link
Contributor Author

Thanks very much for this!

I noticed some minor issues:

* In the documentation for `pdf_uniform`, there is no explanation of what the `loc` parameter does. I think you just need to say something like: `f(x)` is zero for `x<loc` or `x > (loc+scale)`, and otherwise .... (continue to current definition).

* In the documentation for `cdf_uniform`, you should also mention that it is zero for `x < loc`, and one for `x > (loc+scale)`.

I also have a question about MESSENE_NUMBER which is used to normalise the random integers to produce uniform random variables. Currently it is always double precision. Does this reflect that the random number algorithm is fundamentally double precision (like in the case of the normal distribution module). If yes, could you please add a statement in the documentation to that effect? Or, should we have the precision of MESSENE_NUMBER varying with the precision of the inputs?

Alright, I will add description for loc in pdf_uniform and cdf_uniform. In terms of MESSENE_NUMBER, yes the algorithm is fundamentally limited to double precision. The paper referred had only studied the double precision case. I will add a note in the specs.

Copy link
Contributor

@gareth-nx gareth-nx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thankyou.

@awvwgk awvwgk merged commit e7f423a into fortran-lang:master Dec 12, 2021
@Jim-215-Fisher Jim-215-Fisher deleted the uniform branch December 12, 2021 22:34
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

4 participants