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

Percentage Point Functions for parameters #353

Merged
merged 13 commits into from
Apr 21, 2024

Conversation

vhaasteren
Copy link
Member

@vhaasteren vhaasteren commented Sep 21, 2023

This PR adds the Percentage Point Function (PPF) to Enterprise parameters. The PPF is the inverse of the CDF, so it can be used to sample from the distribution. Some Nested Sampling implementations require the PPF as input: for instance MultiNest requires the "hypercube transformation". That is done with the PPF.

Now we can do something like:

from enterprise.signals.parameter import LinearExp

le = LinearExp(1, 3)("LEXP")
le.get_ppf(0.5)

The Truncated Normal PPF is not yet implemented, but LinearExp, Normal, and Uniform are there.

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.48%. Comparing base (5c1e455) to head (fbff5be).
Report is 16 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #353      +/-   ##
==========================================
- Coverage   88.44%   87.48%   -0.96%     
==========================================
  Files          13       13              
  Lines        3037     3133      +96     
==========================================
+ Hits         2686     2741      +55     
- Misses        351      392      +41     
Files Coverage Δ
enterprise/signals/parameter.py 91.66% <100.00%> (+7.60%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b1f24c...fbff5be. Read the comment docs.

@vhaasteren
Copy link
Member Author

It seems that this requires some extra unit tests. Actually, the unit tests for the entire parameter class do not check for exceptions. I'll just update it to check for everything...

@vhaasteren vhaasteren changed the base branch from master to dev November 7, 2023 09:00
@AaronDJohnson
Copy link
Collaborator

@vhaasteren Is there anything that needs to be done on this one?

@vhaasteren
Copy link
Member Author

No, is ready to go

@AaronDJohnson AaronDJohnson merged commit a4876a9 into nanograv:dev Apr 21, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants