Skip to content

Commit 7e78afa

Browse files
authored
Update lecture-python sources with latest updates (#32)
* update sources from lecture-python (dbd838d) using sphinx-tomyst (b06cacb) * fix end of file space issue
1 parent 867e2fd commit 7e78afa

27 files changed

+270
-67
lines changed

lectures/ar1_processes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ series $\{ X_t\}$.
109109

110110
To see this, we first note that $X_t$ is normally distributed for each $t$.
111111

112-
This is immediate form {eq}`ar1_ma`, since linear combinations of independent
112+
This is immediate from {eq}`ar1_ma`, since linear combinations of independent
113113
normal random variables are normal.
114114

115115
Given that $X_t$ is normally distributed, we will know the full distribution
@@ -212,7 +212,7 @@ In fact it's easy to show that such convergence will occur, regardless of the in
212212
To see this, we just have to look at the dynamics of the first two moments, as
213213
given in {eq}`dyn_tm`.
214214

215-
When $|a| < 1$, these sequence converge to the respective limits
215+
When $|a| < 1$, these sequences converge to the respective limits
216216

217217
```{math}
218218
:label: mu_sig_star

lectures/cake_eating_numerical.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Let's write this a bit more mathematically.
100100
### The Bellman Operator
101101

102102
We introduce the **Bellman operator** $T$ that takes a function v as an
103-
argument and returns a new function $Tv$ defined by.
103+
argument and returns a new function $Tv$ defined by
104104

105105
$$
106106
Tv(x) = \max_{0 \leq c \leq x} \{u(c) + \beta v(x - c)\}
@@ -118,7 +118,7 @@ v$ converges to the solution to the Bellman equation.
118118

119119
### Fitted Value Function Iteration
120120

121-
Both consumption $c$ and the state variable $x$ are continous.
121+
Both consumption $c$ and the state variable $x$ are continuous.
122122

123123
This causes complications when it comes to numerical work.
124124

@@ -419,7 +419,7 @@ ax.legend()
419419
plt.show()
420420
```
421421

422-
The fit is reasoable but not perfect.
422+
The fit is reasonable but not perfect.
423423

424424
We can improve it by increasing the grid size or reducing the
425425
error tolerance in the value function iteration routine.
@@ -509,7 +509,7 @@ modification in the exercise above).
509509

510510
### Exercise 1
511511

512-
We need to create a class to hold our primitives and return the right hand side of the bellman equation.
512+
We need to create a class to hold our primitives and return the right hand side of the Bellman equation.
513513

514514
We will use [inheritance](https://en.wikipedia.org/wiki/Inheritance_%28object-oriented_programming%29) to maximize code reuse.
515515

lectures/cass_koopmans_1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ kernelspec:
2626

2727
## Overview
2828

29-
This lecture and in {doc}`Cass-Koopmans Competitive Equilibrium <cass_koopmans_2>` describe a model that Tjalling Koopmans {cite}`Koopmans`
29+
This lecture and lecture {doc}`Cass-Koopmans Competitive Equilibrium <cass_koopmans_2>` describe a model that Tjalling Koopmans {cite}`Koopmans`
3030
and David Cass {cite}`Cass` used to analyze optimal growth.
3131

3232
The model can be viewed as an extension of the model of Robert Solow
3333
described in [an earlier lecture](https://lectures.quantecon.org/py/python_oop.html)
3434
but adapted to make the saving rate the outcome of an optimal choice.
3535

36-
(Solow assumed a constant saving rate determined outside the model).
36+
(Solow assumed a constant saving rate determined outside the model.)
3737

3838
We describe two versions of the model, one in this lecture and the other in {doc}`Cass-Koopmans Competitive Equilibrium <cass_koopmans_2>`.
3939

@@ -696,7 +696,7 @@ its steady state value most of the time.
696696
plot_paths(pp, 0.3, k_ss/3, [250, 150, 50, 25], k_ss=k_ss);
697697
```
698698

699-
Different colors in the above graphs are associated
699+
Different colors in the above graphs are associated with
700700
different horizons $T$.
701701

702702
Notice that as the horizon increases, the planner puts $K_t$

lectures/cass_koopmans_2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ verify** approach.
397397
In this lecture {doc}`Cass-Koopmans Planning Model <cass_koopmans_1>`, we computed an allocation $\{\vec{C}, \vec{K}, \vec{N}\}$
398398
that solves the planning problem.
399399

400-
(This allocation will constitute the **Big** $K$ to be in the presence instance of the *Big** $K$ **, little** $k$ trick
400+
(This allocation will constitute the **Big** $K$ to be in the present instance of the *Big** $K$ **, little** $k$ trick
401401
that we'll apply to a competitive equilibrium in the spirit of [this lecture](https://lectures.quantecon.org/py/rational_expectations.html#)
402402
and [this lecture](https://lectures.quantecon.org/py/dyn_stack.html#).)
403403

@@ -597,7 +597,7 @@ representative household living in a competitive equilibrium.
597597
We now turn to the problem faced by a firm in a competitive
598598
equilibrium:
599599

600-
If we plug in {eq}`eq-pl` into {eq}`Zero-profits` for all t, we
600+
If we plug {eq}`eq-pl` into {eq}`Zero-profits` for all t, we
601601
get
602602

603603
$$

lectures/finite_markov.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ We'll come back to this a bit later.
603603

604604
### Aperiodicity
605605

606-
Loosely speaking, a Markov chain is called periodic if it cycles in a predictible way, and aperiodic otherwise.
606+
Loosely speaking, a Markov chain is called periodic if it cycles in a predictable way, and aperiodic otherwise.
607607

608608
Here's a trivial example with three states
609609

@@ -771,7 +771,7 @@ with the unit eigenvalue $\lambda = 1$.
771771

772772
A more stable and sophisticated algorithm is implemented in [QuantEcon.py](http://quantecon.org/quantecon-py).
773773

774-
This is the one we recommend you use:
774+
This is the one we recommend you to use:
775775

776776
```{code-cell} python3
777777
P = [[0.4, 0.6],
@@ -1023,7 +1023,7 @@ A topic of interest for economics and many other disciplines is *ranking*.
10231023
Let's now consider one of the most practical and important ranking problems
10241024
--- the rank assigned to web pages by search engines.
10251025

1026-
(Although the problem is motivated from outside of economics, there is in fact a deep connection between search ranking systems and prices in certain competitive equilibria --- see {cite}`DLP2013`)
1026+
(Although the problem is motivated from outside of economics, there is in fact a deep connection between search ranking systems and prices in certain competitive equilibria --- see {cite}`DLP2013`.)
10271027

10281028
To understand the issue, consider the set of results returned by a query to a web search engine.
10291029

lectures/heavy_tails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ where $\mu := \mathbb E X_i = \int x F(x)$ is the common mean of the sample.
186186
The condition $\mathbb E | X_i | = \int |x| F(x) < \infty$ holds
187187
in most cases but can fail if the distribution $F$ is very heavy tailed.
188188

189-
For example, it fails for the Cauchy distribution
189+
For example, it fails for the Cauchy distribution.
190190

191191
Let's have a look at the behavior of the sample mean in this case, and see
192192
whether or not the LLN is still valid.
@@ -590,7 +590,7 @@ $$
590590
2^{1/\alpha} = \exp(\mu)
591591
$$
592592

593-
which we solve for $\mu$ and $\sigma$ given $\alpha = 1.05$
593+
which we solve for $\mu$ and $\sigma$ given $\alpha = 1.05$.
594594

595595
Here is code that generates the two samples, produces the violin plot and
596596
prints the mean and standard deviation of the two samples.

lectures/ifp.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ model <optgrowth>` and yet differs in important ways.
4848

4949
For example, the choice problem for the agent includes an additive income term that leads to an occasionally binding constraint.
5050

51-
Moreover, in this and the following lectures, we will inject more realisitic
51+
Moreover, in this and the following lectures, we will inject more realistic
5252
features such as correlated shocks.
5353

5454
To solve the model we will use Euler equation based time iteration, which proved
@@ -194,7 +194,7 @@ strict inequality $u' (c_t) > \beta R \, \mathbb{E}_t u'(c_{t+1})$
194194
can occur because $c_t$ cannot increase sufficiently to attain equality.
195195

196196
(The lower boundary case $c_t = 0$ never arises at the optimum because
197-
$u'(0) = \infty$)
197+
$u'(0) = \infty$.)
198198

199199
With some thought, one can show that {eq}`ee00` and {eq}`ee01` are
200200
equivalent to
@@ -409,8 +409,7 @@ Next we provide a function to compute the difference
409409
```{math}
410410
:label: euler_diff_eq
411411
412-
u'(c)
413-
- \max \left\{
412+
u'(c) - \max \left\{
414413
\beta R \, \mathbb E_z (u' \circ \sigma) \,
415414
[R (a - c) + \hat Y, \, \hat Z]
416415
\, , \;
@@ -629,7 +628,7 @@ shocks.
629628
Your task is to investigate how this measure of aggregate capital varies with
630629
the interest rate.
631630

632-
Following tradition, put the price (i.e., interest rate) is on the vertical axis.
631+
Following tradition, put the price (i.e., interest rate) on the vertical axis.
633632

634633
On the horizontal axis put aggregate capital, computed as the mean of the
635634
stationary distribution given the interest rate.

lectures/ifp_advanced.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ It can be shown that
250250

251251
We now have a clear path to successfully approximating the optimal policy:
252252
choose some $\sigma \in \mathscr C$ and then iterate with $K$ until
253-
convergence (as measured by the distance $\rho$)
253+
convergence (as measured by the distance $\rho$).
254254

255255
### Using an Endogenous Grid
256256

@@ -325,7 +325,7 @@ $$
325325
L(z, \hat z) := P(z, \hat z) \int R(\hat z, x) \phi(x) dx
326326
$$
327327

328-
This indentity is proved in {cite}`ma2020income`, where $\phi$ is the
328+
This identity is proved in {cite}`ma2020income`, where $\phi$ is the
329329
density of the innovation $\zeta_t$ to returns on assets.
330330

331331
(Remember that $\mathsf Z$ is a finite set, so this expression defines a matrix.)
@@ -618,7 +618,7 @@ For example, we will pass in the solutions `a_star, σ_star` along with
618618
`ifp`, even though it would be more natural to just pass in `ifp` and then
619619
solve inside the function.
620620

621-
The reason we do this is because `solve_model_time_iter` is not
621+
The reason we do this is that `solve_model_time_iter` is not
622622
JIT-compiled.
623623

624624
```{code-cell} python3

lectures/inventory_dynamics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ follow so-called s-S inventory dynamics.
3434
Such firms
3535

3636
1. wait until inventory falls below some level $s$ and then
37-
1. order sufficent quantities to bring their inventory back up to capacity $S$.
37+
1. order sufficient quantities to bring their inventory back up to capacity $S$.
3838

3939
These kinds of policies are common in practice and also optimal in certain circumstances.
4040

@@ -176,7 +176,7 @@ fixed $T$.
176176
We will do this by generating many draws of $X_T$ given initial
177177
condition $X_0$.
178178

179-
With these draws of $X_T$ we can build up a picture of its distribution $\psi_T$
179+
With these draws of $X_T$ we can build up a picture of its distribution $\psi_T$.
180180

181181
Here's one visualization, with $T=50$.
182182

lectures/jv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class JVWorker:
223223
```
224224

225225
The function `operator_factory` takes an instance of this class and returns a
226-
jitted version of the Bellman operator `T`, ie.
226+
jitted version of the Bellman operator `T`, i.e.
227227

228228
$$
229229
Tv(x)

0 commit comments

Comments
 (0)