Skip to content

Commit 75157a1

Browse files
jstacclaude
andcommitted
Add transient income innovation to IFP model and wealth inequality analysis
This commit modifies the income fluctuation problem (IFP) model to include a transient IID income shock, following the specification in ifp_advanced. Changes to ifp_egm.md: 1. Income process modification: - Changed from Y_t = exp(Z_t) to Y_t = exp(a_y * η_t + Z_t * b_y) - Added IID shock η_t ~ N(0,1) to create transient income fluctuations - Updated Euler equation to integrate over η shocks using Monte Carlo - Kept interest rate R constant throughout (as specified) 2. Implementation updates: - Added parameters a_y=0.2, b_y=0.5, shock_draw_size=100 - Updated NumPy implementation with numba.jit optimization - Updated JAX implementation with separate utility functions - Modified simulation code to draw η shocks during dynamics - Updated all code cells to unpack new IFP parameters 3. New wealth inequality analysis section: - Added Gini coefficient computation - Added top 1% wealth share computation - Analyzed how inequality varies with interest rate r - Tested 12 interest rate values from 0 to 0.015 - Generated plots showing Gini and top 1% vs interest rate 4. Performance optimization: - Added @numba.jit decorators to u_prime, u_prime_inv, Y, and K_numpy - Created separate JAX versions to avoid numba/JAX conflicts Changes to ifp_advanced.md: - Updated shock_draw_size from 50 to 100 in both Numba and JAX implementations The modifications maintain consistency with ifp_advanced while keeping R constant in ifp_egm. The transient income shock creates more realistic wealth inequality through increased precautionary savings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a0b5dfc commit 75157a1

File tree

2 files changed

+276
-75
lines changed

2 files changed

+276
-75
lines changed

lectures/ifp_advanced.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ class IFP:
376376
b_r=0.0,
377377
a_y=0.2,
378378
b_y=0.5,
379-
shock_draw_size=50,
379+
shock_draw_size=100,
380380
grid_max=10,
381381
grid_size=100,
382382
seed=1234):
@@ -665,7 +665,7 @@ def create_ifp_jax(γ=1.5,
665665
b_r=0.0,
666666
a_y=0.2,
667667
b_y=0.5,
668-
shock_draw_size=50,
668+
shock_draw_size=100,
669669
grid_max=10,
670670
grid_size=100,
671671
seed=1234):

0 commit comments

Comments
 (0)