IntroductionΒΆ

This package provides tools to fit probability density functions (PDFs) to both unbinned and binned data, using different minimizers. MinKit offers a common interface to use iminuit, SciPy or NLopt minimizers. In order to do numerical integrations, the GSL libraries are used. The utilization of both CPU and GPU devices is supported. For GPU backends, it is relied in the Reikna package, that is a common interface for PyCUDA and PyOpenCL. It is not necessary to have the previous packages installed if working only with CPU backends.

Classes meant for the user are imported directly from the main module

import minkit

x = minkit.Parameter('x', bounds=(-10, +10))
c = minkit.Parameter('c', 0.)
s = minkit.Parameter('s', 1.)
g = minkit.Gaussian('Gaussian', x, c, s)

data = g.generate(10000)

These lines define the parameters used by a Gaussian function, and a data set is generated following this distribution. The sample can be easily fitted calling:

with minkit.minimizer('uml', g, data) as minimizer:
   minimizer.minimize()

After this process, the parameters of the PDF take values corresponding to the minimization point.