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

approximate likelihood #8

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

approximate likelihood #8

cranmer opened this issue Jun 6, 2017 · 1 comment

Comments

@cranmer
Copy link
Owner

cranmer commented Jun 6, 2017

This is more of a note since merging notebooks is difficult.

I'm prototyping a simple likelihood-free inference stage instead of the known likelihood.

def lnlike(theta, x, phi):
    #exact likelihood for testing
    #mean, std = theta, 2 + np.sin(phi)
    #return np.log(norm(mean, std).pdf(x).prod())
    
    #approx likelihood
    simdata = simulator(theta, phi,n_samples=1000)
    # this xrange is specific to this simulator
    # better to have auto-range, but would need density to correct for range & bin width
    xrange = (3-9,3+9) 
    approx_density = Distribution(name='approx density', range=xrange,samples=simdata)
    return np.sum(np.log(approx_density.pdf(x)))
@cranmer
Copy link
Owner Author

cranmer commented Jun 6, 2017

PS> it makes it go slower :-)

@cranmer cranmer closed this as completed Jun 12, 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

1 participant