Skip to content

Commit 29e7a3f

Browse files
committed
update sources from lecture-python (4ca0fd7) using tomyst (b06cacb)
1 parent 1c36e05 commit 29e7a3f

File tree

7 files changed

+14
-17
lines changed

7 files changed

+14
-17
lines changed

lectures/cass_koopmans_2.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,9 @@ for T in T_arr:
835835
for i, ax in enumerate(axs.flatten()):
836836
ax.plot(paths[i])
837837
ax.set(title=titles[i], ylabel=ylabels[i], xlabel='t')
838-
if titles[i] is 'Capital':
838+
if titles[i] == 'Capital':
839839
ax.axhline(k_ss, lw=1, ls='--', c='k')
840-
if titles[i] is 'Consumption':
840+
if titles[i] == 'Consumption':
841841
ax.axhline(c_ss, lw=1, ls='--', c='k')
842842
843843
plt.tight_layout()
@@ -871,9 +871,9 @@ for γ in γ_arr:
871871
for i, ax in enumerate(axs.flatten()):
872872
ax.plot(paths[i], label=f'$\gamma = {γ}$')
873873
ax.set(title=titles[i], ylabel=ylabels[i], xlabel='t')
874-
if titles[i] is 'Capital':
874+
if titles[i] == 'Capital':
875875
ax.axhline(k_ss, lw=1, ls='--', c='k')
876-
if titles[i] is 'Consumption':
876+
if titles[i] == 'Consumption':
877877
ax.axhline(c_ss, lw=1, ls='--', c='k')
878878
879879
axs[0, 0].legend()

lectures/complex_and_trig.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ eq1 = Eq(x1/x0 - r * cos(ω+θ) / cos(ω), 0)
310310
print(f'ω = {ω:1.3f}')
311311
312312
# Solve for p
313-
eq2 = Eq(x0 - 2 * p * cos(ω))
313+
eq2 = Eq(x0 - 2 * p * cos(ω), 0)
314314
p = nsolve(eq2, p, 0)
315315
p = np.float(p)
316316
print(f'p = {p:1.3f}')

lectures/finite_markov.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ all ways this can happen and sum their probabilities.
376376

377377
Rewriting this statement in terms of marginal and conditional probabilities gives
378378

379-
(mc_fdd)=
380379
$$
381380
\psi_{t+1}(y) = \sum_{x \in S} P(x,y) \psi_t(x)
382381
$$
@@ -385,7 +384,6 @@ There are $n$ such equations, one for each $y \in S$.
385384

386385
If we think of $\psi_{t+1}$ and $\psi_t$ as *row vectors* (as is traditional in this literature), these $n$ equations are summarized by the matrix expression
387386

388-
(mc_fddv)=
389387
```{math}
390388
:label: fin_mc_fr
391389
@@ -398,7 +396,6 @@ By repeating this $m$ times we move forward $m$ steps into the future.
398396

399397
Hence, iterating on {eq}`fin_mc_fr`, the expression $\psi_{t+m} = \psi_t P^m$ is also valid --- here $P^m$ is the $m$-th power of $P$.
400398

401-
(mc_exfmar)=
402399
As a special case, we see that if $\psi_0$ is the initial distribution from
403400
which $X_0$ is drawn, then $\psi_0 P^m$ is the distribution of
404401
$X_m$.

lectures/mccall_correlated.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ for c in c_vals:
329329
js = JobSearch(c=c)
330330
f_star = compute_fixed_point(js, verbose=False)
331331
res_wage_function = np.exp(f_star * (1 - js.β))
332-
ax.plot(js.z_grid, res_wage_function, label=f"$\\bar w$ at $c = {c}$")
332+
ax.plot(js.z_grid, res_wage_function, label=rf"$\bar w$ at $c = {c}$")
333333
334334
ax.set(xlabel="$z$", ylabel="wage")
335335
ax.legend()
@@ -440,7 +440,7 @@ for i, β in enumerate(beta_vals):
440440
```{code-cell} ipython3
441441
fig, ax = plt.subplots()
442442
ax.plot(beta_vals, durations)
443-
ax.set_xlabel("$\\beta$")
443+
ax.set_xlabel(r"$\beta$")
444444
ax.set_ylabel("mean unemployment duration")
445445
plt.show()
446446
```

lectures/navy_captain.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ this lecture {doc}`Exchangeability and Bayesian Updating <exchangeable>` and in
7070
{doc}`Likelihood Ratio Processes <likelihood_ratio_process>`, which describes the link between Bayesian
7171
updating and likelihood ratio processes.
7272

73-
The present lecture uses Python to generate simulations that evaluate expected losses under **frequentist** and **Bayesian**
74-
decision rules for a instances of the Navy Captain's decision problem.
73+
The present lecture uses Python to generate simulations that evaluate expected losses under **frequentist** and **Bayesian**
74+
decision rules for an instance of the Navy Captain's decision problem.
7575

7676
The simulations validate the Navy Captain's hunch that there is a better rule than the one the Navy had ordered him
7777
to use.
@@ -130,7 +130,7 @@ def p(x, a, b):
130130
```
131131

132132
We start with defining a `jitclass` that stores parameters and
133-
functions we need to solve problems for both the bayesian and
133+
functions we need to solve problems for both the Bayesian and
134134
frequentist Navy Captains.
135135

136136
```{code-cell} python3

lectures/odu.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ plt.show()
445445
```
446446

447447
The results fit well with our intuition from section [looking
448-
forward](#looking-forward).
448+
forward](#Looking-Forward).
449449

450450
- The black line in the figure above corresponds to the function
451451
$\bar w(\pi)$ introduced there.
@@ -1057,10 +1057,10 @@ $f$?
10571057

10581058
Two countervailing effects are at work.
10591059

1060-
- if f generates successive wage offers, then $w$ is more likely to be low, but
1060+
- if $f$ generates successive wage offers, then $w$ is more likely to be low, but
10611061
$\pi$ is moving up toward to 1, which lowers the reservation wage,
10621062
i.e., the worker becomes less selective the longer he or she remains unemployed.
1063-
- if g generates wage offers, then $w$ is more likely to be high, but
1063+
- if $g$ generates wage offers, then $w$ is more likely to be high, but
10641064
$\pi$ is moving downward toward 0, increasing the reservation wage, i.e., the worker becomes more selective
10651065
the longer he or she remains unemployed.
10661066

lectures/short_path.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ We wish to travel from node (vertex) A to node G at minimum cost
6767
* Arrows (edges) indicate the movements we can take.
6868
* Numbers on edges indicate the cost of traveling that edge.
6969

70-
(Graphs such as the one above are called **weighted `directed graphs <https://en.wikipedia.org/wiki/Directed_graph>`_**.)
70+
(Graphs such as the one above are called weighted [directed graphs](https://en.wikipedia.org/wiki/Directed_graph).)
7171

7272
Possible interpretations of the graph include
7373

0 commit comments

Comments
 (0)