Skip to content

Don't require the error estimate to be small relative to the value - #88

Merged
dweindl merged 1 commit into
mainfrom
converged-absolute-precision
Oct 26, 2026
Merged

dweindl merged 1 commit into
mainfrom
converged-absolute-precision

Conversation

@dweindl

@dweindl dweindl commented Oct 21, 2026

Copy link
Copy Markdown
Member

A direction was classified converged only if its error estimate was also at most half the absolute value. For a derivative that is zero or close to it, this fails even when the error estimate is far below the tolerance. Such directions were reported as noise_dominated, and gradient checks were inconclusive for them. However, value ± error_estimate still bounds the derivative's magnitude, which is all a gradient check needs: a wrongly nonzero analytical derivative is caught.

Now converged only requires the error estimate to be within the (default or user-supplied) tolerance. Whether the value is distinguishable from zero (i.e. whether its sign and relative size mean anything) is available as the new DerivativeEstimate.resolved (|value| > 2 * error_estimate). This also removes status flips between runs for directions with |value| ≈ 2 * error_estimate.

The notebook's "Solution 4" is updated accordingly. Its example (true derivative 9.2e-9, estimate 4.5e-6 ± 1.9e-5) is now converged and not resolved; the true value is well within the error bar.

Evaluated by replaying the AMICI SBML semantic test suite and benchmark collection results (CI dumps from both Ubuntu 24.04 and 26.04, with and without #87):

  • About 160k SBML directions per runner (about 85% of all noise_dominated ones) failed only the relative check; nearly all of them are derivatives that are zero up to rounding. Their error estimates are small (median 0.8% of tol) and cover the deviation from AMICI's sensitivities at least as well as those of converged directions do.
  • Classified converged, all of them pass their gradient check; none fails. Same for the ~130–140 such directions in the benchmark collection.

🤖 Generated with Claude Code

@dweindl
dweindl marked this pull request as ready for review October 21, 2026 19:25
@dweindl
dweindl requested a review from dilpath October 21, 2026 19:25
A direction was classified "converged" only if its error estimate was
also at most half the absolute value. For a derivative that is zero or
close to it, this fails even when the error estimate is far below the
tolerance, so such directions were reported as `noise_dominated`, and
gradient checks were inconclusive for them. Yet `value +- error_estimate`
still bounds the derivative's magnitude, which is what a gradient check
needs.

"converged" now only requires the error estimate to be within the
(default or user-supplied) tolerance. Whether the value is
distinguishable from zero is available as the new
`DerivativeEstimate.resolved` (`|value| > 2 * error_estimate`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl force-pushed the converged-absolute-precision branch from 6142836 to 29aaa2b Compare October 26, 2026 19:13
@dweindl
dweindl merged commit 156f61e into main Oct 26, 2026
5 checks passed
@dweindl
dweindl deleted the converged-absolute-precision branch October 26, 2026 19:17
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

Successfully merging this pull request may close these issues.

2 participants