-
Notifications
You must be signed in to change notification settings - Fork 97
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
gama_inc_inv fails for valid arguments #403
Comments
Isn't this a duplicate of #390? I assume the problem here is the same as the one described by @andreasnoack in #390 (comment): The algorithm takes a step that leads to slightly negative values. It seems a possible fix would be to translate Amparo Gil's Fortran code: #390 (comment) |
Oh shoot, it is a duplicate. It's been a while since I tested the code that used this; it progressed further than I remembered, but it got hung up whenever this particular case came about. Now that I see this is a newton step, do you think a box constraint on the step would be appropriate? When doing univariate Newton steps, I typically limit the step size to be
There's a bit of overhead but I don't think it's a lot (very small values of ϵ increase convergence but you have to tune it to be safe, but the (0,Inf) shortcut is more forgiving as it's less prone to round-off error). Otherwise, I see your changes help mitigate the round-off error that happens (thanks for putting it in terms of Δx, it makes it more obvious this is a Newton step). |
While using quantile(d::Gamma, q::Real) I ran into an error from gamma_inc_inv with the following inputs
this is such a small number, it's BARELY negative, so it looks like some sort of round-off error in an internal iteration surrounding gamma_inc.jl:1048. I see there's an
abs(x)
expression on line 1086,SpecialFunctions.jl/src/gamma_inc.jl
Line 1086 in 49be7e6
would it be safe to stick one on line 1088 as well?
SpecialFunctions.jl/src/gamma_inc.jl
Line 1088 in 49be7e6
The text was updated successfully, but these errors were encountered: