-
Notifications
You must be signed in to change notification settings - Fork 432
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
CHANGE: The name distributions::Standard
is misleading
#1297
Comments
Shame the doc link pictured above didn't work, because the docs do explain. The "standard normal" is just a common (default) parameterisation of the Normal distribution so it shouldn't be confusing. But search engines being what they are, I can see why "standard distribution" finds the "standard normal distribution". I guess it could be renamed to |
Another possibility is to replace it with more specific distributions. Maybe a
FP (
Tuples, arrays: again, these could be generated via an adapter. AdaptersThis is where things get problematic... We could view a closure as an adapter of sorts (play): let unif11 = Uniform::new(-1.0, 1.0).unwrap();
let x = rng.sample_closure(move |rng| if rng.gen_bool(0.5) {
rng.sample(&unif11)
} else {
f64::NAN
}); Nice, but:
We could cheat and use |
@vks any thoughts on this? I'm tempted not to make any changes: it's significant breakage and most users appear to get on fine with the current design. |
I'm also not very happy with the unspecific name
I think it's always a uniform distribution in practice (at least in Rand, and probably 3rd party impls as well). I'm also not sure it's worth the churn, but maybe lets look at how much breakage this would cause:
|
Is an
Same, and I might only consider them useful for something like fuzz-testing, where a uniform distribution may not even be the best choice. Especially for floats. But "garbage in, garbage out" kind of applies here: without contracts on input/output validity (e.g. ranges), fuzz-testing can't really tell you anything useful anyway. It appears that The real argument for keeping
And you even forgot that the module name is plural, like |
Closing: no change. There remains the option of renaming to
|
I'm ok with this because I already learn the lesson. But I still think |
|
my concern is that this distribution is actually not "standard". i dont think there is a standard for random distributions. i agree with your concern. it can be hard to find a suitable name for this. |
How about |
I think To justify the churn of renaming I could live with |
I'd like to add that "Standard" is misleading not just because of search engines. "Standard deviation" is a common term, and it's often considered in relation to the normal distribution. |
All in favour of one of the following, vote with an emoji:
|
@purplesyringa "Standard deviation" is not unique to the normal distribution. In fact, most (all?) distributions in Rand have one. |
Cauchy does not have one ;) |
Summary
To address this issue, either api-breaking changes or docs update may happen.
Details & Motivation
I would like to provide some feedback regarding the
distributions::Standard
. I believe that the name of this feature is misleading and can be confusing for users.I came across this feature when I use
rng.gen()
, andStandard
is the default distribution. I'm not sure what it is, so I search it online...When searching for the term "Standard Distribution" online, users are very likely to come across information about the standard normal distribution, which can lead to misunderstandings. Furthermore, this name is not commonly used in other contexts, making it difficult for users to understand what it refers to.
I would like to suggest that consider changing the name of this feature or provide clear warnings to users that it should not be confused with the standard normal distribution. This would greatly improve the usability and clarity of this library.
The text was updated successfully, but these errors were encountered: