Skip to content

tyseraph/probfit

 
 

Repository files navigation

probfit

image

image

image

probfit is a set of functions that helps you construct a complex fit. It's intended to be used with iminuit. The tool includes Binned/Unbinned Likelihood estimators, χ2 regression, Binned χ2 estimator and Simultaneous fit estimator. Various functors for manipulating PDFs such as Normalization and Convolution (with caching) and various built-in functions normally used in B physics are also provided.

Strict dependencies

Optional dependencies

Getting started

import numpy as np
from iminuit import Minuit
from probfit import UnbinnedLH, gaussian
data = np.random.randn(10000)
unbinned_likelihood = UnbinnedLH(gaussian, data)
minuit = Minuit(unbinned_likelihood, mean=0.1, sigma=1.1)
minuit.migrad()
unbinned_likelihood.draw(minuit)

Documentation and Tutorial

  • Documentation
  • The tutorial is an IPython notebook that you can view online here. To run it locally: cd tutorial; ipython notebook --pylab=inline tutorial.ipynb.
  • Developing probfit: see the development page

License

The package is licensed under the MIT license (open source).

About

Cost function builder. For fitting distributions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 84.2%
  • Python 15.6%
  • Other 0.2%