Skip to content
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

Acceleration of covariance-based analysis by Jacobian simplification #55

Merged
merged 4 commits into from
Nov 2, 2020

Conversation

luisfabib
Copy link
Member

Computation of covariance-based uncertainties requires the estimation of the Jacobian at the found solution. For non-linear parameters this has to be estimated numerically. Until now DeerLab was using the numdifftools.Jacobian function to do this.

The functions does a series of finite difference-based calculations that yield very accurate Jacobians. This function, however, is very costly due to the large number of function evaluations, and has become a bottleneck for most DeerLab fit functions. For example, a simple 4-pulse DEER fit with fitsignal might take 8s to run, from which 7s correspond to the Jacobian estimation.

To prevent this I have substituted the Jacobian estimation using numdifftools by a simple one-step finite-difference approximation. While it has the potential to be less accurate...

  • ... the covariance based approach has many other approximations which lead to larger inaccuracies in the uncertainty than those caused by inaccurate Jacobians.
  • ... for a set of tests, the simple one-step finite-difference yielded numerically equal results to the numdifftools results for DEER models.
    Therefore, I have removed the dependencies on numdifftools altogether and introduced the simpler version.

This has led to runtime accelerations of the fit functions by factors x2-10. For example, the 4-pulse DEER fit which might have taken 8s now requires just 1s, with the NNLS problem being the bottleneck as should be.

…e throughout

- same accuray for tested cases
- massive speedup of covariance-based uncertainty analysis (x2-10)
- removes dependency on numdifftools package
@luisfabib luisfabib added enhancement New feature or request performance labels Nov 2, 2020
@luisfabib luisfabib added this to the 0.13.0 milestone Nov 2, 2020
@stestoll stestoll merged commit 435b356 into main Nov 2, 2020
@stestoll stestoll deleted the feature/uqanalysis_speedup branch November 2, 2020 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants