Skip to main content

estimagic

image image image image image image image image image image image image

Introduction

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.

Optimization

  • estimagic wraps algorithms from scipy.optimize, nlopt, pygmo and more.
  • estimagic implements constraints efficiently via reparametrization, so you can solve constrained problems with any optimizer that supports bounds.
  • The parameters of an optimization problem can be arbitrary pytrees
  • The complete history of parameters and function evaluations can be saved in a database for maximum reproducibility.
  • Painless and efficient multistart optimization.
  • The progress of the optimization is displayed in real time via an interactive 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.
  • 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.

Installation

The package can be installed via conda. To do so, type the following commands in a terminal:

$ conda config --add channels conda-forge
$ conda install estimagic

The first line adds conda-forge to your conda channels. This is necessary for conda to find all dependencies of estimagic. The second line installs estimagic and its dependencies.

Installing optional dependencies

Only scipy is a mandatory dependency of estimagic. Other algorithms become available if you install more packages. We make this optional because most of the time you will use at least one additional package, but only very rarely will you need all of them.

For an overview of all optimizers and the packages you need to install to enable them see {ref}list_of_algorithms.

To enable all algorithms at once, do the following:

conda install nlopt

pip install Py-BOBYQA

pip install DFO-LS

conda install petsc4py (Not available on Windows)

conda install cyipopt

conda install pygmo

pip install fides>=0.7.4 (Make sure you have at least 0.7.1)

Documentation

The documentation is hosted (on rtd)

Citation

If you use Estimagic for your research, please do not forget to cite it.

@Unpublished{Gabler2022,
  Title  = {A Python Tool for the Estimation of large scale scientific models.},
  Author = {Janos Gabler},
  Year   = {2022},
  Url    = {https://github.com/OpenSourceEconomics/estimagic}
}

Metadata

Release files for estimagic 0.4.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for estimagic 0.4.7
File Size Uploaded
estimagic-0.4.7.tar.gz 330.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for estimagic 0.4.7
File Interpreter ABI Platform
estimagic-0.4.7-py3-none-any.whl Python 3 none any Details

Total release size: 696.5 kB

Release files / estimagic-0.4.7.tar.gz

Download URL estimagic-0.4.7.tar.gz
Size 330.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2bcb327857f34c753b47c62a55195565d5203ab0c3796e960fa01194876a36a1
BLAKE2b-256 checksum
How to use checksums
e8dac2ee0f2f393740dadb42b239504cee92a52442140718d564f1568c5e65a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / estimagic-0.4.7-py3-none-any.whl

Download URL estimagic-0.4.7-py3-none-any.whl
Size 365.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
110e14355c9aaba1989de5fa882b759f2dab376c8bf7215e686e20b236c0a1d8
BLAKE2b-256 checksum
How to use checksums
8bb0343a37786d7c1498584290e15e47731e01860659a84969657098db467450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.7 This release

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page