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

simpler example for randn #52252

Merged
merged 11 commits into from
Nov 25, 2023
Merged

simpler example for randn #52252

merged 11 commits into from
Nov 25, 2023

Conversation

lmiq
Copy link
Contributor

@lmiq lmiq commented Nov 21, 2023

As noted here: https://discourse.julialang.org/t/how-do-we-julians-win-big-when-the-situation-is-so-unfair/106433/63?u=lmiq

The randn example is overly complicated and does not indicate the simplest usage, which is probably the most typical one.

lmiq and others added 3 commits November 21, 2023 10:51
As noted by https://discourse.julialang.org/t/how-do-we-julians-win-big-when-the-situation-is-so-unfair/106433/63?u=lmiq the example provided is too complex and does not directly indicate the most typical usage of the `randn` function.
Add simpler example to `randn` function.
@jishnub jishnub added the docs This change adds or pertains to documentation label Nov 21, 2023
@lmiq
Copy link
Contributor Author

lmiq commented Nov 21, 2023

This is how it looks like in the current commit:

image

@ViralBShah ViralBShah added merge me PR is reviewed. Merge when all tests are passing randomness Random number generation and the Random stdlib labels Nov 21, 2023
@lmiq lmiq mentioned this pull request Nov 21, 2023
@stevengj
Copy link
Member

I merged in a few more of my changes, hope you don't mind.

(I also noticed that the docs were out of date on the supported types due to #44714)

@PallHaraldsson
Copy link
Contributor

PallHaraldsson commented Nov 21, 2023

Possibly you want to mention this is the "standard complex normal distribution", which I believe it is, i.e. same as from MATLAB:

https://www.mathworks.com/help/matlab/ref/randn.html#mw_6dadd167-e8bc-42bb-9aaa-9bcfb97f6815

I was expecting circularly symmetric (see that on stack overflow on a question for uniform, and also a square suggested, to show there isn't any one right, as opposed for randn I think).

Note, in MATLAB docs there's still an alternative to that "standard" complex randn (it also show e.g. for how to generate Bivariate Normal Random Numbers). I.e. non-standard I would think. Is there a similar way to use randn?

All this got me thinking what are possible extensions to e.g. quaternions.

https://stackoverflow.com/questions/31600717/how-to-generate-a-random-quaternion-quickly

I'm not saying the docs should say anything on this, since Base doesn't have higher-complex, and such docs belong in relevant packages.

kieranwynn.github.io/pyquaternion/

Python doesn't have randn I think but numpy does, but it doesn't have for complex it seems, I see a closed and open issue:
numpy/numpy#13576

Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
@vtjnash vtjnash merged commit 9c5def5 into JuliaLang:master Nov 25, 2023
7 checks passed
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Nov 27, 2023
mkitti pushed a commit to mkitti/julia that referenced this pull request Dec 9, 2023
As noted here:
https://discourse.julialang.org/t/how-do-we-julians-win-big-when-the-situation-is-so-unfair/106433/63?u=lmiq

The randn example is overly complicated and does not indicate the
simplest usage, which is probably the most typical one.

Co-authored-by: Steven G. Johnson <stevenj@mit.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants