Commit a7caa6b
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
3 files changed
+442
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments