Code & Data

Impulse, Response, and Anticipation in Trajectory-Space Jacobians

2025

This paper presents a simple method of calculating the continuous-time transition path of a heterogeneous-agent economy in steady state in response to a perturbation path (aka MIT shock path) affecting a price or another variable. In other words, it is a continuous-time counterpart of (Auclert et al. 2021). The goal is to introduce a method that satisfies the following criteria to the extent possible: efficiency, simplicity (e.g., no analytical derivative is needed) and general applicability. The method has three main building block: Dirac’s Delta function for impulses, fast matrix exponentiation methods for forward response path, and a simple linearisation theorem to capture the anticipation effects backwards. [Code and Draft Coming Soon]

Impulse, Response, and Anticipation in Trajectory-Space Jacobians

Model with Two Assets and Kinked Adjustment Costs (HANK)

2024

We introduce a new algorithm for solving continuous time problems with multiple endogenous state variables in a finite–difference scheme. The algorithm extends the logic of up–winding to its logical extreme in a way that meets the necessary conditions for local convergence (Barles and Souganidis, 1991). It is consistent because the directions of state–drift are never in conflict, and constraints are applied non–linearly. It is efficient because it nests the search for these state–drifts in a way that ensures costly root–finding is only performed after other alternatives are exhausted. The algorithm improves on the existing ‘split–drift’ approach from (Kaplan et al., 2018; Achdou et al., 2022), which can fail under some parameter settings because it is not guaranteed to be consistent.

Model with Two Assets and Kinked Adjustment Costs (HANK)

Aiyagari Model with Non-homothetic CES Preferences and Multiple Sectors: Steady State and Transition

2022

How to robustly solve for the steady state and transition paths of an Aiyagari model in continuous-time with non-homothetic CES preferences (as in Lashkari-et-al (2021)) and three sectors? The Matlab code below proposes an algorithm based on a predefined approximation of inverse of marginal utility of expenditure using the so-called ‘Chebyshev technology’. Transition path in response to one or several series of MIT shocks can be efficiently solved for, using a first-order perturbation of the approximant of the inverse of marginal utility and perturbed relative prices along the transition path. The code is written for three sectors, but the code remain as efficient for large number of sectors (as long as the production functions are static and relative prices can be solved for as it is with the current model). The implementation below uses the excellent ‘Chebfun’ package of Matlab, but a similar implementation is available in Julia (upon request).

Aiyagari Model with Non-homothetic CES Preferences and Multiple Sectors: Steady State and Transition

Two Endogenous State Variables in Continuous-Time: Wealth and Human Capital

2020

This note describes a deterministic human capital accumulation problem in continuous time with one financial asset, and offers a solution algorithm using the finite-difference method. Agents can accumulate financial assets and human capital by dividing their time between labor and education. Human capital is accumulated via a DRS production function and depreciates over time. Labor income receives a wage per unit of time worked and per unit of human capital.

Two Endogenous State Variables in Continuous-Time: Wealth and Human Capital