Skip to content

Commit 67027a5

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-6
2 parents a26c065 + 089e35c commit 67027a5

22 files changed

+1308
-319
lines changed

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77
- pip
88
- pip:
99
- jupyter-book==1.0.4post1
10-
- quantecon-book-theme==0.13.0
10+
- quantecon-book-theme==0.13.2
1111
- sphinx-tojupyter==0.4.0
1212
- sphinxext-rediraffe==0.2.7
1313
- sphinx-exercise==1.2.0

lectures/_toc.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,21 @@ parts:
7272
- file: jv
7373
- file: odu
7474
- file: mccall_q
75+
- caption: Introduction to Optimal Savings
76+
numbered: true
77+
chapters:
78+
- file: os
79+
- file: os_numerical
80+
- file: os_stochastic
81+
- file: os_time_iter
82+
- file: os_egm
83+
- file: os_egm_jax
7584
- caption: Household Problems
7685
numbered: true
7786
chapters:
78-
- file: cake_eating
79-
- file: cake_eating_numerical
80-
- file: cake_eating_stochastic
81-
- file: cake_eating_time_iter
82-
- file: cake_eating_egm
83-
- file: cake_eating_egm_jax
84-
- file: ifp
87+
- file: ifp_discrete
88+
- file: ifp_opi
89+
- file: ifp_egm
8590
- file: ifp_advanced
8691
- caption: LQ Control
8792
numbered: true

lectures/finite_markov.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ One natural way to answer questions about Markov chains is to simulate them.
212212

213213
(To approximate the probability of event $E$, we can simulate many times and count the fraction of times that $E$ occurs).
214214

215-
Nice functionality for simulating Markov chains exists in [QuantEcon.py](https://quantecon.org/quantecon-py).
215+
Nice functionality for simulating Markov chains exists in [QuantEcon.py](https://quantecon.org/quantecon-py/).
216216

217217
* Efficient, bundled with lots of other useful routines for handling Markov chains.
218218

219-
However, it's also a good exercise to roll our own routines --- let's do that first and then come back to the methods in [QuantEcon.py](https://quantecon.org/quantecon-py).
219+
However, it's also a good exercise to roll our own routines --- let's do that first and then come back to the methods in [QuantEcon.py](https://quantecon.org/quantecon-py/).
220220

221221
In these exercises, we'll take the state space to be $S = 0,\ldots, n-1$.
222222

@@ -231,7 +231,7 @@ The Markov chain is then constructed as discussed above. To repeat:
231231

232232
To implement this simulation procedure, we need a method for generating draws from a discrete distribution.
233233

234-
For this task, we'll use `random.draw` from [QuantEcon](https://quantecon.org/quantecon-py), which works as follows:
234+
For this task, we'll use `random.draw` from [QuantEcon](https://quantecon.org/quantecon-py/), which works as follows:
235235

236236
```{code-cell} python3
237237
ψ = (0.3, 0.7) # probabilities over {0, 1}
@@ -294,7 +294,7 @@ always close to 0.25, at least for the `P` matrix above.
294294

295295
### Using QuantEcon's Routines
296296

297-
As discussed above, [QuantEcon.py](https://quantecon.org/quantecon-py) has routines for handling Markov chains, including simulation.
297+
As discussed above, [QuantEcon.py](https://quantecon.org/quantecon-py/) has routines for handling Markov chains, including simulation.
298298

299299
Here's an illustration using the same P as the preceding example
300300

@@ -306,7 +306,7 @@ X = mc.simulate(ts_length=1_000_000)
306306
np.mean(X == 0)
307307
```
308308

309-
The [QuantEcon.py](https://quantecon.org/quantecon-py) routine is [JIT compiled](https://python-programming.quantecon.org/numba.html#numba-link) and much faster.
309+
The [QuantEcon.py](https://quantecon.org/quantecon-py/) routine is [JIT compiled](https://python-programming.quantecon.org/numba.html#numba-link) and much faster.
310310

311311
```{code-cell} ipython
312312
%time mc_sample_path(P, sample_size=1_000_000) # Our homemade code version
@@ -556,7 +556,7 @@ $$
556556
It's clear from the graph that this stochastic matrix is irreducible: we can eventually
557557
reach any state from any other state.
558558

559-
We can also test this using [QuantEcon.py](https://quantecon.org/quantecon-py)'s MarkovChain class
559+
We can also test this using [QuantEcon.py](https://quantecon.org/quantecon-py/)'s MarkovChain class
560560

561561
```{code-cell} python3
562562
P = [[0.9, 0.1, 0.0],
@@ -775,7 +775,7 @@ One option is to regard solving system {eq}`eq:eqpsifixed` as an eigenvector pr
775775
$\psi$ such that $\psi = \psi P$ is a left eigenvector associated
776776
with the unit eigenvalue $\lambda = 1$.
777777
778-
A stable and sophisticated algorithm specialized for stochastic matrices is implemented in [QuantEcon.py](https://quantecon.org/quantecon-py).
778+
A stable and sophisticated algorithm specialized for stochastic matrices is implemented in [QuantEcon.py](https://quantecon.org/quantecon-py/).
779779
780780
This is the one we recommend:
781781
@@ -1322,7 +1322,7 @@ $$
13221322
13231323
Tauchen's method {cite}`Tauchen1986` is the most common method for approximating this continuous state process with a finite state Markov chain.
13241324
1325-
A routine for this already exists in [QuantEcon.py](https://quantecon.org/quantecon-py) but let's write our own version as an exercise.
1325+
A routine for this already exists in [QuantEcon.py](https://quantecon.org/quantecon-py/) but let's write our own version as an exercise.
13261326
13271327
As a first step, we choose
13281328
@@ -1363,13 +1363,13 @@ The exercise is to write a function `approx_markov(rho, sigma_u, m=3, n=7)` that
13631363
$\{x_0, \ldots, x_{n-1}\} \subset \mathbb R$ and $n \times n$ matrix
13641364
$P$ as described above.
13651365
1366-
* Even better, write a function that returns an instance of [QuantEcon.py's](https://quantecon.org/quantecon-py) MarkovChain class.
1366+
* Even better, write a function that returns an instance of [QuantEcon.py's](https://quantecon.org/quantecon-py/) MarkovChain class.
13671367
```
13681368
13691369
```{solution} fm_ex3
13701370
:class: dropdown
13711371
1372-
A solution from the [QuantEcon.py](https://quantecon.org/quantecon-py) library
1372+
A solution from the [QuantEcon.py](https://quantecon.org/quantecon-py/) library
13731373
can be found [here](https://github.com/QuantEcon/QuantEcon.py/blob/master/quantecon/markov/approximation.py).
13741374
13751375
```

lectures/ifp_advanced.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ kernelspec:
1717
</div>
1818
```
1919

20-
# {index}`The Income Fluctuation Problem II: Stochastic Returns on Assets <single: The Income Fluctuation Problem II: Stochastic Returns on Assets>`
20+
# {index}`The Income Fluctuation Problem IV: Stochastic Returns on Assets <single: The Income Fluctuation Problem IV: Stochastic Returns on Assets>`
2121

2222
```{contents} Contents
2323
:depth: 2
@@ -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
@@ -251,7 +248,7 @@ convergence (as measured by the distance $\rho$).
251248
### Using an Endogenous Grid
252249

253250
In the study of that model we found that it was possible to further
254-
accelerate time iteration via the {doc}`endogenous grid method <cake_eating_egm>`.
251+
accelerate time iteration via the {doc}`endogenous grid method <os_egm>`.
255252

256253
We will use the same method here.
257254

@@ -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
@@ -911,7 +908,7 @@ The JAX implementation provides several advantages:
911908
```{exercise}
912909
:label: ifpa_ex1
913910
914-
Let's repeat our {ref}`earlier exercise <ifp_ex2>` on the long-run
911+
Let's repeat our {ref}`earlier exercise <ifp_egm_ex2>` on the long-run
915912
cross sectional distribution of assets.
916913
917914
In that exercise, we used a relatively simple income fluctuation model.

0 commit comments

Comments
 (0)