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

document Random samplers: continuation of #31787 #31990

Merged
merged 4 commits into from
May 12, 2019

Conversation

tpapp
Copy link
Contributor

@tpapp tpapp commented May 10, 2019

Also fix the overlooked issues in the discussion of #31787.

In addition, incidental clarifications and typo fixes.

@rfourquet

@tpapp tpapp mentioned this pull request May 10, 2019
Copy link
Member

@rfourquet rfourquet left a comment

Choose a reason for hiding this comment

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

Thanks you for the updates, they look good, we are almost there now!

stdlib/Random/docs/src/index.md Outdated Show resolved Hide resolved
stdlib/Random/docs/src/index.md Show resolved Hide resolved
stdlib/Random/docs/src/index.md Outdated Show resolved Hide resolved
@rfourquet rfourquet changed the title Tp/remaining fixes 31787 remaining fixes #31787 May 11, 2019
@rfourquet rfourquet added domain:randomness Random number generation and the Random stdlib domain:docs This change adds or pertains to documentation labels May 11, 2019
@@ -84,13 +84,20 @@ Generating random values for some distributions may involve various trade-offs.

The `Random` module defines a customizable framework for obtaining random values that can address these issues. Each invocation of `rand` generates a *sampler* which can be customized with the above trade-offs in mind, by adding methods to `Sampler`, which in turn can dispatch on the random number generator, the object that characterizes the distribution, and a suggestion for the number of repetitions. Currently, for the latter, `Val{1}` (for a single sample) and `Val{Inf}` (for an arbitrary number) are used, with `Random.Repetition` an alias for both.

The object returned by `Sampler` is then used to generate the random values, by a method of `rand` defined for this purpose. Samplers can be arbitrary values, but for most applications the following predefined samplers may be sufficient:
The object returned by `Sampler` is then used to generate the random values. When implementing the random generation interface for a value `X::T` that can be sampled from, the implementor should define the method

Copy link
Member

Choose a reason for hiding this comment

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

in X::T, the T is not used later right? then you could remove it (only if you push again to this branch for other reasons before we merge, no need to re-trigger CI only for this).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see no other outstanding changes, so I pushed a commit with this one. I am hoping the PR can be accepted now.

@rfourquet rfourquet mentioned this pull request May 12, 2019
2 tasks
@rfourquet rfourquet merged commit 8932ccd into JuliaLang:master May 12, 2019
@rfourquet rfourquet changed the title remaining fixes #31787 document Random samplers: continuation of #31787 May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation domain:randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants