Skip to content
Merged
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
4 changes: 2 additions & 2 deletions lectures/cass_koopmans_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ T_arr = [250, 150, 75, 50]
fix, axs = plt.subplots(2, 3, figsize=(13, 6))
titles = ['Arrow-Hicks Prices', 'Labor Rental Rate', 'Capital Rental Rate',
'Consumption', 'Capital', 'Lagrange Multiplier']
ylabels = ['$q_t^0$', '$w_t$', '$\eta_t$', '$c_t$', '$k_t$', '$\mu_t$']
ylabels = ['$q_t^0$', '$w_t$', r'$\eta_t$', '$c_t$', '$k_t$', r'$\mu_t$']

for T in T_arr:
c_path, k_path = bisection(pp, 0.3, k_ss/3, T, verbose=False)
Expand Down Expand Up @@ -905,7 +905,7 @@ for γ in γ_arr:
paths = [q_path, w_path, η_path, c_path, k_path, μ_path]

for i, ax in enumerate(axs.flatten()):
ax.plot(paths[i], label=f'$\gamma = {γ}$')
ax.plot(paths[i], label=fr'$\gamma = {γ}$')
ax.set(title=titles[i], ylabel=ylabels[i], xlabel='t')
if titles[i] == 'Capital':
ax.axhline(k_ss, lw=1, ls='--', c='k')
Expand Down
2 changes: 1 addition & 1 deletion lectures/coleman_policy_iter.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ n = 15
σ = grid.copy() # Set initial condition

fig, ax = plt.subplots()
lb = 'initial condition $\sigma(y) = y$'
lb = r'initial condition $\sigma(y) = y$'
ax.plot(grid, σ, color=plt.cm.jet(0), alpha=0.6, label=lb)

for i in range(n):
Expand Down
6 changes: 3 additions & 3 deletions lectures/exchangeable.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def learning_example(F_a=1, F_b=1, G_a=3, G_b=1.2):
ax3.fill_between(π_grid, roots[0], roots[1], color='green', alpha=0.15)
ax3.fill_between(π_grid, roots[1], w_max, color='blue', alpha=0.15)
ax3.hlines(roots, 0., 1., linestyle="--")
ax3.set(xlabel='$\pi$', ylabel='$w$')
ax3.set(xlabel=r'$\pi$', ylabel='$w$')
ax3.grid()

plt.show()
Expand Down Expand Up @@ -694,8 +694,8 @@ def expected_ratio(F_a=1, F_b=1, G_a=3, G_b=1.2):
plt.plot(π_grid, expected_rario, label=f"{q} generates")

plt.hlines(1, 0, 1, linestyle="--")
plt.xlabel("$π_t$")
plt.ylabel("$E[\pi_{t+1}/\pi_t]$")
plt.xlabel(r"$\pi_t$")
plt.ylabel(r"$E[\pi_{t+1}/\pi_t]$")
plt.legend()

plt.show()
Expand Down
4 changes: 2 additions & 2 deletions lectures/jv.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ def xbar(ϕ):

ϕ_grid = np.linspace(0, 1, 100)
fig, ax = plt.subplots(figsize=(9, 7))
ax.set(xlabel='$\phi$')
ax.plot(ϕ_grid, [xbar(ϕ) * (1 - ϕ) for ϕ in ϕ_grid], label='$w^*(\phi)$')
ax.set(xlabel=r'$\phi$')
ax.plot(ϕ_grid, [xbar(ϕ) * (1 - ϕ) for ϕ in ϕ_grid], label=r'$w^*(\phi)$')
ax.legend()

plt.show()
Expand Down
4 changes: 2 additions & 2 deletions lectures/lake_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class LakeModel:


def rate_steady_state(self, tol=1e-6):
"""
r"""
Finds the steady state of the system :math:`x_{t+1} = \hat A x_{t}`

Returns
Expand Down Expand Up @@ -1005,7 +1005,7 @@ class LakeModelModified:


def rate_steady_state(self, tol=1e-6):
"""
r"""
Finds the steady state of the system :math:`x_{t+1} = \hat A x_{t}`

Returns
Expand Down
2 changes: 1 addition & 1 deletion lectures/lqcontrol.md
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ ax.set(xlabel='Time', xlim=(0, max(time)))
ax.plot(time, q_bar, 'k-', lw=2, alpha=0.6, label=r'$\bar q_t$')
ax.plot(time, q, 'b-', lw=2, alpha=0.6, label='$q_t$')
ax.legend(ncol=2, **legend_args)
s = f'dynamics with $\gamma = {γ}$'
s = fr'dynamics with $\gamma = {γ}$'
ax.text(max(time) * 0.6, 1 * q_bar.max(), s, fontsize=14)
plt.show()
```
Expand Down
4 changes: 2 additions & 2 deletions lectures/multivariate_normal.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ plt.fill_between(range(1, n+1), μθ_hat_lower, μθ_hat_higher,
color='b', alpha=0.2, label='95%')

plt.xlabel('number of test scores')
plt.ylabel('$\hat{θ}$')
plt.ylabel(r'$\hat{θ}$')
plt.legend()

plt.show()
Expand Down Expand Up @@ -2225,7 +2225,7 @@ Below we’ll plot several things

```{code-cell} python3
plt.scatter(range(N), y, label='y')
plt.scatter(range(N), ε, label='$\epsilon$')
plt.scatter(range(N), ε, label=r'$\epsilon$')
plt.hlines(f[0], 0, N//2-1, ls='--', label='$f_{1}$')
plt.hlines(f[1], N//2, N-1, ls='-.', label='$f_{2}$')
plt.legend()
Expand Down
2 changes: 1 addition & 1 deletion lectures/svd_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ def compare_pca_svd(da):
axs[0].set_title('ε')
axs[0].set_xlabel('n')
axs[1].plot(da.VT[:da.r, :].T * np.sqrt(da.λ))
axs[1].set_title('$V^\top *\sqrt{\lambda}$')
axs[1].set_title(r'$V^\top *\sqrt{\lambda}$')
axs[1].set_xlabel('n')
plt.show()
```
Expand Down
2 changes: 1 addition & 1 deletion lectures/von_neumann_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ fig.suptitle(r'The function $V(M(\gamma))$', fontsize=16)
for ax, grid, N, i in zip(axes, (value_ex1_grid, value_ex2_grid),
(n1, n2), (1, 2)):
ax.plot(γ_grid, grid)
ax.set(title=f'Example {i}', xlabel='$\gamma$')
ax.set(title=f'Example {i}', xlabel=r'$\gamma$')
ax.axhline(0, c='k', lw=1)
ax.axvline(N.bounds()[0], c='r', ls='--', label='lower bound')
ax.axvline(N.bounds()[1], c='g', ls='--', label='upper bound')
Expand Down
Loading