Skip to main content

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 guide ▶ Quickstart 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}
}

Metadata

Release files for econpizza 0.6.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for econpizza 0.6.10
File Size Uploaded Provenance
econpizza-0.6.10.tar.gz 1.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for econpizza 0.6.10
File Interpreter ABI Platform
econpizza-0.6.10-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / econpizza-0.6.10.tar.gz

Download URL econpizza-0.6.10.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
1938c4c871dab1df3d665a0e7f4b1b682120777bbb76622fa6987d5346a02d99
BLAKE2b-256 checksum
How to use checksums
2a0a57b130d1c7a7b61b5b811ca271b77d731eefde4a83ecbb484378bb24d21e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / econpizza-0.6.10-py3-none-any.whl

Download URL econpizza-0.6.10-py3-none-any.whl
Size 84.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec1c5013edb1ecd5228819255694d7374c7d5e714e0e09be81c3c819e566475a
BLAKE2b-256 checksum
How to use checksums
4ce6c2e1cb6e41df2b3e103ca93805444118450d333c8d05835ab1a41edb139f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for econpizza 0.6.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page