Skip to content

Commit fb44e24

Browse files
committed
fix build
1 parent fb7d198 commit fb44e24

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

lectures/olg.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.14.4
7+
jupytext_version: 1.14.5
88
kernelspec:
99
display_name: Python 3 (ipykernel)
1010
language: python
1111
name: python3
1212
---
1313

14+
1415
# The Overlapping Generations Model
1516

1617
In this lecture we study the overlapping generations (OLG) model.
@@ -56,6 +57,7 @@ import matplotlib.pyplot as plt
5657
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
5758
```
5859

60+
5961
## Environment
6062

6163
TODO add timing and basic ideas of OLG
@@ -357,6 +359,7 @@ R_star, K_star = E_star
357359
plot_ad_as(aggregate_capital_demand, aggregate_capital_supply, m, K_prev=50, E_star=E_star)
358360
```
359361

362+
360363
Let's observe the dynamics of the equilibrium price $R^*_{t+1}$.
361364

362365
```{code-cell} ipython3
@@ -372,6 +375,7 @@ ax.set_xlabel("$K_{t}$")
372375
plt.show()
373376
```
374377

378+
375379
## Dynamics and steady state
376380

377381
Let $k_t := K_t / L$.
@@ -472,6 +476,7 @@ def k_star(model):
472476
plot_45(m, k_update, kstar=k_star(m))
473477
```
474478

479+
475480
## Another special case: CRRA preference
476481

477482

@@ -487,6 +492,7 @@ def crra(c, γ=0.5):
487492
m_crra = create_olg_model(u=crra, u_params={'γ': 0.5})
488493
```
489494

495+
490496
### New aggregate supply
491497

492498

@@ -558,6 +564,7 @@ def aggregate_supply_capital_crra(R, model, K_prev):
558564
plot_ad_as(aggregate_capital_demand, aggregate_supply_capital_crra, m_crra, K_prev=50, E_star=None) # John this is to be fixed.
559565
```
560566

567+
561568
Let's plot the aggregate supply with different values of utility parameter $\gamma$ and observe it's behaviour.
562569

563570
```{code-cell} ipython3
@@ -579,11 +586,11 @@ ax.legend()
579586
plt.show()
580587
```
581588

589+
582590
When $\gamma <1$ the supply curve is downward sloping. When $\gamma > 1$ the supply curve is upward sloping.
583591

584592
TODO: Do we need to add some explanation?
585593

586-
+++
587594

588595
### Dynamics and steady state
589596

@@ -642,6 +649,7 @@ def f(k_prime, k, model):
642649
return p - z
643650
```
644651

652+
645653
Let's define a function `k_next` that finds the value of $k_{t+1}$.
646654

647655
```{code-cell} ipython3
@@ -653,6 +661,7 @@ def k_next(k_prime, model):
653661
plot_45(m_crra, k_next, kstar=None)
654662
```
655663

664+
656665
Unlike the log preference case now a steady state cannot be solved analytically.
657666

658667
To see this recall that, a steady state can be obtained by setting [](law_of_motion_capital_crra) to $k_{t+1} = k_t = k^*$, i.e.,
@@ -690,6 +699,7 @@ print(f"k_star = {k_star}")
690699
plot_45(m_crra, k_next, k_star)
691700
```
692701

702+
693703
The next figure shows three time paths for capital, from
694704
three distinct initial conditions, under the parameterization listed above.
695705

@@ -731,6 +741,7 @@ def simulate_ts(m, x0_values, ts_length):
731741
simulate_ts(m_crra, x0, ts_length)
732742
```
733743

744+
734745
## Exercises
735746

736747

@@ -772,6 +783,7 @@ def find_Kstar(R_star, model):
772783
return model.L * (R_star / model.α)**(1/(model.α-1))
773784
```
774785

786+
775787
The following function plots the equilibrium quantity and equilibrium price.
776788

777789
```{code-cell} ipython3
@@ -812,6 +824,7 @@ m_crra = create_olg_model(u=crra, u_params={'γ': 0.5})
812824
plot_ks_rs(K_t_vals, m_crra)
813825
```
814826

827+
815828
```{solution-end}
816829
```
817830

@@ -858,6 +871,7 @@ def u_quasilinear(c, θ=6):
858871
return c + c**θ
859872
```
860873

874+
861875
The function `find_k_next` is used to find $k_{t+1}$ by finding
862876
the root of equation [](euler_quasilinear1) using the helper
863877
function `solve_for_k_next` for a given value of $k_t$.
@@ -885,13 +899,14 @@ def solve_for_k_star_q(x, model):
885899
return l - r
886900
887901
def find_k_star_q(model):
888-
return optimize.newton(solve_for_k_star_q, 0.3, args=(model,))
902+
return optimize.newton(solve_for_k_star_q, 0.2, args=(model,))
889903
```
890904

905+
891906
Let's simulate and plot the time path capital $\{k_t\}$.
892907

893908
```{code-cell} ipython3
894-
def simulate_ts(k0_values, model, ts_length=10):
909+
def simulate_ts(k0_values, model, ts_length=6):
895910
k_star = find_k_star_q(model)
896911
897912
print("k_star:", k_star)
@@ -922,10 +937,5 @@ m_quasilinear = create_olg_model(u=u_quasilinear, u_params={'θ': 6})
922937
simulate_ts(k0_values, m_quasilinear)
923938
```
924939

925-
```{code-cell} ipython3
926-
927-
```
928-
929-
```{code-cell} ipython3
930-
940+
```{solution-end}
931941
```

0 commit comments

Comments
 (0)