diana-hep / carl

Likelihood-free inference toolbox.
BSD 3-Clause "New" or "Revised" License
57 stars 22 forks source link

Add negative log likelihood ratio to API #31

Closed cranmer closed 8 years ago

cranmer commented 8 years ago

in common usage we will want to evaluate the - log likelihood ratio

    # Evaluate log-likelihood ratio
    r = ratio.predict(X_true, log=True)
    value = -np.sum(r[np.isfinite(r)])

can we add this directly to the API? maybe nllr?

That's a place it would be good to have a warning for the isinf

glouppe commented 8 years ago

Done in c4b54c0a4faeaa9a5a8323f77cacf77d353b94ca