Skip to content

Commit

Permalink
Merge pull request #4 from HumphreyYang/fix-string
Browse files Browse the repository at this point in the history
[FIX] Fix string warnings
  • Loading branch information
mmcky authored Jan 21, 2025
2 parents 2c59dfe + 684547c commit c7827e8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lectures/calvo_machine_learn.md
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ Let's plot the regression line $\mu_t = .0645 + 1.5995 \theta_t$ and the points
```{code-cell} ipython3
plt.scatter(θs, μs, label=r'$\mu_t$')
plt.plot(θs, results1.predict(X1_θ), 'grey', label='$\hat \mu_t$', linestyle='--')
plt.plot(θs, results1.predict(X1_θ), 'grey', label=r'$\hat \mu_t$', linestyle='--')
plt.xlabel(r'$\theta_t$')
plt.ylabel(r'$\mu_t$')
plt.legend()
Expand Down Expand Up @@ -1321,7 +1321,7 @@ X3_grid = np.column_stack((np.ones(len(θ_grid)), θ_grid, θ_grid**2))
plt.scatter(θs, v_t)
plt.plot(θ_grid, results3.predict(X3_grid), color='grey',
label='$\hat v_t$', linestyle='--')
label=r'$\hat v_t$', linestyle='--')
plt.axhline(V_CR, color='C1', alpha=0.5)
plt.text(max(θ_grid) - max(θ_grid)*0.025, V_CR, '$V^{CR}$', color='C1',
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/linear_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -794,15 +794,15 @@ for i in range(I):
ensemble_mean = ensemble_mean + y
ensemble_mean = ensemble_mean / I
ax.plot(ensemble_mean, color='b', lw=2, alpha=0.8, label='$\\bar y_t$')
ax.plot(ensemble_mean, color='b', lw=2, alpha=0.8, label=r'$\bar y_t$')
m = ar.moment_sequence()
population_means = []
for t in range(T):
μ_x, μ_y, Σ_x, Σ_y = next(m)
population_means.append(float(μ_y))
ax.plot(population_means, color='g', lw=2, alpha=0.8, label='$G\mu_t$')
ax.plot(population_means, color='g', lw=2, alpha=0.8, label=r'$G\mu_t$')
ax.set_ylim(ymin, ymax)
ax.set_xlabel('time', fontsize=12)
ax.set_ylabel('$y_t$', fontsize=12)
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
2 changes: 1 addition & 1 deletion lectures/opt_tax_recur.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ for ax, title, plot in zip(axes, titles, [tax_policy, interest_rate]):
ax.set(title=title, xlim=(min(gov_debt), max(gov_debt)))
ax.grid()
axes[0].legend(('Time $t=0$', 'Time $t \geq 1$'))
axes[0].legend(('Time $t=0$', r'Time $t \geq 1$'))
axes[1].set_xlabel('Initial Government Debt')
fig.tight_layout()
Expand Down
2 changes: 1 addition & 1 deletion lectures/rob_markov_perf.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ The function's code is as follows
def nnash_robust(A, C, B1, B2, R1, R2, Q1, Q2, S1, S2, W1, W2, M1, M2,
θ1, θ2, beta=1.0, tol=1e-8, max_iter=1000):
"""
r"""
Compute the limit of a Nash linear quadratic dynamic game with
robustness concern.
Expand Down

0 comments on commit c7827e8

Please sign in to comment.