Skip to content

Commit

Permalink
[olg] update visulization code (#500)
Browse files Browse the repository at this point in the history
Dear John @jstac,

I have updated the visualization code of the lecture olg.md according to #499 .

Best ❤️
Longye
  • Loading branch information
longye-tian authored Jul 4, 2024
1 parent 5ec6180 commit 73f315b
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions lectures/olg.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,6 @@ The next figure plots the supply of capital, as in [](saving_log_2_olg), as well

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

```{code-cell} ipython3
R_vals = np.linspace(0.3, 1)
α, β = 0.5, 0.9
w = 2.0
fig, ax = plt.subplots()
ax.plot(R_vals, capital_demand(R_vals, α),
label="aggregate demand")
ax.plot(R_vals, capital_supply(R_vals, β, w),
label="aggregate supply")
ax.set_xlabel("$R_{t+1}$")
ax.set_ylabel("$k_{t+1}$")
ax.legend()
plt.show()
```

## Equilibrium

In this section we derive equilibrium conditions and investigate an example.
Expand Down Expand Up @@ -409,15 +391,7 @@ ax.plot(R_vals, capital_supply(R_vals, β, w),
R_e = equilibrium_R_log_utility(α, β, w)
k_e = (β / (1 + β)) * w
ax.plot(R_e, k_e, 'go', ms=6, alpha=0.6)
ax.annotate(r'equilibrium',
xy=(R_e, k_e),
xycoords='data',
xytext=(0, 60),
textcoords='offset points',
fontsize=12,
arrowprops=dict(arrowstyle="->"))
ax.plot(R_e, k_e, 'o',label='equilibrium')
ax.set_xlabel("$R_{t+1}$")
ax.set_ylabel("$k_{t+1}$")
Expand Down

0 comments on commit 73f315b

Please sign in to comment.