Skip to content

Commit d513790

Browse files
committed
update_olg.md
This commit is related to #434. In particular, it involves: Code: - `x=1000` to `n=1000`; - vectorize `k_grid_next` - add y labels to plot in 24.6.3 - remove duplicate codes Content - Add hyphen to 'long run growth' and '45 degree line' - firm problem to firm's problem to match with the title - interest rate to gross interest rate to match with the content later - change $\ell_t w_t$ to $w_t \ell_t$ to match the order with $\R_t k_t$
1 parent 3c5585a commit d513790

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

lectures/olg.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ is used by policy makers and researchers to examine
1818

1919
* fiscal policy
2020
* monetary policy
21-
* long run growth
21+
* long-run growth
2222

2323
and many other topics.
2424

@@ -57,7 +57,7 @@ prices, etc.)
5757
The OLG model takes up this challenge.
5858

5959
We will present a simple version of the OLG model that clarifies the decision
60-
problem of households and studies the implications for long run growth.
60+
problem of households and studies the implications for long-run growth.
6161

6262
Let's start with some imports.
6363

@@ -70,7 +70,7 @@ import matplotlib.pyplot as plt
7070

7171
## Environment
7272

73-
We assume that time is discrete, so that $t=0, 1, \ldots$,
73+
We assume that time is discrete, so that $t=0, 1, \ldots$.
7474

7575
An individual born at time $t$ lives for two periods, $t$ and $t + 1$.
7676

@@ -144,7 +144,7 @@ Here
144144

145145
- $s_t$ is savings by an individual born at time $t$
146146
- $w_t$ is the wage rate at time $t$
147-
- $R_{t+1}$ is the interest rate on savings invested at time $t$, paid at time $t+1$
147+
- $R_{t+1}$ is the gross interest rate on savings invested at time $t$, paid at time $t+1$
148148

149149
Since $u$ is strictly increasing, both of these constraints will hold as equalities at the maximum.
150150

@@ -225,7 +225,7 @@ economy.
225225

226226
## Demand for capital
227227

228-
First we describe the firm problem and then we write down an equation
228+
First we describe the firm's problem and then we write down an equation
229229
describing demand for capital given prices.
230230

231231

@@ -246,7 +246,7 @@ The profit maximization problem of the firm is
246246

247247
```{math}
248248
:label: opt_profit_olg
249-
\max_{k_t, \ell_t} \{ k^{\alpha}_t \ell_t^{1-\alpha} - R_t k_t - \ell_t w_t \}
249+
\max_{k_t, \ell_t} \{ k^{\alpha}_t \ell_t^{1-\alpha} - R_t k_t -w_t \ell_t \}
250250
```
251251

252252
The first-order conditions are obtained by taking the derivative of the
@@ -447,7 +447,7 @@ In particular, since $w_t = (1-\alpha)k_t^\alpha$, we have
447447
If we iterate on this equation, we get a sequence for capital stock.
448448

449449

450-
Let's plot the 45 degree diagram of these dynamics, which we write as
450+
Let's plot the 45-degree diagram of these dynamics, which we write as
451451

452452
$$
453453
k_{t+1} = g(k_t)
@@ -463,12 +463,9 @@ def k_update(k, α, β):
463463
```{code-cell} ipython3
464464
α, β = 0.5, 0.9
465465
kmin, kmax = 0, 0.1
466-
x = 1000
467-
k_grid = np.linspace(kmin, kmax, x)
468-
k_grid_next = np.empty_like(k_grid)
469-
470-
for i in range(x):
471-
k_grid_next[i] = k_update(k_grid[i], α, β)
466+
n = 1000
467+
k_grid = np.linspace(kmin, kmax, n)
468+
k_grid_next = k_update(k_grid,α,β)
472469
473470
fig, ax = plt.subplots(figsize=(6, 6))
474471
@@ -520,7 +517,7 @@ R_star = (α/(1 - α)) * ((1 + β) / β)
520517

521518
### Time series
522519

523-
The 45 degree diagram above shows that time series of capital with positive initial conditions converge to this steady state.
520+
The 45-degree diagram above shows that time series of capital with positive initial conditions converge to this steady state.
524521

525522
Let's plot some time series that visualize this.
526523

@@ -554,6 +551,7 @@ fig, ax = plt.subplots()
554551
ax.plot(R_series, label="gross interest rate")
555552
ax.plot(range(ts_length), np.full(ts_length, R_star), 'k--', label="$R^*$")
556553
ax.set_ylim(0, 4)
554+
ax.set_ylabel("gross interest rate")
557555
ax.set_xlabel("$t$")
558556
ax.legend()
559557
plt.show()
@@ -629,7 +627,6 @@ def savings_crra(w, R, model):
629627
```
630628

631629
```{code-cell} ipython3
632-
R_vals = np.linspace(0.3, 1)
633630
model = create_olg_model()
634631
w = 2.0
635632
@@ -685,7 +682,7 @@ In the exercise below, you will be asked to solve these equations numerically.
685682
686683
Solve for the dynamics of equilibrium capital stock in the CRRA case numerically using [](law_of_motion_capital_crra).
687684
688-
Visualize the dynamics using a 45 degree diagram.
685+
Visualize the dynamics using a 45-degree diagram.
689686
690687
```
691688

@@ -735,16 +732,13 @@ def k_update(k, model):
735732
return optimize.newton(lambda k_prime: f(k_prime, k, model), 0.1)
736733
```
737734

738-
Finally, here is the 45 degree diagram.
735+
Finally, here is the 45-degree diagram.
739736

740737
```{code-cell} ipython3
741738
kmin, kmax = 0, 0.5
742-
x = 1000
743-
k_grid = np.linspace(kmin, kmax, x)
744-
k_grid_next = np.empty_like(k_grid)
745-
746-
for i in range(x):
747-
k_grid_next[i] = k_update(k_grid[i], model)
739+
n = 1000
740+
k_grid = np.linspace(kmin, kmax, n)
741+
k_grid_next = k_update(k_grid,α,β)
748742
749743
fig, ax = plt.subplots(figsize=(6, 6))
750744
@@ -768,7 +762,7 @@ plt.show()
768762
```{exercise}
769763
:label: olg_ex2
770764
771-
The 45 degree diagram from the last exercise shows that there is a unique
765+
The 45-degree diagram from the last exercise shows that there is a unique
772766
positive steady state.
773767
774768
The positive steady state can be obtained by setting $k_{t+1} = k_t = k^*$ in [](law_of_motion_capital_crra), which yields

0 commit comments

Comments
 (0)