-
Notifications
You must be signed in to change notification settings - Fork 415
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
eltype and rand with Univariate/Continuous distributions #894
Labels
Comments
yes it's indeed a legacy issue we are trying to erase one step at a time. See #882 for instance. The Univariate case should be easy to fix, there is this generic fallback in commons.jl, but you can specialize it for all distributions, so for example:
|
PR very welcome on that :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure how much more endemic this issue is (I've only tested with a Normal distribution), but here are a couple examples of counter-intuitive (and presumably wrong) behavior.
If I have a distribution (eg. normal), I would expect the output from sampling to match the types parameterizing the distribution.
In the case of a Normal dist., that could be fixed with this patch:
But the following example would still produce
Float64
:because
and
Presumably the second issue would affect most/all Univariate distributions, however, I am not sure how typical of an example the code for the
Normal
dist. is as far as the type signature and returned type. (Unfortunately I have neither the familiarity with the Distributions.jl source nor the time to do a more thorough investigation and/or make a PR.)Unrelated to the main issue, I also wonder (again, not being familiar with the code) whether in the second example the
sampler(s)
is necessary (and/or a no-op) givens::Sampleable
.The text was updated successfully, but these errors were encountered: