You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can expect the behaviour of rand(d::Distributions) to change in a way that will ameliorate edge-case numerical instability, e.g. InexactErrors. The origin of these issues as I understand it is the behaviour of Distributions.eltype, which can't always precisely predict the output type of a rand call from the type of the Distribution. This tracks the point made by @devmotion on the PR.
The simplest fix I can think of before (possible) implementation of linked PR is to either
make Safe... Continuous and treat integers as x.0
make Safe...Real valued.
The text was updated successfully, but these errors were encountered:
Not sure; I think we have decisions to make dependent on how JuliaStats/Distributions.jl#1905 ends up and downstream Turing activity around construction variable info e.g. if Turing determines that a particular container for random calls should have Int eltype then we will get errors if promotion to BigInt occurs. This might happen even if eltype(dist) specifies either Int or BigInt because Turing doesn't have to decide the type of the random trace from the eltype(dist) (this has proven to be a problematic feature).
Also, from f2f with @torfjelde its a bit sub-optimal to have Union type eltypes because of the possible effect on compiler branching optimisations; we have that on main as part of the Safe distributions.
tl; dr... I'm not sure and since things are changing elsewhere I've gone a bit "wait and see".
In light of discussion here JuliaStats/Distributions.jl#1905 (comment)
We can expect the behaviour of
rand(d::Distributions)
to change in a way that will ameliorate edge-case numerical instability, e.g.InexactError
s. The origin of these issues as I understand it is the behaviour ofDistributions.eltype
, which can't always precisely predict the output type of arand
call from the type of theDistribution
. This tracks the point made by @devmotion on the PR.The simplest fix I can think of before (possible) implementation of linked PR is to either
Safe...
Continuous and treat integers asx.0
Safe...
Real
valued.The text was updated successfully, but these errors were encountered: