Skip to main content

Solve nonlinear perfect foresight models

Project description

Solve nonlinear heterogeneous agent models using machine learning techniques

https://github.com/dfm/emcee/workflows/Tests/badge.svg https://img.shields.io/badge/GitHub-gboehl%2Feconpizza-blue.svg?style=flat https://readthedocs.org/projects/econpizza/badge/?version=latest https://github.com/gboehl/pydsge/workflows/Continuous%20Integration%20Workflow/badge.svg?branch=master https://badge.fury.io/py/econpizza.svg

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).

Documentation

The Documentation and tutorials can be found here.

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. Fortunately, there is (somewhat cryptic) help out there and you can run

pip install "jax[cpu]===0.3.14" -f https://whls.blob.core.windows.net/unstable/index.html --use-deprecated legacy-resolver

which successfully installs JAX on windows. Econpizza then runs just fine.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

econpizza-0.1.12.tar.gz (326.9 kB view details)

Uploaded Source

Built Distribution

econpizza-0.1.12-py3-none-any.whl (55.1 kB view details)

Uploaded Python 3

File details

Details for the file econpizza-0.1.12.tar.gz.

File metadata

  • Download URL: econpizza-0.1.12.tar.gz
  • Upload date:
  • Size: 326.9 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

Hashes for econpizza-0.1.12.tar.gz
Algorithm Hash digest
SHA256 bcbefd1ef0f58ed147e35b136c176a6d11ea509043b1e2a3e34662a6d37aba08
MD5 8db48060e9193284857ed062ee70b3e6
BLAKE2b-256 a81aed381171a7e26a689104c3b5de7da7ad85eea323590695c86a188cc67c8f

See more details on using hashes here.

Provenance

File details

Details for the file econpizza-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: econpizza-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 55.1 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

Hashes for econpizza-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 24cd361fe4ea3eb67566439cc2d2f76303a20a8f853c4032647d5ed85dc3251f
MD5 4f5f7371e5a9415a520579cc05feba08
BLAKE2b-256 10133dde9af7101ee3613a0ef75f0a4bcf8402be34bc5168fb5e39bfb145f2f8

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page