Distributions.jl
Distributions.jl copied to clipboard
Bad convert for quantile with Poisson
Calling quantile(Poisson(), 1) will return the following error
julia> quantile(Poisson(), 1)
ERROR: InexactError: Int64(Inf)
...
It seems to be because of the following line: https://github.com/JuliaStats/Distributions.jl/blob/586625859ce234cccbc152f00e681e5657f8a56f/src/univariates.jl#L639
I assume the motivation for convert here is that quantile should return values that can be sampled from the distribution of interest and are in its support. However, for discrete distributions with integer-valued support this leads to problems since there is no Inf for integers.
Related: https://github.com/JuliaStats/Distributions.jl/issues/1254