Solve nonlinear perfect foresight models
Project description
Solve nonlinear heterogeneous agent models using machine learning techniques
Econpizza is a framework to solve and simulate nonlinear perfect foresight models, with or without heterogeneous agents. A parser allows to express economic models in a simple, high-level fashion as yaml-files. Additionally, generic and robust routines for steady state search are provided.
The baseline solver is a Newton-based stacking method in the spirit of Boucekkine (1995), Juillard (1996) and others. Hence, the method is similar to the solver in dynare, but faster and more robust due to the use of automatic differentiation and sparse jacobians. Even perfect-foresight IRFs for large-scale nonlinear models with, e.g., occassionally binding constraints can be computed in less than a second.
The package makes heavy use of automatic differentiation via Jax.
Econpizza can solve nonlinear HANK models. The approach to deal with the distribution is inspired by the Sequence-Space Jacobian method (Auclert et al., 2022, ECMA). Steady state and nonlinear impulse responses (including, e.g., the ELB) can typically be found within a few seconds.
There is a model parser to allow for the simple and generic specification of models (with or without heterogeneity).
Installation
Installing the repository version from PyPi is as simple as:
pip install econpizza
Alternatively, the most recent version from GitHub with some experimental features can be installed via
pip install git+https://github.com/gboehl/grgrlib
pip install git+https://github.com/gboehl/econpizza
Note that the latter requires git to be installed.
Econpizza needs Jax to be installed. This is not a problem for MacOS and Linux, but the time for Jax to fully support Windows has not yet come. Following the (somewhat cryptic) guide, one could try
pip install jax[cpu]==0.3.7 -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver
which works for GitHub Actions (but seems to cause problems later).
Documentation
The Documentation and tutorials can be found here.
References
econpizza is developed by Gregor Boehl to simulate nonlinear perfect foresight models. Please cite it with
@Misc{boehl2022pizza,
title = {Econpizza: solving nonlinear heterogeneous agents models using machine learning techniques},
author = {Boehl, Gregor},
howpublished = {\url{https://econpizza.readthedocs.io/_/downloads/en/latest/pdf/}},
year = {2022}
}
For the Boehl-Hommes method: Boehl, Gregor and Hommes, Cars (2021). Rational vs. Irrational Beliefs in a Complex World. IMFS Working papers
@techreport{boehl2021rational,
title = {Rational vs. Irrational Beliefs in a Complex World},
author = {Boehl, Gregor and Hommes, Cars},
year = 2021,
institution = {IMFS Working Paper Series}
}
I appreciate citations for econpizza because it helps me to find out how people have been using the package and it motivates further work.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file econpizza-0.1.11.tar.gz
.
File metadata
- Download URL: econpizza-0.1.11.tar.gz
- Upload date:
- Size: 365.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 596e8b8cb70bf4c23815a4bd965e7a781d68f6ed42cffca95d17202855bbe31a |
|
MD5 | 728a3a1f19bfd1aa63efad3d4e221464 |
|
BLAKE2b-256 | bb6f42de3f231fa8724362c2a69938653cc60a469094ec2354b48a3433dc12c2 |
Provenance
File details
Details for the file econpizza-0.1.11-py3-none-any.whl
.
File metadata
- Download URL: econpizza-0.1.11-py3-none-any.whl
- Upload date:
- Size: 84.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be7c0fc0dd6bcd903ae18d53e5d26fb32ee6503cd0cfe27bd8d75e8c7f5fe64 |
|
MD5 | ab7ecaef01c4c89d1722e5cdb7fe000f |
|
BLAKE2b-256 | 6a4d1571e77adbaadc741084791f2cdf7c35ec5ed283bce223ea31eb790b21f1 |