estimagic is a Python package that provides high-quality and user-friendly tools to fit large scale empirical models to data and make inferences about the estimated model parameters. It is especially suited to solve difficult constrained optimization problems.
estimagic provides several advantages over similar packages, including a unified interface that supports a large number of local and global optimization algorithms and the possibility of monitoring the optimization procedure via a beautiful interactive dashboard.
estimagic provides tools for nonlinear optimization, numerical differentiation and statistical inference.
- estimagic wraps all algorithms from scipy.optimize and many more become available when installing optional dependencies.
- estimagic can automatically implement many types of constraints via reparametrization, with any optmizer that supports simple box constraints.
- estimagic encourages name-based parameters handling. Parameters are specified as pandas DataFrames that can have any kind of single or MultiIndex. This is especially useful when specifying constraints.
- The complete history of parameters and function evaluations are saved in a database for maximum reproducibility and displayed in real time via an interactive dashboard.
- 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.
- 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.
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 -c opensourceeconomics estimagicThe 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.
The documentation is hosted (on rtd)
If you use Estimagic for your research, please do not forget to cite it.
@Unpublished{Gabler2021,
Title = {A Python Tool for the Estimation of (Structural) Econometric Models.},
Author = {Janos Gabler},
Year = {2021},
Url = {https://github.com/OpenSourceEconomics/estimagic}
}
Estimagic is in beta status and the API might change.