Skip to content

Commit f748f89

Browse files
shlffSmit-create
authored andcommitted
fix_eq_ref
1 parent cd231b8 commit f748f89

File tree

1 file changed

+129
-93
lines changed

1 file changed

+129
-93
lines changed

lectures/olg.md

Lines changed: 129 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ First let's consider the household side.
7070

7171
+++
7272

73-
TODO label and recall math equations using correct internal reference
7473

7574
## Supply of capital
7675

@@ -118,25 +117,29 @@ Substituting $s_t$ we get from the first constraint into the second constraint w
118117
Thus first-order condition for a maximum can be written in the
119118
familiar form of the consumption Euler equation by plugging $c^2_{t+1}$ into the objective function and taking derivative with respect to $c^1_t$
120119

121-
$$
120+
```{math}
121+
:label: euler_1_olg
122122
u'(c^1_t) = \beta R_{t+1} u'( R_{t+1} (w_t - c^1_t))
123-
$$
123+
```
124124

125125
From the first constraint we get
126126
```{math}
127+
:label: c_1_olg
127128
c^1_{t} = w_t - s_t
128129
```
129130

130131
With it the Euler equation (4) becomes
131132
```{math}
133+
:label: euler_2_olg
132134
u'(w_t - s_t) = \beta R_{t+1} u'( R_{t+1} s_t)
133135
```
134136

135137
+++
136138

137139
From this we can solve for savings analytically or numerically
138140
```{math}
139-
s_t = s(w_t, R_{t+1})
141+
:label: saving_1_olg
142+
s_t = s(w_t, R_{t+1})
140143
```
141144

142145
+++
@@ -146,15 +149,17 @@ Let $L_t$ be the time $t$ labor.
146149
Furthermore let's also assume a constant population size, i.e., $L_{t+1}=L_t=L$ for all $t$.
147150

148151
Total savings in the economy will be equal to
149-
$$
152+
```{math}
153+
:label: total_savings_1_olg
150154
S_t = s_t L
151-
$$
155+
```
152156

153157
In our closed economy, the net saving this period will be equal to the supply next period, i.e.,
154158

155-
$$
156-
K_{t+1} = K^S(w_t, R_{t+1}) = S_t = L s_t = L s(w_t, R_{t+1})
157-
$$
159+
```{math}
160+
:label: aggregate_supply_capital_1_olg
161+
K_{t+1} = K^S(w_t, R_{t+1}) = S_t = L s_t = L s(w_t, R_{t+1})
162+
```{math}
158163
159164
Here $K^S(w_t, R_{t+1})$ means the invariant function relationship between aggregate capital supply $K_{t+1}$ and wage $w_t$ and return rate $R_{t+1}$.
160165
@@ -165,21 +170,24 @@ Here $K^S(w_t, R_{t+1})$ means the invariant function relationship between aggre
165170
Unless we specify let's assume $u(c) = \log c$.
166171
167172
Now the Euler equation is simplified to
168-
$$
169-
s_t= \beta (w_t - s_t)
170-
$$
173+
```{math}
174+
:label: saving_log_1_olg
175+
s_t= \beta (w_t - s_t)
176+
```
171177

172178
Solving for saving,
173-
$$
174-
s_t = s(w_t, R_{t+1}) = \frac{\beta}{1+\beta} w_t
175-
$$
179+
```{math}
180+
:label: saving_log_2_olg
181+
s_t = s(w_t, R_{t+1}) = \frac{\beta}{1+\beta} w_t
182+
```
176183

177184
+++
178185

179186
And hence aggregate supply of capital
180-
$$
181-
K_{t+1} = K^s(R_{t+1}) = Ls_t = L \frac{\beta}{1+\beta} w_t
182-
$$
187+
```{math}
188+
:label: aggregate_supply_capital_log_olg
189+
K_{t+1} = K^s(R_{t+1}) = Ls_t = L \frac{\beta}{1+\beta} w_t
190+
```
183191

184192
+++
185193

@@ -189,64 +197,80 @@ $$
189197

190198
For each integer $t \geq 0$, output $Y_t$ in period $t$ is given by
191199

192-
$$
200+
```{math}
201+
:label: cobb_douglas
193202
Y_t = K_t^{\alpha} L_t^{1-\alpha}
194-
$$
203+
```
195204

196205
Here $K_t$ is capital, $L_t$ is labor, and $\alpha$ is the output elasticity of capital in the **Cobb-Douglas production function**.
197206

198207
Without population growth, $L_t$ equals some constant $L$.
199208

200209
Demand for labor $L$ and capital $K_t$ is determined by the profit maximization problem
201210
```{math}
202-
\max_{K_t, L} \{ K^{\alpha}_t L^{1-\alpha} - R_t K_t - L w_t \}
211+
:label: opt_profit_olg
212+
\max_{K_t, L} \{ K^{\alpha}_t L^{1-\alpha} - R_t K_t - L w_t \}
203213
```
204214

205215
### Demand for capital
206216

207-
The first-order conditions for a maximum can be obtained by taking derivative of the objective function with respect to capital and labor respectively and setting to $0$
208-
$$
209-
(1-\alpha)(K_t / L)^{\alpha} = w_t
210-
$$
217+
The first-order conditions for a maximum can be obtained by taking derivative of the objective function with respect to capital and labor respectively and setting to $0$:
218+
219+
```{math}
220+
:label: wage
221+
(1-\alpha)(K_t / L)^{\alpha} = w_t
222+
```
223+
211224
and
212-
$$
213-
\alpha (K_t / L)^{\alpha - 1} = R_t
214-
$$
215225

216-
Rearranging Equation (16) gives the aggregate demand for capital
226+
```{math}
227+
:label: interest_rate
228+
\alpha (K_t / L)^{\alpha - 1} = R_t
229+
```
217230

218-
$$
219-
K_{t+1} = K^d (R_{t+1}) = L \left (\frac{R_{t+1}}{\alpha} \right )^{1/(\alpha - 1)}
220-
$$
231+
Rearranging Equation [](interest_rate) gives the aggregate demand for capital
232+
233+
```{math}
234+
:label: aggregate_demand_capital_olg
235+
K_{t+1} = K^d (R_{t+1}) = L \left (\frac{R_{t+1}}{\alpha} \right )^{1/(\alpha - 1)}
236+
```
221237

222238
+++
223239

224240
## Equilibrium
225241

226-
The equality of aggregate demand (12) and aggregate supply (16) for capital yields the equalibrium.
242+
The equality of aggregate demand [](aggregate_demand_capital_olg) and aggregate supply [](aggregate_supply_capital_log_olg) for capital yields the equalibrium.
227243

228244
Specifically we have
229-
$$
230-
K^s(R_{t+1}) = K^d(R_{t+1})
231-
$$
245+
246+
```{math}
247+
:label: equilibrium_1
248+
K^s(R_{t+1}) = K^d(R_{t+1})
249+
```
250+
232251
or equivalently
233-
$$
234-
L\frac{\beta}{1+\beta} (1-\alpha)(K_t / L)^{\alpha} = L\left (\frac{R_{t+1}}{\alpha} \right )^{1/(\alpha - 1)}
235-
$$
252+
253+
```{math}
254+
:label: equilibrium_2
255+
L\frac{\beta}{1+\beta} (1-\alpha)(K_t / L)^{\alpha} = L\left (\frac{R_{t+1}}{\alpha} \right )^{1/(\alpha - 1)}
256+
```
236257

237258
+++
238259

239260
Then we can solve for the equilibrium price
240-
$$
241-
R^*_{t+1} = \alpha \left ( \frac{\beta (1-\alpha)(K_t / L)^{\alpha}}{1+\beta} \right )^{\alpha - 1}
242-
$$
261+
262+
```{math}
263+
:label: equilibrium_price
264+
R^*_{t+1} = \alpha \left ( \frac{\beta (1-\alpha)(K_t / L)^{\alpha}}{1+\beta} \right )^{\alpha - 1}
265+
```
243266

244267
+++
245268

246269
Plugging it into either aggregate demand or supply function gives equilibrium quantity
247-
$$
248-
K^*_{t+1} = \frac{\beta }{1+\beta} (1-\alpha)(K_t / L)^{\alpha} L
249-
$$
270+
```{math}
271+
:label: equilibrium_quantity
272+
K^*_{t+1} = \frac{\beta }{1+\beta} (1-\alpha)(K_t / L)^{\alpha} L
273+
```
250274

251275
```{code-cell} ipython3
252276
Model = namedtuple('Model', ['α', # output elasticity of capital in the Cobb-Douglas production function
@@ -313,38 +337,43 @@ plt.show()
313337
Setting $k_t := K_t / L$.
314338

315339

316-
Aggregate supply of capital (12) becomes
317-
$$
318-
k_{t+1} = k^s(R_{t+1}) = \frac{\beta}{1+\beta} w_t
319-
$$
340+
Aggregate supply of capital [](aggregate_supply_capital_log_olg) becomes
341+
```{math}
342+
:label: supply_capital_log_olg
343+
k_{t+1} = k^s(R_{t+1}) = \frac{\beta}{1+\beta} w_t
344+
```
320345

321-
Equation (15) becomes
322-
$$
323-
(1-\alpha)(k_t)^{\alpha} = w_t
324-
$$
346+
Equation [](wage) becomes
347+
```{math}
348+
:label: wage_2
349+
(1-\alpha)(k_t)^{\alpha} = w_t
350+
```
325351

326352
+++
327353

328-
Combining (22) and (23) yields the law of motion for capital
329-
$$
330-
k_{t+1} = \frac{\beta}{1+\beta} (1-\alpha)(k_t)^{\alpha}
331-
$$
354+
Combining [](supply_capital_log_olg) and [](wage_2) yields the law of motion for capital
355+
```{math}
356+
:label: law_of_motion_capital
357+
k_{t+1} = \frac{\beta}{1+\beta} (1-\alpha)(k_t)^{\alpha}
358+
```
332359

333360
+++
334361

335362
A steady state can be solved analytically.
336363

337364
That is, $k_{t+1} = k_t = k^*$,
338-
$$
339-
k^* = \frac{\beta (1-\alpha) (k^*)^{\alpha}}{(1+\beta)}
340-
$$
365+
```{math}
366+
:label: steady_state_1
367+
k^* = \frac{\beta (1-\alpha) (k^*)^{\alpha}}{(1+\beta)}
368+
```
341369

342370
+++
343371

344372
We can solve for
345-
$$
346-
k^* = \left (\frac{\beta (1-\alpha)}{1+\beta} \right )^{1/(1-\alpha)}
347-
$$
373+
```{math}
374+
:label: steady_state_2
375+
k^* = \left (\frac{\beta (1-\alpha)}{1+\beta} \right )^{1/(1-\alpha)}
376+
```
348377

349378
```{code-cell} ipython3
350379
def k_update(k, model):
@@ -420,41 +449,46 @@ m_crra = create_olg_model(u=crra)
420449
```
421450

422451
For households now the euler equation becomes
423-
$$
452+
```{math}
453+
:label: euler_crra
424454
(w_t - s_t)^{-\gamma} = \beta R^{1-\gamma}_{t+1} (s_t)^{-\gamma}
425-
$$
455+
```
426456

427457
+++
428458

429459
Solving for savings, we have
430460

431-
$$
461+
```{math}
462+
:label: saving_crra
432463
s_t = s(w_t, R_{t+1}) = w_t \left [ 1 + \beta^{-1/\gamma} R_{t+1}^{(\gamma-1)/\gamma} \right ]^{-1}
433-
$$
464+
```
434465

435466
+++
436467

437-
Setting $k_t := K_t / L$ and using (28).
468+
Setting $k_t := K_t / L$ and using Equation [](saving_crra).
438469

439470

440-
Aggregate supply of capital (12) becomes
441-
$$
442-
k_{t+1} = k^s(R_{t+1}) = \left [ 1 + \beta^{-1/\gamma} R_{t+1}^{(\gamma-1)/\gamma} \right ]^{-1} w_t
443-
$$
471+
Aggregate supply of capital [](aggregate_supply_capital_1_olg) becomes
472+
```{math}
473+
:label: supply_capital_crra_olg
474+
k_{t+1} = k^s(R_{t+1}) = \left [ 1 + \beta^{-1/\gamma} R_{t+1}^{(\gamma-1)/\gamma} \right ]^{-1} w_t
475+
```
444476

445477
+++
446478

447-
Equation (16) becomes
448-
$$
449-
\alpha k^{\alpha - 1}_t = R_t
450-
$$
479+
Equation [](interest_rate) becomes
480+
```{math}
481+
:label: interest_rate_2
482+
\alpha k^{\alpha - 1}_t = R_t
483+
```
451484

452485
+++
453486

454-
Combing with equations (23) and (30) gives
455-
$$
456-
k_{t+1} = \left [ 1 + \beta^{-1/\gamma} (\alpha k^{\alpha - 1}_{t+1})^{(\gamma-1)/\gamma} \right ]^{-1} (1-\alpha)(k_t)^{\alpha}
457-
$$
487+
Combing with equations [](wage_2) and [](supply_capital_crra_olg) gives
488+
```{math}
489+
:label: law_of_motion_capital_crra
490+
k_{t+1} = \left [ 1 + \beta^{-1/\gamma} (\alpha k^{\alpha - 1}_{t+1})^{(\gamma-1)/\gamma} \right ]^{-1} (1-\alpha)(k_t)^{\alpha}
491+
```
458492

459493
+++
460494

@@ -465,9 +499,10 @@ That is we don't have an analytical solution for the sample path $\{k_{t+1}\}$ n
465499
To solve for $k_{t+1}$ we need to turn to newton's method.
466500

467501
Suppose,
468-
$$
469-
f(k_{t+1}; k_t)=k_{t+1} \left [ 1 + \beta^{-1/\gamma} \left ( \alpha k^{\alpha-1}_{t+1} \right )^{(\gamma-1)/\gamma} \right ] - (1-\alpha) k^{\alpha}_t =0
470-
$$
502+
```{math}
503+
:label: crra_newton_1
504+
f(k_{t+1}; k_t)=k_{t+1} \left [ 1 + \beta^{-1/\gamma} \left ( \alpha k^{\alpha-1}_{t+1} \right )^{(\gamma-1)/\gamma} \right ] - (1-\alpha) k^{\alpha}_t =0
505+
```
471506

472507
If $k_t$ is given then $f(\cdot)$ is a function of unknown $k_{t+1}$.
473508

@@ -496,23 +531,23 @@ def k_next(k_prime, model):
496531
plot_45(m_crra, k_next, kstar=None)
497532
```
498533

499-
Unlike the log preference case now a steady state cannot be solved analytically either.
534+
Unlike the log preference case now a steady state cannot be solved analytically.
500535

501-
To see this recall that, a steady state can be obtained by setting equation (25) to $k_{t+1} = k_t = k^*$, i.e.,
536+
To see this recall that, a steady state can be obtained by setting equation [](law_of_motion_capital_crra) to $k_{t+1} = k_t = k^*$, i.e.,
502537
```{math}
503-
\begin{equation}
504-
k^* & = \frac{(1-\alpha)(k^*)^{\alpha}}{ 1 + \beta^{-1/\gamma} (\alpha (k^*)^{\alpha-1})^{(\gamma-1)/\gamma}}
505-
\end{equation}
538+
:label: steady_state_crra
539+
k^* = \frac{(1-\alpha)(k^*)^{\alpha}}{ 1 + \beta^{-1/\gamma} (\alpha (k^*)^{\alpha-1})^{(\gamma-1)/\gamma}}
506540
```
507541

508542
+++
509543

510544
Similarly we can solve for $k^*$ using newton's method.
511545

512546
Suppose that
513-
$$
547+
```{math}
548+
:label: crra_newton_2
514549
g(k^*) = k^* \left [ 1 + \beta^{-1/\gamma} (\alpha (k^*)^{\alpha-1})^{(\gamma-1)/\gamma} \right ] - (1-\alpha)(k^*)^{\alpha}
515-
$$
550+
```
516551

517552
```{code-cell} ipython3
518553
def g(k_star, model):
@@ -599,9 +634,10 @@ To get the time path capital $\{k_t\}$ first we need to solve the household's ut
599634

600635
With the quasilinear preference the euler equation becomes
601636

602-
$$
637+
```{math}
638+
:label: euler_quasilinear
603639
1 + \theta (w_t - s_t)^{\theta-1} = \beta R_{t+1} + \beta R^{\theta}_{t+1} \theta s_t^{\theta - 1}
604-
$$
640+
```
605641

606642
Obviously $s_t$ cannot be solved by pencil and paper.
607643

@@ -613,7 +649,7 @@ To solve for $s_t$ we need to turn to the newton's method.
613649

614650
#### step 2
615651

616-
With equilibrium conditions for capital and labor (11) and (12) and the result from step 1, we can calculate the law of motion for per capita capital
652+
With Equations [](wage_2) and [](interest_rate_2) and the result from step 1, we can calculate the law of motion for per capita capital
617653
$$
618654
k_{t+1} = s(w_t, R_{t+1})
619655
$$

0 commit comments

Comments
 (0)