cranmer / active_sciencing

active learning + reusable workflows + likelihood free inference

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prior used by emcee needs to incorporate Distribution.density

cranmer opened this issue · comments

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.

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