Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/collab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
sphinx-togglebutton==0.4.5 \
arviz \
sphinx-proof==0.4.0 \
sphinx-exercise==1.2.1 \
sphinx-exercise==1.2.2 \
sphinx-reredirects==1.1.0
apt-get update
apt-get install dvipng texlive texlive-latex-extra texlive-fonts-recommended cm-super
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- quantecon-book-theme==0.22.1
- sphinx-tojupyter==0.6.0
- sphinxext-rediraffe==0.3.0
- sphinx-exercise==1.2.1
- sphinx-exercise==1.2.2
- sphinx-proof==0.4.0
- sphinxcontrib-youtube==1.5.0
- sphinx-togglebutton==0.4.5
Expand Down
12 changes: 12 additions & 0 deletions lectures/exchange_rate_learning.md
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,12 @@ To compare like with like, run the Newton–Raphson learner at Arifovic's parame
Here is part 1.

```{code-cell} ipython3
---
mystnb:
figure:
caption: "Newton-Raphson learning at Arifovic's parameters"
name: fig-xr-ex4
---
ea, sa, la = newton_learning(arifovic, [6.0, 4.0], [0.45, 0.55], T=3000)
eb, sb, lb = newton_learning(arifovic, [6.0, 4.0], [0.45, 0.55], T=3000, κ=2.0)

Expand Down Expand Up @@ -1460,6 +1466,12 @@ $\varepsilon_t \sim N(0, 1)$ and $\sigma = 1$, at Sargent's parameters.
Here are parts 1 and 2.

```{code-cell} ipython3
---
mystnb:
figure:
caption: "Limiting exchange rates from identical initial conditions"
name: fig-xr-ex5
---
T, σ = 600, 1.0
e_det = newton_learning(kw, [3.0, 2.2], [0.30, 0.50], T=T)[0][-1]

Expand Down
6 changes: 6 additions & 0 deletions lectures/genetic_classifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,12 @@ for b, P in paths.items():
The figure shows all forty paths.

```{code-cell} ipython3
---
mystnb:
figure:
caption: "GA forecasters in Bray's market"
name: fig-gc-bray-ga
---
fig, axes = plt.subplots(1, 2, figsize=(10, 4), sharey=True)
for ax, (b, P) in zip(axes, paths.items()):
ax.plot(P.T, lw=1, alpha=0.6)
Expand Down
6 changes: 6 additions & 0 deletions lectures/information_transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,12 @@ Under the coarse experiment the planner takes $a_2$ at $0.2$ and $a_1$ at $0.8$,
Under the fine experiment the planner always takes $a_2$, so each player's expected utility is the height of that player's line for $a_2$ at the prior (open dot).

```{code-cell} ipython3
---
mystnb:
figure:
caption: Riley's example, with expected utilities read off at the prior
name: fig-it-riley
---
fig, axes = plt.subplots(1, 2, figsize=(10, 4))
for ax, mat, who in zip(axes, (U_ri, W_ri), ("planner", "agent")):
for k in range(2):
Expand Down
12 changes: 12 additions & 0 deletions lectures/learning_approximation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,12 @@ table.round(4)
The rules themselves show the two failure modes.

```{code-cell} ipython3
---
mystnb:
figure:
caption: "Kernel rules at three bandwidths"
name: fig-la-bandwidth
---
fig, ax = plt.subplots(figsize=(7, 4.2))
for h, colour in [(0.003, 'C0'), (0.03, 'C1'), (0.20, 'C2')]:
ax.plot(G, kernel_smoother(T=T_short, h=h)[0], '-', lw=1, color=colour, label=f"$h = {h}$")
Expand Down Expand Up @@ -1382,6 +1388,12 @@ eigenvalue of $DT(\theta^*)$.
```

```{code-cell} ipython3
---
mystnb:
figure:
caption: "Distance of online beliefs from the approximate equilibrium"
name: fig-la-rate
---
T_online = len(θ_path)
ts = np.unique(np.logspace(2, np.log10(T_online - 1), 60).astype(int))
late = ts >= 10_000
Expand Down
18 changes: 18 additions & 0 deletions lectures/lucas_prescott_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,12 @@ Eu2 = np.array([r['unemployment'] for r in res2])
The paper puts $\lambda$ on the vertical axis.

```{code-cell} ipython3
---
mystnb:
figure:
caption: Workforce demand and unemployment in the paper's two-state economy
name: fig-lps-two-state
---
fig, axes = plt.subplots(1, 2, figsize=(10, 4.2))
axes[0].plot(Ey2, grid2, lw=2)
axes[0].set_xlabel('workforce demand per market')
Expand Down Expand Up @@ -1688,6 +1694,12 @@ print(f"at U = 10 the largest gap on a grid of λ is {max(gaps_10):.4f}")
Each of these inflows has two solutions, and each serves its own population; at $U = 10$ there are none.

```{code-cell} ipython3
---
mystnb:
figure:
caption: Undirected search, the populations served by the solutions at each inflow
name: fig-lps-undirected
---
Us = np.array(list(locus))
scale = 200/N_fine # back to the lecture's units
fig, ax = plt.subplots(figsize=(7, 4))
Expand Down Expand Up @@ -1795,6 +1807,12 @@ for Δ in (-0.04, -0.02, -0.01, 0.01, 0.02, 0.04):
The no-surprise line reproduces the equilibrium, as it should.

```{code-cell} ipython3
---
mystnb:
figure:
caption: An unanticipated shift in demand moves unemployment and wages in opposite directions
name: fig-lps-phillips
---
u_pts, w_pts = np.array(sorted(points)).T
fig, ax = plt.subplots(figsize=(6.5, 4))
ax.plot(u_pts, w_pts, 'o-', lw=2)
Expand Down
Loading