From 09b131dad91fa14cd1be2e716257ca5f97890ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Savalanl=C4=B1?= Date: Sat, 22 Jan 2022 10:50:31 +0100 Subject: [PATCH] updating iteration variable commiting changes from old repo --- lectures/mccall_model.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lectures/mccall_model.md b/lectures/mccall_model.md index ec9605034..5506cbc24 100644 --- a/lectures/mccall_model.md +++ b/lectures/mccall_model.md @@ -438,8 +438,8 @@ def plot_value_function_seq(mcm, ax, num_plots=6): for i in range(num_plots): ax.plot(mcm.w, v, '-', alpha=0.4, label=f"iterate {i}") # Update guess - for i in range(n): - v_next[i] = np.max(mcm.state_action_values(i, v)) + for j in range(n): + v_next[j] = np.max(mcm.state_action_values(j, v)) v[:] = v_next # copy contents into v ax.legend(loc='lower right') @@ -484,8 +484,8 @@ def compute_reservation_wage(mcm, error = tol + 1 while i < max_iter and error > tol: - for i in range(n): - v_next[i] = np.max(mcm.state_action_values(i, v)) + for j in range(n): + v_next[j] = np.max(mcm.state_action_values(j, v)) error = np.max(np.abs(v_next - v)) i += 1