Replication codes

Julia implementations of influential models in macroeconomics and finance. These are learning-oriented replications and may contain simplifications relative to the original papers.

  1. 1994 · Aiyagari

    Uninsured Idiosyncratic Risk and Aggregate Saving

    Discrete time · Continuous time

  2. 1993 · Froot et al.

    Risk Management: Coordinating Corporate Investment and Financing Policies

    View code

  3. 1995 · Duan

    The GARCH Option Pricing Model

    View code

  4. 2008 · Arellano

    Default Risk and Income Fluctuations in Emerging Economies

    View code

  5. 2010 · Rampini & Viswanathan

    Collateral, Risk Management, and the Distribution of Debt Capacity

    View code

  6. 2011 · Bianchi

    Overborrowing and Systemic Externalities in the Business Cycle

    View code

  7. 2014 · Schmitt-Grohé & Uribe

    Finite-State Approximation of VAR Processes: A Simulation Approach

    View code

  8. 2022 · Arce et al.

    A Macroprudential Theory of Foreign Reserve Accumulation

    View code

High-Dimensional Dynamic Programming

Notebooks comparing methods for solving occasionally binding constraint and sovereign default models. Each notebook can be viewed in the browser, inspected on GitHub, or downloaded directly.

JAX-based methods

Implementations using accelerated array computation and automatic differentiation in Python.

  1. JAX · Python

    Occasionally Binding Constraints Model

  2. JAX · Python

    Sovereign Default Model with Long-Term Debt

Adaptive Sparse Grids

Julia and Python implementations using sparse-grid approximation to manage higher-dimensional state spaces.

  1. ASG · Julia

    Occasionally Binding Constraints Model

  2. ASG · Python

    Occasionally Binding Constraints Model

  3. ASG · Julia

    Sovereign Default Model with Long-Term Debt

Artificial Neural Networks

Neural-network function approximation using Flux.jl and PyTorch.

  1. ANN · Flux.jl

    Occasionally Binding Constraints Model

  2. ANN · PyTorch

    Occasionally Binding Constraints Model