Skip to content

Commit 47eecc5

Browse files
mmckyEmil Savalanlı
and
Emil Savalanlı
authored
[mccall_model] Transfer #195: Updating Iteration Variable (#216)
* updating iteration variable commiting changes from old repo * Empty-Commit --------- Co-authored-by: Emil Savalanlı <[email protected]>
1 parent 6a24b31 commit 47eecc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lectures/mccall_model.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ def plot_value_function_seq(mcm, ax, num_plots=6):
433433
for i in range(num_plots):
434434
ax.plot(mcm.w, v, '-', alpha=0.4, label=f"iterate {i}")
435435
# Update guess
436-
for i in range(n):
437-
v_next[i] = np.max(mcm.state_action_values(i, v))
436+
for j in range(n):
437+
v_next[j] = np.max(mcm.state_action_values(j, v))
438438
v[:] = v_next # copy contents into v
439439
440440
ax.legend(loc='lower right')
@@ -479,8 +479,8 @@ def compute_reservation_wage(mcm,
479479
error = tol + 1
480480
while j < max_iter and error > tol:
481481
482-
for i in range(n):
483-
v_next[i] = np.max(mcm.state_action_values(i, v))
482+
for j in range(n):
483+
v_next[j] = np.max(mcm.state_action_values(j, v))
484484
485485
error = np.max(np.abs(v_next - v))
486486
j += 1

0 commit comments

Comments
 (0)