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

Bad convert for quantile with Poisson #1415

Open
theogf opened this issue Nov 2, 2021 · 1 comment
Open

Bad convert for quantile with Poisson #1415

theogf opened this issue Nov 2, 2021 · 1 comment

Comments

@theogf
Copy link
Contributor

theogf commented Nov 2, 2021

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:

$Distributions.quantile(d::$D, q::Real) = convert($T, $(finvcdf)($(pargs...), q))

@devmotion
Copy link
Member

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: #1254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants