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

Prior used by emcee needs to incorporate Distribution.density #2

Closed
cranmer opened this issue Jun 5, 2017 · 1 comment
Closed

Prior used by emcee needs to incorporate Distribution.density #2

cranmer opened this issue Jun 5, 2017 · 1 comment

Comments

@cranmer
Copy link
Owner

cranmer commented Jun 5, 2017

Currently emcee is using this prior

def lnprior(theta, prior):
    # XXX incorporate the prior passed in here
    if 0. < theta < 2*np.pi:
        return 0.
    return -np.inf

But for the science loop, the prior on the second iteration is the posterior of the first iteration. That posterior is represented by the Distribution class. We need to implement the Distribution.density or Distribution.pdf

Should basically be the same as using the current histogram class, but needs to be normalized.

@cranmer cranmer changed the title Move Prior used by emcee to Distribution.density Prior used by emcee needs to incorporate Distribution.density Jun 5, 2017
@betatim
Copy link
Collaborator

betatim commented Jun 6, 2017

You could use the histogram (I think np.histogram(..., density=True) finally does the right thing) but using a KDE is simple enough.

@betatim betatim closed this as completed Jun 6, 2017
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

No branches or pull requests

2 participants