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

Make mcmc_lc accept log priors, not prior pdfs, to avoid underflow #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dannygoldstein
Copy link
Contributor

This PR alters the interface of the mcmc_lc method, making its priors argument take a dictionary of functions that return the log prior, rather than the prior pdf. Reasons for doing this:

  • computing the log probability directly is often cheaper than computing the pdf and then taking the log
  • it avoids underflow (no situations where an exception will be raised by trying to take the log of 0)

@kbarbary
Copy link
Member

This looks like a good idea. But we should make it backwards-compatible. How about adding a separate keyword like lnpriors or logpriors that takes precedence over priors if specified?

@benjaminrose benjaminrose added enhancement help-wanted No one is working on this issue yet (that we know of!) blocked labels Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement help-wanted No one is working on this issue yet (that we know of!)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants