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

Include priors from any sampled distributions. #18

Merged
merged 8 commits into from
Oct 11, 2022
Merged

Conversation

martin-millon
Copy link
Collaborator

  • This includes a new subpackage to perform a Kernel Density Estimation (KDE) on any sampled distribution and use it as a prior (example notebook will available on the TDCOSMO GitHub)
  • The KDE is tested up to a 5D parameters space and returns an accurate estimation of the probability distribution.
  • This returns the same results as the importance sampling technique, up to the sampling precision.

Copy link
Owner

@sibirrer sibirrer left a comment

Choose a reason for hiding this comment

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

Looks great and well tested! I only had one or two minor requests for docstrings and then ready to merge. Thank you very much!

:param params: (dictionnary). Dictionnary containing the samples.
:param default_weights: (numpy array). Default weights associated to the samples.
:param cosmology: (str). Astropy cosmology
:param rescale: (bool). Rescale the chains between 0 and 1 for all parameters. This is absolutely necessary if you want to evaluate a KDE on these chains.
Copy link
Owner

Choose a reason for hiding this comment

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

loglsamples is missing in the docstrings

return [w for w in self.weights.keys() if len(self.weights[w]) > 0]

def fill_default(self, param, default_val, nsamples=None, verbose=False):
"""fill an empty default param with a default value"""
Copy link
Owner

Choose a reason for hiding this comment

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

can you add docstrings here? Thank you!

@sibirrer sibirrer merged commit 309df07 into main Oct 11, 2022
@martin-millon martin-millon deleted the Planck_sampling branch October 11, 2022 21:56
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