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

Added Bayes benchmark script #105

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

alexhroom
Copy link
Collaborator

@alexhroom alexhroom commented Dec 13, 2024

This PR fixes part of #92 by adding the Bayes benchmark script, which calculates the posterior distributions for a two- and three-dimensional example 'from scratch' and compares them to the distributions generated by the nested sampler and DREAM.

The Python script is mostly similar in workflow to the MATLAB one, but the direct calculation of the posterior is vectorised and the module/function docstrings go into a little more detail on what is actually being done, for users who may not be familiar with the basics of Bayesian reflectivity analysis.

This PR also fixes a minor issue with the plotting library - the axes on the contour plots were the wrong way around (but then were flipped to be correct on corner plots)!

2d
3d

@alexhroom alexhroom force-pushed the 92-orso-tests branch 2 times, most recently from 5b594a1 to 933f2d5 Compare December 16, 2024 12:40
@alexhroom alexhroom force-pushed the 92-orso-tests branch 2 times, most recently from 743cd5a to fe4df7f Compare December 17, 2024 16:15
@alexhroom alexhroom marked this pull request as ready for review December 18, 2024 08:49
Copy link
Collaborator

@DrPaulSharp DrPaulSharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alongside these comments, I'm having trouble running both the script and jupyter notebook. Is this due to the backgrounds bug, or is there something else?

RATapi/utils/plotting.py Show resolved Hide resolved
RATapi/examples/bayes_benchmark/bayes_benchmark.py Outdated Show resolved Hide resolved
@alexhroom
Copy link
Collaborator Author

@DrPaulSharp they both run fine for me, but I may have something weird going on with my binary. what kind of error were you getting?

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