Skip to content

Commit 6a24b31

Browse files
authored
Merge pull request #354 from TaichiSakaguchi/patch-1
Improve the computation of the reservation wage
2 parents 988ae43 + c891fa0 commit 6a24b31

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lectures/mccall_model_with_separation.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,8 @@ def compute_reservation_wage(mcm):
438438
v, d = solve_model(mcm)
439439
h = u(mcm.c) + mcm.β * d
440440
441-
w_bar = np.inf
442-
for i, wage in enumerate(mcm.w):
443-
if v[i] > h:
444-
w_bar = wage
445-
break
441+
i = np.searchsorted(v, h, side='right')
442+
w_bar = mcm.w[i]
446443
447444
return w_bar
448445
```

0 commit comments

Comments
 (0)