Skip to content

Commit 81bd714

Browse files
jstacclaude
andcommitted
Add IFP I lecture and restructure IFP series
- Add new ifp_discrete.md as "IFP I: Discretization and VFI" - Implements income fluctuation problem using discretization and value function iteration - Uses Model NamedTuple for clean parameter management - Includes both Python loop and jax.lax.while_loop implementations for comparison - Demonstrates proper JAX benchmarking with block_until_ready() - Shows 3-4x speedup from using jax.lax.while_loop over plain Python - Converts vmap implementation section to exercise format - Rename ifp.md to ifp_egm.md as "IFP II: The Endogenous Grid Method" - Updated title and cross-references - Maintains continuity with new IFP I lecture - Update _toc.yml to reflect new lecture order - Update cross-references in ifp_advanced.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 083a4f3 commit 81bd714

File tree

4 files changed

+515
-29
lines changed

4 files changed

+515
-29
lines changed

lectures/_toc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ parts:
8484
- caption: Household Problems
8585
numbered: true
8686
chapters:
87-
- file: ifp
87+
- file: ifp_discrete
88+
- file: ifp_egm
8889
- file: ifp_advanced
8990
- caption: LQ Control
9091
numbered: true

lectures/ifp_advanced.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ tags: [hide-output]
3434

3535
## Overview
3636

37-
In this lecture, we continue our study of the {doc}`income fluctuation problem <ifp>`.
37+
In this lecture, we continue our study of the income fluctuation problem described in {doc}`ifp_egm`.
3838

3939
While the interest rate was previously taken to be fixed, we now allow
4040
returns on assets to be state-dependent.
@@ -112,7 +112,7 @@ where
112112

113113
Let $P$ represent the Markov matrix for the chain $\{Z_t\}_{t \geq 0}$.
114114

115-
Our assumptions on preferences are the same as our {doc}`previous lecture <ifp>` on the income fluctuation problem.
115+
Our assumptions on preferences are the same as in {doc}`ifp_egm`.
116116

117117
As before, $\mathbb E_z \hat X$ means expectation of next period value
118118
$\hat X$ given current value $Z = z$.
@@ -160,8 +160,7 @@ the IID and CRRA environment of {cite}`benhabib2015`.
160160

161161
### Optimality
162162

163-
Let the class of candidate consumption policies $\mathscr C$ be defined
164-
{doc}`as before <ifp>`.
163+
Let the class of candidate consumption policies $\mathscr C$ be defined as in {doc}`ifp_egm`.
165164

166165
In {cite}`ma2020income` it is shown that, under the stated assumptions,
167166

@@ -182,8 +181,7 @@ In the present setting, the Euler equation takes the form
182181
\right\}
183182
```
184183

185-
(Intuition and derivation are similar to our {doc}`earlier lecture <ifp>` on
186-
the income fluctuation problem.)
184+
(Intuition and derivation are similar to {doc}`ifp_egm`.)
187185

188186
We again solve the Euler equation using time iteration, iterating with a
189187
Coleman--Reffett operator $K$ defined to match the Euler equation
@@ -197,8 +195,7 @@ Coleman--Reffett operator $K$ defined to match the Euler equation
197195
### A Time Iteration Operator
198196

199197
Our definition of the candidate class $\sigma \in \mathscr C$ of consumption
200-
policies is the same as in our {doc}`earlier lecture <ifp>` on the income
201-
fluctuation problem.
198+
policies is the same as in {doc}`ifp_egm`.
202199

203200
For fixed $\sigma \in \mathscr C$ and $(a,z) \in \mathbf S$, the value
204201
$K\sigma(a,z)$ of the function $K\sigma$ at $(a,z)$ is defined as the
@@ -578,7 +575,7 @@ In contrast, when $z=1$ (good state), higher expected future income allows the h
578575
Let's try to get some idea of what will happen to assets over the long run
579576
under this consumption policy.
580577

581-
As with our {doc}`earlier lecture <ifp>` on the income fluctuation problem, we
578+
As in {doc}`ifp_egm`, we
582579
begin by producing a 45 degree diagram showing the law of motion for assets
583580

584581
```{code-cell} python3

0 commit comments

Comments
 (0)