Giter Site home page Giter Site logo

econpizza's Introduction

econpizza

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}
}

econpizza's People

Contributors

andkound98 avatar gboehl avatar joselores avatar shtopane avatar sveneis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

econpizza's Issues

Simulating MPC

I am working on simulating MPC for India using Econpizza. I tried using the get_distributions() function to get the disaggregated variables after applying a shock to wages(e_w) through find_path(). However, I am unsure how to recover MPCs after applying the shock. Please let me know if there is any other way of simulating MPCs using Econpizza. Any help would be greatly appreciated.

Forcasting

Hi Gregor,
Sorry for the new interruption. I was wondering if there is an example to do some forcasting on real data on the econpizza package.
Thank you very much in advance!

enhancement: support for jaxopt as a more robust stst solver

I'm trying to solve a rather complex model (~100 equations), the problem is that the Newton solver is not robust enough if the initial values are a bit off, it wouldn't converge, is there any chance to implement more robust solvers or add support to utilize optimization routines from jaxopt to solve the model?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.