scikit-hep / probfit

Cost function builder. For fitting distributions.
http://probfit.readthedocs.io/
MIT License
50 stars 30 forks source link

.. -- mode: rst --

probfit

.. image:: https://img.shields.io/pypi/v/probfit.svg :target: https://pypi.python.org/pypi/probfit

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1477852.svg :target: https://doi.org/10.5281/zenodo.1477852

.. image:: https://github.com/scikit-hep/probfit/actions/workflows/main.yml/badge.svg :target: https://github.com/scikit-hep/probfit/actions/workflows/main.yml

probfit is a set of functions that helps you construct a complex fit. It's intended to be used with iminuit <http://iminuit.readthedocs.org/>_. The tool includes Binned/Unbinned Likelihood estimators, 𝝌² regression, Binned 𝝌² 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

.. code-block:: python

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

License

The package is licensed under the MIT <http://opensource.org/licenses/MIT>_ license (open source).