-
Notifications
You must be signed in to change notification settings - Fork 416
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
Quantile: use Newton
method from Roots.jl
#1900
base: master
Are you sure you want to change the base?
Conversation
This is what the `quantile_newton()`/`cquantile_newton()` does, because otherwise they were able to end up in an endless loops, when the initial point and the mode are the same, see JuliaStats#666. I'm not sure this is needed here, but the next change is going to refactor them to use general `newton()`, which would make this change anyway, so unless we need the current behaviour, let's do this change explicitly.
Notably
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1900 +/- ##
==========================================
- Coverage 86.08% 86.04% -0.05%
==========================================
Files 144 144
Lines 8696 8684 -12
==========================================
- Hits 7486 7472 -14
- Misses 1210 1212 +2 ☔ View full report in Codecov by Sentry. |
And
|
The problem is (jl_PRakDJ) pkg> why Test
Roots → Accessors → Test
(jl_PRakDJ) pkg> why ChainRulesCore
Roots → ChainRulesCore |
I made a PR to Roots that would fix the ChainRulesCore issue: JuliaMath/Roots.jl#445 |
… the `newton() These have `df(x)=1`, at least that is what the `df(x)` is if we solve `Δ(x)=f(x)/f'(x)` as an equation for `f'(x)`.
Awesome! Now they need to do a release :] |
5a13d02
to
4fe57eb
Compare
In JuliaStats#1900, dependency on Roots.jl is being added, which only supports julia 1.6+
Next issue: Distributions.jl/test/multivariate/dirichlet.jl Lines 137 to 142 in b219803
I suspect it was always there and just not caught by CI because only two jula versions are being tested... |
Looking at the wider picture,
All of these happen in the current master regardless of this PR. |
It is somewhat expected that this highly depends on the Julia versions as some of the ambiguities might disappear due to upstream changes which might not be available in older Julia or package versions (the latest package versions might not be installable on older Julia versions). The last time I checked ambiguity issues were caused by upstream packages, so there's nothing we can do about it (and if users are actually affected by them, they can always update to a newer Julia versions).
I assume the 1.8 errors are also caused by AD tests? I think there's nothing to be worried about these (apart from that it causes CI failures) since such errors often show up when performing AD tests close to the boundary of the domain (perturbations might lead to e.g. negative values or negative values of which we compute If these are the only test failures on older Julia versions, I actually think there are no major problems with these Julia versions. |
I can't tell:
Yes, but what about the CI? Should CI test j1.7 instead of (failing) j1.6? |
Note that we really do need `Roots.jl` 2.2.0-or-newer, because of JuliaMath/Roots.jl#445
From the disscussion in the PR, it is not at all obvious to me what the proper solution here is.
I've looked, and this randomness randomness is a rather known issue: All in all, i've spent more time than i would have wanted, |
I'm not sure if this is waiting on something from my side, in which case that needs to be communicated more clearly. |
In #1899,
i'm trying to address the oscillation problem of Newton method,
which does happen in real-world, non-synthetic distributions.
As per #1899 (comment),
let's first stop reinventing the wheel.