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

Relative Difference Prior Abs fix #1410

Merged
merged 8 commits into from
Apr 28, 2024
Merged

Conversation

KrisThielemans
Copy link
Collaborator

@KrisThielemans KrisThielemans commented Apr 27, 2024

Changes in this pull request

  • replace abs() (leading to integer calculations) with std::abs()
  • introduce value() and derivative_10 functions
  • change handling of 0/0 at x=y=0 (when epsilon==0) by imposing continuity. This means that the derivative now returns 1/(1+gamma) and the Hessian returns INFINITY.

This PR is backwards incompatible as RDP has changed drastically. However, it is a bug-fix.

Testing performed

Added extra tests based on Mathematica analysis

Related issues

Fixes #1409

This will allow implementation specific tests for a particular prior.
- we were using abs() which (at least on some systems) converted to
  integers, giving the wrong result. now using std::abs()
- introduce value/derivative_10 function for more concise code
@KrisThielemans KrisThielemans added this to the v6.1 milestone Apr 27, 2024
@KrisThielemans KrisThielemans self-assigned this Apr 27, 2024
now use INFINITY for second order derivatives, obtained by
continuity
split the tests for the different priors in different classes, such
that we can have specific tests for each. Currently, only added some for the RDP,
including a Lipschitz test and limit for large values.
The RDP test was failing with eps=1.e-3, so now using 1.e-4
@KrisThielemans KrisThielemans changed the title Abs fix Relative Difference Prior Abs fix Apr 27, 2024
@KrisThielemans
Copy link
Collaborator Author

I think this is done. @Robert-PrescientImaging @epapoutsellis @samdporter. Possibly you could have a look. I'd like to merge this soon though.

@robbietuk
Copy link
Collaborator

I only had time for quick glance but LGTM.

@KrisThielemans
Copy link
Collaborator Author

KrisThielemans commented Apr 28, 2024

GitHub actions failure due to unrelated #1411.

I'll merge after cleaning up some history.

@KrisThielemans KrisThielemans merged commit 8664718 into UCL:master Apr 28, 2024
7 of 9 checks passed
@KrisThielemans KrisThielemans deleted the AbsFix branch April 28, 2024 09:11
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.

RelativeDifferencePrior gives wrong results due to use of abs()
2 participants