Distributions.jl icon indicating copy to clipboard operation
Distributions.jl copied to clipboard

Bad convert for quantile with Poisson

Open theogf opened this issue 4 years ago • 1 comments

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

theogf avatar Nov 02 '21 15:11 theogf

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

devmotion avatar Nov 02 '21 15:11 devmotion