-
Notifications
You must be signed in to change notification settings - Fork 16
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
Normalised stats #396
Normalised stats #396
Conversation
…erence to `NestedSamples.stats` producing columns of differences `[Delta_logZ, ...]`
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #396 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 36 36
Lines 3060 3069 +9
=========================================
+ Hits 3060 3069 +9 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea, comments inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AdamOrmondroyd, all inline comments addressed.
for beta in [1., 0., 0.5]: | ||
np.random.seed(42) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need a seed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to get failing tests in what follows, because of changes to the seed from the tests I added above... Nothing dramatic, just bad chance in combination with the tests checking against 3*std or similar. I could have fiddled around with tolerances, but just trying a new seed there was enough, so I did not dig deeper...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll reapprove when you've done the version number ofc this is a minor bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR introduces a
norm
keyword for theNestedSamples.stats
method, that allows passing a previously computedNestedSamples.stats
instance as a normalisation reference, producing additional columns of differences[Delta_logZ, ...]
.Typical cosmology use-case would be when you have multiple models (e.g. LCDM, wCDM, w0waCDM) and you want to have evidence and KL-divergence values relative to one particular model (e.g. LCDM). I was getting annoyed having to type this up every time myself...
Checklist:
flake8 anesthetic tests
)pydocstyle --convention=numpy anesthetic
)python -m pytest
)