You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve cake eating lecture with exercises and fixes
- Add new exercise (cep_ex2) asking readers to verify that the optimal
policy satisfies the Euler equation, with complete solution
- Fix grammatical errors: missing "as" in comparison, subject-verb
agreement ("Here are" vs "Here's"), and missing article "a"
- Add note clarifying differentiability assumption of value function in
Derivation II with reference to EDTC theorem 10.1.13
- Improve readability and consistency throughout the lecture
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
@@ -30,14 +30,15 @@ progressively more challenging---and useful---problems.
30
30
31
31
The main tool we will use to solve the cake eating problem is dynamic programming.
32
32
33
-
Readers might find it helpful to review the following lectures before reading this one:
33
+
The following lectures contain background on dynamic programming and might be
34
+
worth reviewing:
34
35
35
36
* The {doc}`shortest paths lecture <intro:short_path>`
36
37
* The {doc}`basic McCall model <mccall_model>`
37
38
* The {doc}`McCall model with separation <mccall_model_with_separation>`
38
39
* The {doc}`McCall model with separation and a continuous wage distribution <mccall_fitted_vfi>`
39
40
40
-
In what follows, we require the following imports:
41
+
We require the following imports:
41
42
42
43
```{code-cell} ipython
43
44
import matplotlib.pyplot as plt
@@ -46,7 +47,7 @@ import numpy as np
46
47
47
48
## The model
48
49
49
-
We consider an infinite time horizon $t=0, 1, 2, 3..$
50
+
We consider a discrete time model with an infinite time horizon.
50
51
51
52
At $t=0$ the agent is given a complete cake with size $\bar x$.
52
53
@@ -55,13 +56,12 @@ so that, in particular, $x_0=\bar x$.
55
56
56
57
We choose how much of the cake to eat in any given period $t$.
57
58
58
-
After choosing to consume $c_t$ of the cake in period $t$ there is
59
+
After choosing to consume $c_t$ of the cake in period $t$, the amount left in period $t+1$ is
59
60
60
61
$$
61
-
x_{t+1} = x_t - c_t
62
+
x_{t+1} = x_t - c_t
62
63
$$
63
64
64
-
left in period $t+1$.
65
65
66
66
Consuming quantity $c$ of the cake gives current utility $u(c)$.
67
67
@@ -98,15 +98,14 @@ subject to
98
98
```{math}
99
99
:label: cake_feasible
100
100
101
-
x_{t+1} = x_t - c_t
102
-
\quad \text{and} \quad
103
-
0\leq c_t\leq x_t
101
+
x_{t+1} = x_t - c_t
102
+
\quad \text{and} \quad
103
+
0\leq c_t\leq x_t
104
104
```
105
105
106
106
for all $t$.
107
107
108
-
A consumption path $\{c_t\}$ satisfying {eq}`cake_feasible` where
109
-
$x_0 = \bar x$ is called **feasible**.
108
+
A consumption path $\{c_t\}$ satisfying {eq}`cake_feasible` where $x_0 = \bar x$ is called **feasible**.
110
109
111
110
In this problem, the following terminology is standard:
112
111
@@ -122,7 +121,7 @@ The key trade-off in the cake-eating problem is this:
122
121
* But delaying some consumption is also attractive because $u$ is concave.
123
122
124
123
The concavity of $u$ implies that the consumer gains value from
125
-
*consumption smoothing*, which means spreading consumption out over time.
124
+
**consumption smoothing**, which means spreading consumption out over time.
126
125
127
126
This is because concavity implies diminishing marginal utility---a progressively smaller gain in utility for each additional spoonful of cake consumed within one period.
128
127
@@ -132,18 +131,16 @@ The reasoning given above suggests that the discount factor $\beta$ and the curv
132
131
133
132
Here's an educated guess as to what impact these parameters will have.
134
133
135
-
First, higher $\beta$ implies less discounting, and hence the agent is more patient, which should reduce the rate of consumption.
136
-
137
-
Second, higher $\gamma$ implies that marginal utility $u'(c) =
138
-
c^{-\gamma}$ falls faster with $c$.
134
+
1. Higher $\beta$ implies less discounting, and hence the agent is more patient, which should reduce the rate of consumption.
135
+
2. Higher $\gamma$ implies that marginal utility $u'(c) = c^{-\gamma}$ falls faster with $c$.
139
136
140
137
This suggests more smoothing, and hence a lower rate of consumption.
141
138
142
-
In summary, we expect the rate of consumption to be *decreasing in both
143
-
parameters*.
139
+
In summary, we expect the rate of consumption to be decreasing in both parameters.
144
140
145
141
Let's see if this is true.
146
142
143
+
147
144
## The value function
148
145
149
146
The first step of our dynamic programming treatment is to obtain the Bellman
0 commit comments