skillfed

iminuit

Jupyter-friendly Python frontend for MINUIT2 in C++

iminuit v2.32.0 226.9K downloads/30d#9,192 on PyPI319
Copyleft license MIT+LGPL Active released

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 iminuit

uv

uv add iminuit

poetry

poetry add iminuit

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)License :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: C++Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Scientific/Engineering :: MathematicsTopic :: Scientific/Engineering :: PhysicsTopic :: Software Development

Tags

maximum likelihood fittingleast squares optimizationparameter estimation errorsstatistical model fittingminuit python interfacelikelihood profile analysisjupyter fitting visualization
statistical-fittingparameter-estimationjupyter-friendly

More Software Development packages