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
Fix inconsistent code-cell language specifications (#756)
* misc
* Fix inconsistent code-cell language specifications in optimal savings lectures
Standardize code-cell language specifications to eliminate jupytext UserWarnings:
- os_egm_jax.md: Change ipython to python3 (no IPython magics used)
- os_stochastic.md: Change ipython to python3 (no IPython magics used)
- os_time_iter.md: Change all cells to ipython (uses !pip install magic)
These changes ensure consistent language specifications within each notebook,
resolving warnings during jupytext conversion while maintaining functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: lectures/os_time_iter.md
+18-16Lines changed: 18 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,22 +84,23 @@ Recall the Bellman equation
84
84
```{math}
85
85
:label: cpi_fpb30
86
86
87
-
v^*(x) = \max_{0 \leq c \leq x}
87
+
v(x) = \max_{0 \leq c \leq x}
88
88
\left\{
89
-
u(c) + \beta \int v^*(f(x - c) z) \phi(dz)
89
+
u(c) + \beta \int v(f(x - c) z) \phi(dz)
90
90
\right\}
91
91
\quad \text{for all} \quad
92
92
x \in \mathbb R_+
93
93
```
94
94
95
-
Let the optimal consumption policy be denoted by $\sigma^*$.
95
+
Let $v^*$ be the value function and let $\sigma^*$ be the optimal consumption policy.
96
96
97
-
We know that $\sigma^*$ is a $v^*$-greedy policy so that $\sigma^*(x)$ is the maximizer in {eq}`cpi_fpb30`.
97
+
We know that $\sigma^*$ is a $v^*$-greedy policy.
98
98
99
99
The conditions above imply that
100
100
101
101
* $\sigma^*$ is the unique optimal policy for the optimal savings problem
102
-
* the optimal policy is continuous, strictly increasing and also **interior**, in the sense that $0 < \sigma^*(x) < x$ for all strictly positive $x$, and
102
+
* the optimal policy is continuous, strictly increasing and also **interior**,
103
+
in the sense that $0 < \sigma^*(x) < x$ for all strictly positive $x$, and
103
104
* the value function is strictly concave and continuously differentiable, with
104
105
105
106
```{math}
@@ -108,7 +109,8 @@ The conditions above imply that
The last result is called the **envelope condition** due to its relationship with the [envelope theorem](https://en.wikipedia.org/wiki/Envelope_theorem).
112
+
The last result is called the **envelope condition** due to its relationship
113
+
with the [envelope theorem](https://en.wikipedia.org/wiki/Envelope_theorem).
112
114
113
115
To see why {eq}`cpi_env` holds, write the Bellman equation in the equivalent
114
116
form
@@ -278,7 +280,7 @@ As in {doc}`os_stochastic`, we assume that
278
280
This allows us to compare our results to the analytical solutions we obtained in
279
281
that lecture:
280
282
281
-
```{code-cell}python3
283
+
```{code-cell}ipython
282
284
def v_star(x, α, β, μ):
283
285
"""
284
286
True value function
@@ -303,7 +305,7 @@ For this we need access to the functions $u'$ and $f, f'$.
303
305
304
306
We use the same `Model` structure from {doc}`os_stochastic`.
305
307
306
-
```{code-cell}python3
308
+
```{code-cell}ipython
307
309
class Model(NamedTuple):
308
310
u: Callable # utility function
309
311
f: Callable # production function
@@ -379,7 +381,7 @@ state $x$ and $σ$, the current guess of the policy.
379
381
380
382
Here's the operator $K$, that implements the root-finding step.
0 commit comments