iminuit
Jupyter-friendly Python frontend for MINUIT2 in C++
What it is and what it does
iminuit wraps MINUIT2, CERN's C++ optimization library, to solve parameter estimation problems in statistics and physics. It is designed for fitting statistical models—finding best-fit parameters and computing error estimates via likelihood profile analysis. The package includes built-in cost functions for common tasks (unbinned and binned maximum-likelihood, least-squares, template fits with error propagation) and can combine multiple cost functions additively. It integrates with Jupyter for interactive fitting and visualization.
The package depends only on numpy at runtime but gains optional features from scipy (Minos intervals), numba (JIT compilation for speed), matplotlib (visualization), and ipywidgets (interactive mode). It supports current Python versions on macOS, Linux, and Windows, and has been actively maintained since 2012 with no known security vulnerabilities.
Use it for:
- Fit a probability density function to unbinned data and extract maximum-likelihood parameter estimates with error bars
- Perform least-squares fitting to binned histograms with optional robustness to outliers
- Combine multiple cost functions (e.g., signal + background models) and optimize jointly
- Compute confidence intervals via Minos profile analysis for arbitrary confidence levels (with scipy)
- Accelerate likelihood evaluation using Numba-compiled probability functions for high-dimensional data
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
iminuit is a Python interface to MINUIT2 (CERN's C++ optimization library) for fitting statistical models via maximum-likelihood and least-squares methods, with built-in cost functions and Jupyter visualization.
Yes, if you need parameter estimation with rigorous error analysis. iminuit is production-stable, actively maintained, has no known vulnerabilities, and is the standard Python interface to MINUIT2. The dual MIT/LGPL license requires review for proprietary use. Medium install friction (compiled wheels) is typical for scientific packages and not a barrier on supported platforms.
Install
iminuit on PyPI
pip
pip install iminuituv
uv add iminuitpoetry
poetry add iminuitInstalling iminuit
Before you install
Medium install friction due to compiled C++ extensions, but wheels are available for Python 3.9+ on macOS, Linux, and Windows. The package is actively maintained with recent commits and has been stable since its 2012 release.
License in practice
Dual-licensed under MIT and LGPL (copyleft treatment). Users must comply with LGPL obligations if distributing modifications, or may choose MIT terms for simpler use cases; review the license terms for your deployment model.
Quickstart
pip install iminuit numpy
from iminuit import Minuit
from iminuit.cost import UnbinnedNLL
import numpy as np
cost = UnbinnedNLL(data, pdf_function)
m = Minuit(cost, param1=initial_value)
m.migrad()
m.hesse()
Requires Python 3.9+. Compiled C++ extensions are pre-built for common platforms; building from source requires a C++ compiler.
Verify before relying
- Whether optional dependencies (numba, matplotlib, scipy, ipywidgets) are automatically detected and enabled at install time or require explicit installation
- Performance characteristics when used with Numba-compiled functions compared to native MINUIT2 or other optimizers
Package facts
| License | MIT+LGPL (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 278 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 226,878/month — #9,192 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: iminuit-2.32.0-cp310-cp310-macosx_10_9_x86_64.whl; iminuit-2.32.0-cp310-cp310-macosx_11_0_arm64.whl; iminuit-2.32.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; iminuit-2.32.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; iminuit-2.32.0-cp310-cp310-musllinux_1_2_aarch64.whl; iminuit-2.32.0-cp310-cp310-musllinux_1_2_x86_64.whl; iminuit-2.32.0-cp310-cp310-win32.whl; iminuit-2.32.0-cp310-cp310-win_amd64.whl; iminuit-2.32.0-cp311-cp311-macosx_10_9_x86_64.whl; iminuit-2.32.0-cp311-cp311-macosx_11_0_arm64.whl; iminuit-2.32.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; iminuit-2.32.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; iminuit-2.32.0-cp311-cp311-musllinux_1_2_aarch64.whl; iminuit-2.32.0-cp311-cp311-musllinux_1_2_x86_64.whl; iminuit-2.32.0-cp311-cp311-win32.whl; iminuit-2.32.0-cp311-cp311-win_amd64.whl; iminuit-2.32.0-cp311-cp311-win_arm64.whl; iminuit-2.32.0-cp312-cp312-macosx_10_13_x86_64.whl; iminuit-2.32.0-cp312-cp312-macosx_11_0_arm64.whl; iminuit-2.32.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
lmfitLmfit provides non-linear least-squares…
permissive · top 5,000 on PyPI
pymcPyMC is a Python package for Bayesian…
permissive · top 5,000 on PyPI
dask-glmDistributed generalized linear model fitting…
permissive · top 15,000 on PyPI
fastjetFastJet provides Python bindings to the FastJet…
permissive · top 15,000 on PyPI
numpyroNumPyro is a probabilistic programming library…
permissive · top 15,000 on PyPI
nutpienutpie provides a fast NUTS sampler for…
permissive · top 15,000 on PyPI
pystanPyStan provides a Python interface to Stan for…
permissive · top 5,000 on PyPI
PeakUtilsPeakUtils detects peaks in 1D data and refines…
permissive · top 15,000 on PyPI
statsmodelsstatsmodels provides statistical models,…
permissive · top 1,000 on PyPI
xarray-einstatsProvides xarray-friendly wrappers around NumPy…
permissive · top 5,000 on PyPI