Skip to content

Commit

Permalink
Small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
HengchengZhang committed Jun 9, 2023
1 parent fcd9b84 commit e942419
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code_book/ch_mcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ minimum initial value and one at the maximum.
def sim_fig(ax, mc, T=100, seed=14, title=None):
X1 = mc.simulate(T, init=1, random_state=seed)
X2 = mc.simulate(T, init=max(mc.state_values), random_state=seed+1)
ax.set_xlabel("time")
ax.set_ylabel("state")
ax.plot(X1, label="low initial state")
ax.plot(X2, label="high initial state")
ax.set_title(title, fontsize=12)
Expand All @@ -185,8 +187,10 @@ Finally, we produce the figure.

```{code-cell}
fig, axes = plt.subplots(2, 1, figsize=[6, 4])
ax = axes[0]
sim_fig(axes[0], mc_B, title="$P_B$")
sim_fig(axes[1], mc_Q, title="$P_Q$")
ax.
plt.tight_layout()
if export_figures:
Expand Down
2 changes: 2 additions & 0 deletions code_book/ch_opt_julia.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ fig, ax = plt.subplots(figsize=[6, 4])
n = 7
q = zeros(n)
ax.plot(1:n, q)
ax.set_xlabel("cost-to-go")
ax.set_ylabel("nodes")
for i in 1:3
new_q = T(q)
Expand Down

1 comment on commit e942419

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.