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
For rather exotic instances of a MixtureModel the quantile() method fails. The underlying reason is that the initial bisection interval (in quantile_bisect()) does not contain the solution. However, both ends of the interval are very close to the solution. The current implementation of quantile_bisect() checks for equality of the start and end of the interval. Changing this to approximately equal would fix this bug.
Example
using Distributions
d =MixtureModel([Normal(0, 1), Normal(eps(), 1)], [0.999, 0.001])
quantile(d, 0.001)
to if rx ≈ lx seems to do the trick. I'm not sure whether this has bad side effects. However, after this change all tests in Distributions.jl still succeed.
An appropriate new test case to catch this bug would be
The problem
For rather exotic instances of a
MixtureModel
thequantile()
method fails. The underlying reason is that the initial bisection interval (inquantile_bisect()
) does not contain the solution. However, both ends of the interval are very close to the solution. The current implementation ofquantile_bisect()
checks for equality of the start and end of the interval. Changing this to approximately equal would fix this bug.Example
gives as output
I'm currently using
and Distributions v0.25.109.
The solution(?)
Changing line 8 of quantilealgs.jl
Distributions.jl/src/quantilealgs.jl
Line 8 in b356da0
to
if rx ≈ lx
seems to do the trick. I'm not sure whether this has bad side effects. However, after this change all tests in Distributions.jl still succeed.An appropriate new test case to catch this bug would be
I can submit this as a pull request if desired (would need to figure out how to do that).
The text was updated successfully, but these errors were encountered: