Skip to main content

Solve nonlinear perfect foresight models with heterogeneous agents

Project description

Solve nonlinear heterogeneous agent models using automatic differentiation

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

Econpizza is a framework to solve and simulate fully nonlinear perfect foresight models, with or without heterogeneous agents. The package implements the solution method proposed in HANK on Speed: Robust Nonlinear Solutions using Automatic Differentiation (Gregor Boehl, 2023, SSRN No. 4433585). It allows to specify and solve nonlinear macroeconomic models quickly in a simple, high-level fashion. Generic and robust routines for steady state search are provided.

The package can solve nonlinear models with heterogeneous agents, such as HANK models with one or two assets and portfolio choice. Steady state and nonlinear impulse responses (including, e.g., the ELB) can typically be found within a few seconds. The method extends the Sequence-Space Jacobian method (Auclert et al., 2022, ECMA) to fully nonlinear heterogeneous agent models models by iteratively using Jacobian-vector producs to approximate the solution to the linear system of equations associated with each Newton iteration. This not only allows to study the dynamics of aggregate variables, but also the complete nonlinear transition dynamics of the cross-sectional distribution of assets and disaggregated objects.

To solve models with representative agents a shooting methods similar to Laffargue (1990), Boucekkine (1995) and Juillard (1996) is implemented. It is faster and more reliable than the extended path method in dynare due to the use of automatic differentiation for the efficient jacobian decompositions during each Newton-step. Nonlinear perfect-foresight transition dynamics can - even for large-scale nonlinear models with several occassionally binding constraints - be computed in less than a second.

The package builds heavily on automatic differentiation via JAX.

Documentation

Guides and tutorials are provided on ReadTheDocs:

Citation

@article{boehl2023goodpizza,
    title       = {HANK on Speed: Robust Nonlinear Solutions using Automatic Differentiation},
    author      = {Boehl, Gregor},
    journal     = {Available at SSRN 4433585},
    year        = {2023}
}

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.5.6.tar.gz (943.1 kB view details)

Uploaded Source

Built Distribution

econpizza-0.5.6-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: econpizza-0.5.6.tar.gz
  • Upload date:
  • Size: 943.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for econpizza-0.5.6.tar.gz
Algorithm Hash digest
SHA256 dfd46ca351b13976c40d6d0d325307a1758ddc5b94d07b1e00c47ffa63a17887
MD5 06bcd4a5017c09194ec0502f4c3e6d70
BLAKE2b-256 59456d849e5c3f6af3f19b950da50ef87e05271785348817b78925080314ff80

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: econpizza-0.5.6-py3-none-any.whl
  • Upload date:
  • Size: 74.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for econpizza-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8df6362a840085685b3b440f9202b52dcf590a93b675a4bb03f95c3723d88fd9
MD5 e15a24426f12859e4370d5968f62258c
BLAKE2b-256 8800c07146f54b07d73401a7e3358a7c5103ac3c484f6aba0fdca8ab265c3bb3

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