-
Notifications
You must be signed in to change notification settings - Fork 167
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 -- Normal Distribution Module #273
Probability Distribution and Statistical Functions -- Normal Distribution Module #273
Conversation
Hello @Jim-215-Fisher , it's an impressive undertaking what you have here! I just gave the files a quick glance and noticed certain calls to |
Thanks for the point. I will take a look of it. Originally, I was using cval%re and cval%im, but it did not pass the compilation on ubuntu 7,8,9. |
I checked the Fortran 2018 Handbook, it states like this for real(A, [KIND]): |
In that case consider my comment void. I was basing my comment of the comments I read on Fortran Discourse. |
@jvdp1 @awvwgk @gareth-nx , the files have been updated. Especially documentation for complex variable case was changed. |
@jvdp1 @awvwgk @gareth-nx All precision for probability were added according to @gareth-nx . Once this PR is done, I will set up a new PR for uniform distribution to correct similar problems. |
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.
Thankyou! This is a very important contribution to stdlib.
|
||
### Return value | ||
|
||
The result is a scalar or rank one array, with a size of `array_size`, of type `real` or `complex`. |
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.
I suggest also mentioning that the internal computations produce double precision random numbers, so higher precision outputs are simply type-cast from these and will not have full-precision accuracy.
@Jim-215-Fisher @gareth-nx is this PR ready for merging? |
@jvdp1 @Jim-215-Fisher I think it just needs some minor documentation fixes mentioned above (or, a comment about why they are not needed -- I haven't looked in detail since reviewing). I was intending to approve once those points were addressed. |
I think it is ready. |
I don't think we mention precision in documentation though. By default, all precision are supported. |
Ahh, I see. I am getting confused between type and kind in Fortran. So at the moment the documentation indicates the output type, but not the kind, and it is assumed to be implied that all kinds are supported. I think it would be nicer to be more explicit about this. The same point was made in this review comment by @jvdp1 on October 10. @Jim-215-Fisher would you mind to use phrasing like this when describing the output variables? |
done. |
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.
Many thanks!
@jvdp1 This is ready to merge from my view. |
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.
LGTM. Thank you @Jim-215-Fisher for this and to all reviewers. i'll merge it.
This is the second round of probability distribution and statistical functions, continuing from #240. Since the whole modular structure has been changed, each distribution will have its own PR.
This PR contains normal distributions. Files uploaded are:
src/stdlib_stats_distribtuion_normal.fypp
src/CmakeLists.txt
src/Makefile.manual
src/tests/test_distribution_normal.f90
src/tests/CmakeLists.txt
src/tests/Makefile.manual
doc/specs/stdlib_stats_distribution_normal.md
doc/specs/index.md