Skip to content

econ-ark/Aiyagari1994QJE

 
 

Repository files navigation

Aiyagari (1994QJE): Uninsured Idiosyncratic Risk and Aggregate Saving

Binder

Overview

This repository provides a computational implementation of the seminal Aiyagari (1994) model of uninsured idiosyncratic risk and aggregate saving. The model demonstrates how precautionary saving motives and liquidity constraints affect aggregate economic outcomes in a heterogeneous agent framework.

Key Features

  • Two Solution Approaches: MarkovConsumerType and DolARK methods using the HARK framework
  • Complete Parameter Replication: All parameter combinations from original Aiyagari (1994) Table II
  • High Accuracy Results: Replication within 0.05 percentage points for interest rates
  • Modern Tools: Poetry and conda environment management for reproducibility
  • Educational Focus: Detailed documentation for learning heterogeneous agent models

Quick Start

Option 1: Poetry (Recommended for Development)

# Install dependencies
poetry install

# Run quick demonstration (one notebook, ~5 minutes)
./reproduce_min.sh

# Run full reproduction (both notebooks, ~20 minutes)
./reproduce.sh

Option 2: Conda (MyBinder Compatible)

# Create environment
conda env create -f binder/environment.yml
conda activate Aiyagari1994QJE

# Run reproduction
./reproduce.sh

Option 3: Cloud Execution

Click the Binder badge above to run in your browser without local installation.

Repository Contents

Notebooks

  • AiyagariMarkovHARK.ipynb: Primary implementation using MarkovConsumerType

    • Detailed equilibrium analysis
    • Complete parameter space exploration
    • Comparison with original Aiyagari results
  • AiyagariDolARK.ipynb: Alternative implementation using DolARK methods

    • Different solution approach for verification
    • Computational method comparison

Key Files

  • CITATION.cff: Bibliographic metadata for proper citation
  • reproduce.sh: Complete reproduction script (both notebooks)
  • reproduce_min.sh: Quick demonstration script (primary notebook only)
  • pyproject.toml: Poetry configuration for local development
  • binder/environment.yml: Conda environment for reproducibility

Model Description

The Aiyagari model features:

  • Heterogeneous Agents: Infinitely-lived households facing idiosyncratic income shocks
  • Incomplete Markets: No insurance against individual income risk
  • Borrowing Constraints: Agents cannot borrow against future income
  • Precautionary Saving: Individual risk leads to aggregate capital accumulation
  • Equilibrium Analysis: Endogenous interest rate clears asset market

Key Results

This implementation successfully replicates:

  • Table II from Aiyagari (1994): Interest rates and saving rates across parameter combinations
  • Parameter Effects: How risk aversion (θ), income persistence (ρ), and volatility (σ) affect outcomes
  • Comparative Statics: Systematic analysis of equilibrium responses

Educational Applications

Prerequisites

  • Graduate-level macroeconomic theory
  • Some Python programming experience
  • Basic dynamic programming knowledge
  • Familiarity with numerical methods

Learning Objectives

  • Understand incomplete markets with heterogeneous agents
  • Master HARK computational framework
  • Analyze precautionary saving effects
  • Compare numerical with analytical solutions

Technical Implementation

Solution Methods

  • Tauchen Discretization: AR(1) income process → discrete Markov chain
  • Value Function Iteration: Individual dynamic programming
  • Bisection Search: Equilibrium interest rate computation
  • Monte Carlo Simulation: Aggregate consistency verification

Computational Features

  • Vectorized operations for efficiency
  • Robust numerical methods
  • Comprehensive error handling
  • Detailed logging and progress tracking

Citation

If you use this implementation, please cite:

@software{edwards2024aiyagari,
  author = {Edwards, Adam},
  title = {Aiyagari (1994QJE): Uninsured Idiosyncratic Risk and Aggregate Saving - Computational Implementation},
  url = {https://github.com/econ-ark/Aiyagari1994QJE},
  version = {1.0.0},
  year = {2024}
}

And the original paper:

@article{aiyagari1994uninsured,
  title = {Uninsured idiosyncratic risk and aggregate saving},
  author = {Aiyagari, S. Rao},
  journal = {The Quarterly Journal of Economics},
  volume = {109},
  number = {3},
  pages = {659--684},
  year = {1994},
  publisher = {Oxford University Press},
  doi = {10.2307/2118417}
}

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Contributing

This is part of the Econ-ARK project. For questions or contributions, please:

  1. Check the Econ-ARK documentation
  2. Open an issue on GitHub
  3. Contact the development team

Acknowledgments

  • Original Research: S. Rao Aiyagari (1994)
  • Implementation: Adam Edwards, Johns Hopkins University
  • Framework: HARK development team
  • Infrastructure: Econ-ARK project

About

Adam Edwards' version of Aiyagari

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 97.9%
  • Shell 2.1%