Skip to content

Commit 73f315b

Browse files
authored
[olg] update visulization code (#500)
Dear John @jstac, I have updated the visualization code of the lecture olg.md according to #499 . Best ❤️ Longye
1 parent 5ec6180 commit 73f315b

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

lectures/olg.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -303,24 +303,6 @@ The next figure plots the supply of capital, as in [](saving_log_2_olg), as well
303303

304304
(For the special case of log utility, supply does not depend on the interest rate, so we have a constant function.)
305305

306-
```{code-cell} ipython3
307-
R_vals = np.linspace(0.3, 1)
308-
α, β = 0.5, 0.9
309-
w = 2.0
310-
311-
fig, ax = plt.subplots()
312-
313-
ax.plot(R_vals, capital_demand(R_vals, α),
314-
label="aggregate demand")
315-
ax.plot(R_vals, capital_supply(R_vals, β, w),
316-
label="aggregate supply")
317-
318-
ax.set_xlabel("$R_{t+1}$")
319-
ax.set_ylabel("$k_{t+1}$")
320-
ax.legend()
321-
plt.show()
322-
```
323-
324306
## Equilibrium
325307

326308
In this section we derive equilibrium conditions and investigate an example.
@@ -409,15 +391,7 @@ ax.plot(R_vals, capital_supply(R_vals, β, w),
409391
R_e = equilibrium_R_log_utility(α, β, w)
410392
k_e = (β / (1 + β)) * w
411393
412-
ax.plot(R_e, k_e, 'go', ms=6, alpha=0.6)
413-
414-
ax.annotate(r'equilibrium',
415-
xy=(R_e, k_e),
416-
xycoords='data',
417-
xytext=(0, 60),
418-
textcoords='offset points',
419-
fontsize=12,
420-
arrowprops=dict(arrowstyle="->"))
394+
ax.plot(R_e, k_e, 'o',label='equilibrium')
421395
422396
ax.set_xlabel("$R_{t+1}$")
423397
ax.set_ylabel("$k_{t+1}$")

0 commit comments

Comments
 (0)