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

support gives error on infinite discrete distributions #1919

Closed
mauricelanghinrichs opened this issue Nov 29, 2024 · 2 comments
Closed

support gives error on infinite discrete distributions #1919

mauricelanghinrichs opened this issue Nov 29, 2024 · 2 comments

Comments

@mauricelanghinrichs
Copy link

mauricelanghinrichs commented Nov 29, 2024

I noticed that the support method on the following (maybe more) discrete distributions (countable infinite) cannot be evaluated. Instead an InexactError: Int64(Inf) occurs:

support(Geometric(0.5)) # ERROR
support(Poisson(4)) # ERROR
support(NegativeBinomial(4, 0.5)) # ERROR

While in constrast the following is as expected

support(Binomial(10, 0.5)) # 0:10

Full error for first case:

julia> support(Geometric(0.5))
ERROR: InexactError: Int64(Inf)
Stacktrace:
 [1] Int64
   @ ./float.jl:994 [inlined]
 [2] convert
   @ ./number.jl:7 [inlined]
 [3] _round_convert
   @ ./rounding.jl:480 [inlined]
 [4] round
   @ ./rounding.jl:479 [inlined]
 [5] round(::Type{Int64}, x::Float64)
   @ Base ./rounding.jl:477
 [6] support(d::Geometric{Float64})
   @ Distributions ~/.julia/packages/Distributions/Qeo2J/src/univariates.jl:112
 [7] top-level scope
   @ REPL[2]:1

Versions:

julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 20 × Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, skylake)
Threads: 20 default, 0 interactive, 10 GC (on 20 virtual cores)
Environment:
  JULIA_EDITOR = code

and Distributions v0.25.113.

@devmotion
Copy link
Member

It seems this is a duplicate of #1254

@mauricelanghinrichs
Copy link
Author

yes, sorry did not see that although I searched (briefly). thanks!

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