Skip to content

Conversation

@jstac
Copy link
Contributor

@jstac jstac commented Nov 5, 2025

Summary

This PR adds a new lecture aiyagari_egm.md that combines the Aiyagari model with the Endogenous Grid Method (EGM).

Overview:

The lecture combines two important computational methods:

  • Aiyagari model - a heterogeneous agent model with incomplete markets
  • Endogenous Grid Method (EGM) - an efficient algorithm for solving dynamic programming problems

Key Features:

  • Combines concepts from egm_policy_iter.md and aiyagari.md
  • Uses EGM to solve the household problem (avoiding costly root-finding)
  • Uses simulation to compute aggregate capital (instead of analytical stationary distribution)
  • EGM operator for the Aiyagari model - Corrected implementation, converges in ~90 iterations
  • Simulation-based aggregation - Simulates 10,000+ households via Monte Carlo
  • Equilibrium computation - Uses bisection to find equilibrium capital stock (K* ≈ 8)
  • Wealth distribution analysis - Histograms, Lorenz curves, and Gini coefficient
  • Educational content - Comparison with standard approach and four exercises

Implementation Details:

Fixes Applied:

  • EGM operator: Corrected endogenous grid computation
  • Asset grid: Increased a_max from 20 to 50 to handle high savings rates
  • Simulation: Added asset clipping to prevent extrapolation issues

Files changed:

  • lectures/_toc.yml - Added entry for new lecture
  • lectures/aiyagari_egm.md - New lecture file

Test plan

  • All code cells are functional
  • EGM iteration converges properly
  • Simulation produces stable results
  • Equilibrium computation works correctly
  • Wealth distribution can be computed

🤖 Generated with Claude Code

This PR adds a new lecture aiyagari_egm.md that combines the Aiyagari model with the Endogenous Grid Method (EGM).

Key Features:
- Combines concepts from egm_policy_iter.md and aiyagari.md
- Uses EGM to solve the household problem (avoiding costly root-finding)
- Uses simulation to compute aggregate capital (instead of analytical stationary distribution)
- EGM operator for the Aiyagari model - Corrected implementation, converges in ~90 iterations
- Simulation-based aggregation - Simulates 10,000+ households via Monte Carlo
- Equilibrium computation - Uses bisection to find equilibrium capital stock (K* ≈ 8)
- Wealth distribution analysis - Histograms, Lorenz curves, and Gini coefficient
- Educational content - Comparison with standard approach and four exercises

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

📖 Netlify Preview Ready!

Preview URL: https://pr-676--sunny-cactus-210e3e.netlify.app (647e41e)

📚 Changed Lecture Pages: aiyagari, aiyagari_egm, endogenous_lake

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

📖 Netlify Preview Ready!

Preview URL: https://pr-676--sunny-cactus-210e3e.netlify.app (6b3e4e5)

📚 Changed Lecture Pages: aiyagari, aiyagari_egm, endogenous_lake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants