---
title: README
---

# The Endogenous Grid Method for Epstein-Zin Preferences

[![arXiv](https://img.shields.io/badge/arXiv-2601.04438-b31b1b.svg)](https://arxiv.org/abs/2601.04438) [![SSRN](https://img.shields.io/badge/SSRN-6048966-blue.svg)](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6048966) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18176983.svg)](https://doi.org/10.5281/zenodo.18176983)

*Solving consumption-savings problems with recursive utility*

**Alan Lujan** [![ORCID](https://img.shields.io/badge/ORCID-0000--0002--5289--7054-green)](https://orcid.org/0000-0002-5289-7054)

Krieger School of Arts and Sciences, Johns Hopkins University, Washington, DC 20036, USA; [Econ-ARK](https://econ-ark.org)

Corresponding author: alujan@jhu.edu

---

## Abstract

The endogenous grid method (EGM) accelerates dynamic programming by inverting the Euler equation. This paper derives an EGM algorithm for consumption-savings problems with Epstein-Zin preferences. The transformation $W = V^{1-\rho}$ recasts the Epstein-Zin certainty equivalent as a power mean whose inverse exists in closed form, and the EGM update applies that inverse at each grid point. Because the inversion is pointwise, the construction does not depend on the dimensionality of the state space; this paper presents the one-asset case, and the same inversion combines naturally with multi-asset and life-cycle settings. The resulting algorithm requires no root-finding, runs one to two orders of magnitude faster than value function iteration, and improves accuracy by more than one order of magnitude; at equal accuracy the speedup over value function iteration is two to three orders of magnitude. In a benchmark calibration with risk aversion 10 and elasticity of intertemporal substitution 1.5, the method solves the infinite-horizon problem on 100 grid points in 13 milliseconds with mean $\log_{10}$ Euler error of $-4.8$, and the welfare cost of the approximation is below 0.1% of permanent consumption.

---

## Highlights

- Power transformation $W = V^{1-\rho}$ extends EGM to Epstein-Zin preferences
- Algorithm eliminates root-finding while tracking policy and value
- Speed gains of 17x over time iteration (TI) and 60x over value function iteration (VFI); 166-744x over VFI at equal accuracy
- Accuracy improves by over one order of magnitude versus VFI and TI
- Method generalizes to risk-sensitive preferences and limiting cases

---

## Keywords

Endogenous grid method; Epstein-Zin preferences; Recursive utility; Dynamic programming; Consumption-savings

**JEL Classification:** C61, C63, D15

---

## Requirements

- Python >= 3.12
- JAX, NumPy, SciPy, Numba, QuantEcon, Matplotlib

Install dependencies with:

```bash
uv sync
```

---

## Reproducibility

Code to reproduce all results is available at <https://github.com/alanlujan91/ezegm>.

To run the benchmarks:

```bash
cd code
uv run python benchmark_paper.py
```

---

## Data Availability

This project contains only code; no external datasets are required. All results can be reproduced using the code in this repository.

---

## Citation

If you use this code, please cite:

```bibtex
@article{lujan2026egm,
  title={The Endogenous Grid Method for Epstein-Zin Preferences},
  author={Lujan, Alan},
  year={2026},
  doi={10.2139/ssrn.6048966},
  url={https://github.com/alanlujan91/ezegm}
}
```

---

## License

- **Content:** [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)
- **Code:** [MIT](https://opensource.org/licenses/MIT)

(c) 2026 Alan Lujan

---

## Acknowledgments

I am grateful to Christopher D. Carroll for years of mentorship, for detailed feedback on this paper, and for sustained support throughout my career. I also thank Matthew N. White for extensive discussions and collaboration that shaped this work, Jeppe Druedahl for helpful comments, John Stachurski for valuable discussions, and an anonymous referee for comments that substantially improved the paper's positioning.

---

## Funding

This work was supported by the Alfred P. Sloan Foundation [[G-2025-79177](https://sloan.org/grant-detail/g-2025-79177)].

---

## Declaration of Generative AI and AI-Assisted Technologies in the Manuscript Preparation Process

During the preparation of this work the author used Claude (Anthropic) to assist with code development and manuscript editing. After using this tool, the author reviewed and edited the content as needed and takes full responsibility for the content of the published article.
