Skip to content

Commit e3bb23d

Browse files
authored
Merge branch 'main' into patch-5
2 parents 7207b9a + fbc066b commit e3bb23d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

environment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ dependencies:
66
- anaconda=2020.11
77
- pip
88
- pip:
9-
- jupyter-book==0.11.1
10-
- sphinx-multitoc-numbering==0.1.3
9+
- jupyter-book==0.11.2
1110
- quantecon-book-theme==0.2.3
1211
- sphinx-tojupyter==0.1.2
1312
- sphinxext-rediraffe==0.2.7

lectures/career.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,12 @@ def solve_model(cw,
300300
print(f"Error at iteration {i} is {error}.")
301301
v = v_new
302302
303-
if i == max_iter:
303+
if i == max_iter and error > tol:
304304
print("Failed to converge!")
305305
306-
if verbose and i < max_iter:
307-
print(f"\nConverged in {i} iterations.")
306+
else:
307+
if verbose:
308+
print(f"\nConverged in {i} iterations.")
308309
309310
return v_new
310311
```
@@ -430,10 +431,12 @@ def gen_path(optimal_policy, F, G, t=20):
430431
θ_index = []
431432
ϵ_index = []
432433
for t in range(t):
433-
if greedy_star[i, j] == 1: # Stay put
434+
if optimal_policy[i, j] == 1: # Stay put
434435
pass
436+
435437
elif greedy_star[i, j] == 2: # New job
436438
j = qe.random.draw(G)
439+
437440
else: # New life
438441
i, j = qe.random.draw(F), qe.random.draw(G)
439442
θ_index.append(i)

0 commit comments

Comments
 (0)