estimagic is a Python package for nonlinear optimization with or without constraints. It is particularly suited to solve difficult nonlinear estimation problems. On top, it provides functionality to perform statistical inference on estimated parameters.

For a complete introduction to optimization in estimagic, check out the estimagic tutorial at SciPy2022 conference

If you want to learn more about estimagic, dive into one of the following topics

Getting Started

New users of estimagic should read this first.

How-to Guides

Detailed instructions for specific and advanced tasks.


Installation instructions for estimagic and optional dependencies.

Optimization Algorithms

List of numerical optimizers and their optional parameters.


Background information on key topics central to the package.

API Reference

Detailed description of the estimagic API.


Collection of tutorials, talks, and screencasts on estimagic.



  • estimagic wraps algorithms from scipy.optimize, nlopt, pygmo and more. See Optimizers

  • estimagic implements constraints efficiently via reparametrization, so you can solve constrained problems with any optimzer that supports bounds. See How to specify constraints

  • The parameters of an optimization problem can be arbitrary pytrees. See How to specify params.

  • The complete history of parameters and function evaluations can be saved in a database for maximum reproducibility. See How to use logging

  • Painless and efficient multistart optimization. See How to do multistart

  • The progress of the optimization is displayed in real time via an interactive dashboard. See How to use the dashboard.

Estimation and Inference#

  • You can estimate a model using method of simulated moments (MSM), calculate standard errors and do sensitivity analysis with just one function call. See MSM Tutorial

  • Asymptotic standard errors for maximum likelihood estimation.

  • estimagic also provides bootstrap confidence intervals and standard errors. Of course the bootstrap procedures are parallelized.

Numerical differentiation#

  • estimagic can calculate precise numerical derivatives using Richardson extrapolations.

  • Function evaluations needed for numerical derivatives can be done in parallel with pre-implemented or user provided batch evaluators.

Useful links for search: Index | Module Index | Search Page