Skip to main content

Solve nonlinear perfect foresight models with heterogeneous agents

Project description

badge0 badge1 badge2 badge3

Solve nonlinear heterogeneous agent models using automatic differentiation

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 and provides generic and robust routines for steady state search.

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. There is a presentation on how this works behind the szenes.

Documentation

User guideQuickstart tutorial

Installing the repository version from PyPi is as simple as typing

pip install econpizza

in your terminal or Anaconda Prompt.

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.6.9.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

econpizza-0.6.9-py3-none-any.whl (84.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: econpizza-0.6.9.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for econpizza-0.6.9.tar.gz
Algorithm Hash digest
SHA256 436174e3ff37b6f2ff1e7c81a1a6f655680d9a8c44f0a77a69b8081c151234c3
MD5 b3b1e8739fa6078076fa7ed9e59b540d
BLAKE2b-256 5b0422cce500dea392e6397d805400d849b1dbd37844cf3a86b351b2f4635e3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: econpizza-0.6.9-py3-none-any.whl
  • Upload date:
  • Size: 84.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for econpizza-0.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 092a914d96211e71cc14a8da84ef2d9df05c0265e1f95689db131e9c59d0f065
MD5 bac18c732db72de1faae87ffc08ca1d1
BLAKE2b-256 e3af297dc0d26421423fa449b6d18d072d1932fa4f9970118705e9de2ea88dda

See more details on using hashes here.

Supported by

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