Skip to content

Commit a7caa6b

Browse files
jstacclaude
andcommitted
Add IFP II lecture on Optimistic Policy Iteration
- New ifp_opi.md lecture implementing OPI for income fluctuation problem - Uses Model NamedTuple structure consistent with ifp_discrete.md - Implements policy operator T_σ and iterate_policy_operator - Provides comprehensive timing comparisons between VFI and OPI - Shows 2-2.5x speedup from OPI over VFI - Includes exercise exploring parameter sensitivity - Update _toc.yml to include ifp_opi between ifp_discrete and ifp_egm - Update ifp_egm.md title from "IFP II" to "IFP III" - Reflects new lecture ordering with OPI as second lecture Technical highlights: - Uses @jax.jit decorators and jax.lax.while_loop for performance - Properly handles JAX traced values with jnp.where instead of Python if - Tests multiple values of m (policy iteration steps) to find optimal - Visualization comparing OPI performance across different m values Tested: Converts to Python and runs successfully with realistic speedups 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 09c8a0e commit a7caa6b

File tree

3 files changed

+442
-1
lines changed

3 files changed

+442
-1
lines changed

lectures/_toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ parts:
8585
numbered: true
8686
chapters:
8787
- file: ifp_discrete
88+
- file: ifp_opi
8889
- file: ifp_egm
8990
- file: ifp_advanced
9091
- caption: LQ Control

lectures/ifp_egm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ kernelspec:
1919
</div>
2020
```
2121

22-
# {index}`IFP II: The Endogenous Grid Method <single: IFP II: The Endogenous Grid Method>`
22+
# {index}`IFP III: The Endogenous Grid Method <single: IFP III: The Endogenous Grid Method>`
2323

2424
```{contents} Contents
2525
:depth: 2

0 commit comments

Comments
 (0)