A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/scikit-hep/iminuit below:

scikit-hep/iminuit: Jupyter-friendly Python interface for C++ MINUIT2

iminuit is a Jupyter-friendly Python interface for the Minuit2 C++ library maintained by CERN's ROOT team.

Minuit was designed to optimize statistical cost functions, for maximum-likelihood and least-squares fits. It provides the best-fit parameters and error estimates from likelihood profile analysis.

The iminuit package brings additional features:

iminuit is promised to remain a lean package which only depends on numpy, but additional features are enabled if the following optional packages are installed.

Checkout our large and comprehensive list of tutorials that take you all the way from beginner to power user. For help and how-to questions, please use the discussions on GitHub or gitter.

Lecture by Glen Cowan

In the exercises to his lecture for the KMISchool 2022, Glen Cowan shows how to solve statistical problems in Python with iminuit. You can find the lectures and exercises on the Github page, which covers both frequentist and Bayesian methods.

Glen Cowan is a known for his papers and international lectures on statistics in particle physics, as a member of the Particle Data Group, and as author of the popular book Statistical Data Analysis.

iminuit can be used with a user-provided cost functions in form of a negative log-likelihood function or least-squares function. Standard functions are included in iminuit.cost, so you don't have to write them yourself. The following example shows how to perform an unbinned maximum likelihood fit.

import numpy as np
from iminuit import Minuit
from iminuit.cost import UnbinnedNLL
from scipy.stats import norm

x = norm.rvs(size=1000, random_state=1)

def pdf(x, mu, sigma):
    return norm.pdf(x, mu, sigma)

# Negative unbinned log-likelihood, you can write your own
cost = UnbinnedNLL(x, pdf)

m = Minuit(cost, mu=0, sigma=1)
m.limits["sigma"] = (0, np.inf)
m.migrad()  # find minimum
m.hesse()   # compute uncertainties

iminuit optionally supports an interactive fitting mode in Jupyter notebooks.

High performance when combined with numba

When iminuit is used with cost functions that are JIT-compiled with numba (JIT-compiled pdfs are provided by numba_stats ), the speed is comparable to RooFit with the fastest backend. numba with auto-parallelization is considerably faster than the parallel computation in RooFit.

More information about this benchmark is given in the Benchmark section of the documentation.

If you use iminuit in a scientific work, please cite us. A generic BibTeX entry is:

@article{iminuit,
  author={Hans Dembinski and Piti Ongmongkolkul et al.},
  title={scikit-hep/iminuit},
  DOI={10.5281/zenodo.3949207},
  publisher={Zenodo},
  year={2020},
  month={Dec},
  url={https://doi.org/10.5281/zenodo.3949207}
}

The DOI and URL in this entry point always to the latest release of iminuit. You can also cite the actual release that you used, please follow the Zenodo link, which offers entries for common bibliography formats for all iminuit releases.

The recommended scientific reference for the MINUIT algorithms is:

@article{James:1975dr,
    author = "James, F. and Roos, M.",
    title = "{Minuit: A System for Function Minimization and Analysis of the Parameter Errors and Correlations}",
    reportNumber = "CERN-DD-75-20",
    doi = "10.1016/0010-4655(75)90039-9",
    journal = "Comput. Phys. Commun.",
    volume = "10",
    pages = "343--367",
    year = "1975"
}

The 2.x series has introduced breaking interfaces changes with respect to the 1.x series. There are no plans to introduce further breaking changes.

All interface changes from 1.x to 2.x are documented in the changelog with recommendations how to upgrade. To keep old scripts running, pin your major iminuit version to <2: the command pip install 'iminuit<2' installs the 1.x series.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4