@@ -444,8 +444,8 @@ u1_star = - ex1_a.Fs[0, 0, 1] - ex1_a.Fs[0, 0, 0] * k_grid
444
444
u2_star = - ex1_a.Fs[1, 0, 1] - ex1_a.Fs[1, 0, 0] * k_grid
445
445
446
446
fig, ax = plt.subplots()
447
- ax.plot(k_grid, k_grid + u1_star, label="$\overline{s}_1$ (high)")
448
- ax.plot(k_grid, k_grid + u2_star, label="$\overline{s}_2$ (low)")
447
+ ax.plot(k_grid, k_grid + u1_star, label=r "$\overline{s}_1$ (high)")
448
+ ax.plot(k_grid, k_grid + u2_star, label=r "$\overline{s}_2$ (low)")
449
449
450
450
# The optimal k*
451
451
ax.scatter([0.5, 0.5], [0.5, 0.5], marker="*")
@@ -546,10 +546,10 @@ for i, λ in enumerate(λ_vals):
546
546
``` {code-cell} python3
547
547
for i, state_var in enumerate(state_vec1):
548
548
fig, ax = plt.subplots()
549
- ax.plot(λ_vals, F1[:, i], label="$\overline{s}_1$", color="b")
550
- ax.plot(λ_vals, F2[:, i], label="$\overline{s}_2$", color="r")
549
+ ax.plot(λ_vals, F1[:, i], label=r "$\overline{s}_1$", color="b")
550
+ ax.plot(λ_vals, F2[:, i], label=r "$\overline{s}_2$", color="r")
551
551
552
- ax.set_xlabel("$\lambda$")
552
+ ax.set_xlabel(r "$\lambda$")
553
553
ax.set_ylabel("$F_{s_t}$")
554
554
ax.set_title(f"Coefficient on {state_var}")
555
555
ax.legend()
@@ -617,8 +617,8 @@ for i, state_var in enumerate(state_vec1):
617
617
ax.plot_surface(λ_grid, δ_grid, F1_grid[:, :, i], color="b")
618
618
# low adjustment cost, red surface
619
619
ax.plot_surface(λ_grid, δ_grid, F2_grid[:, :, i], color="r")
620
- ax.set_xlabel("$\lambda$")
621
- ax.set_ylabel("$\delta$")
620
+ ax.set_xlabel(r "$\lambda$")
621
+ ax.set_ylabel(r "$\delta$")
622
622
ax.set_zlabel("$F_{s_t}$")
623
623
ax.set_title(f"coefficient on {state_var}")
624
624
plt.show()
@@ -656,11 +656,11 @@ def run(construct_func, vals_dict, state_vec):
656
656
for i, state_var in enumerate(state_vec):
657
657
fig = plt.figure()
658
658
ax = fig.add_subplot(111)
659
- ax.plot(λ_vals, F1[:, i], label="$\overline{s}_1$", color="b")
660
- ax.plot(λ_vals, F2[:, i], label="$\overline{s}_2$", color="r")
659
+ ax.plot(λ_vals, F1[:, i], label=r "$\overline{s}_1$", color="b")
660
+ ax.plot(λ_vals, F2[:, i], label=r "$\overline{s}_2$", color="r")
661
661
662
- ax.set_xlabel("$\lambda$")
663
- ax.set_ylabel("$F(\overline{s}_t)$")
662
+ ax.set_xlabel(r "$\lambda$")
663
+ ax.set_ylabel(r "$F(\overline{s}_t)$")
664
664
ax.set_title(f"coefficient on {state_var}")
665
665
ax.legend()
666
666
plt.show()
@@ -674,17 +674,17 @@ def run(construct_func, vals_dict, state_vec):
674
674
F = [F1, F2][i]
675
675
c = ["b", "r"][i]
676
676
ax.plot([0, 1], [k_star[i], k_star[i]], "--",
677
- color=c, label="$k^*(\overline{s}_"+str(i+1)+")$")
677
+ color=c, label=r "$k^*(\overline{s}_"+str(i+1)+")$")
678
678
ax.plot(λ_vals, - F[:, 1] / F[:, 0], color=c,
679
- label="$k^{target}(\overline{s}_"+str(i+1)+")$")
679
+ label=r "$k^{target}(\overline{s}_"+str(i+1)+")$")
680
680
681
681
# Plot a vertical line at λ=0.5
682
682
ax.plot([0.5, 0.5], [min(k_star), max(k_star)], "-.")
683
683
684
- ax.set_xlabel("$\lambda$")
684
+ ax.set_xlabel(r "$\lambda$")
685
685
ax.set_ylabel("$k$")
686
686
ax.set_title("Optimal k levels and k targets")
687
- ax.text(0.5, min(k_star)+(max(k_star)-min(k_star))/20, "$\lambda=0.5$")
687
+ ax.text(0.5, min(k_star)+(max(k_star)-min(k_star))/20, r "$\lambda=0.5$")
688
688
ax.legend(bbox_to_anchor=(1., 1.))
689
689
plt.show()
690
690
@@ -714,9 +714,9 @@ def run(construct_func, vals_dict, state_vec):
714
714
ax = fig.add_subplot(111, projection='3d')
715
715
ax.plot_surface(λ_grid, δ_grid, F1_grid[:, :, i], color="b")
716
716
ax.plot_surface(λ_grid, δ_grid, F2_grid[:, :, i], color="r")
717
- ax.set_xlabel("$\lambda$")
718
- ax.set_ylabel("$\delta$")
719
- ax.set_zlabel("$F(\overline{s}_t)$")
717
+ ax.set_xlabel(r "$\lambda$")
718
+ ax.set_ylabel(r "$\delta$")
719
+ ax.set_zlabel(r "$F(\overline{s}_t)$")
720
720
ax.set_title(f"coefficient on {state_var}")
721
721
plt.show()
722
722
```
0 commit comments