@@ -11,8 +11,6 @@ kernelspec:
11
11
name : python3
12
12
---
13
13
14
-
15
-
16
14
# The Overlapping Generations Model
17
15
18
16
In this lecture we study the overlapping generations (OLG) model.
@@ -58,8 +56,6 @@ import matplotlib.pyplot as plt
58
56
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
59
57
```
60
58
61
-
62
-
63
59
## Environment
64
60
65
61
TODO add timing and basic ideas of OLG
@@ -361,8 +357,6 @@ R_star, K_star = E_star
361
357
plot_ad_as(aggregate_capital_demand, aggregate_capital_supply, m, K_prev=50, E_star=E_star)
362
358
```
363
359
364
-
365
-
366
360
Let's observe the dynamics of the equilibrium price $R^* _ {t+1}$.
367
361
368
362
``` {code-cell} ipython3
@@ -378,8 +372,6 @@ ax.set_xlabel("$K_{t}$")
378
372
plt.show()
379
373
```
380
374
381
-
382
-
383
375
## Dynamics and steady state
384
376
385
377
Let $k_t := K_t / L$.
@@ -444,7 +436,7 @@ def plot_45(m, k_update, kstar=None):
444
436
ymin, ymax = np.min(k_grid_next), np.max(k_grid_next)
445
437
446
438
ax.plot(k_grid, k_grid_next, lw=2, alpha=0.6, label='$g$')
447
- ax.plot(k_grid, k_grid, 'k-', lw=1, alpha=0.7, label='45 ')
439
+ ax.plot(k_grid, k_grid, 'k-', lw=1, alpha=0.7, label='$45^{\circ}$ ')
448
440
449
441
if kstar:
450
442
fps = (kstar,)
@@ -480,8 +472,6 @@ def k_star(model):
480
472
plot_45(m, k_update, kstar=k_star(m))
481
473
```
482
474
483
-
484
-
485
475
## Another special case: CRRA preference
486
476
487
477
@@ -497,8 +487,6 @@ def crra(c, γ=0.5):
497
487
m_crra = create_olg_model(u=crra, u_params={'γ': 0.5})
498
488
```
499
489
500
-
501
-
502
490
### New aggregate supply
503
491
504
492
@@ -570,8 +558,6 @@ def aggregate_supply_capital_crra(R, model, K_prev):
570
558
plot_ad_as(aggregate_capital_demand, aggregate_supply_capital_crra, m_crra, K_prev=50, E_star=None) # John this is to be fixed.
571
559
```
572
560
573
-
574
-
575
561
Let's plot the aggregate supply with different values of utility parameter $\gamma$ and observe it's behaviour.
576
562
577
563
``` {code-cell} ipython3
@@ -593,8 +579,6 @@ ax.legend()
593
579
plt.show()
594
580
```
595
581
596
-
597
-
598
582
When $\gamma <1$ the supply curve is downward sloping. When $\gamma > 1$ the supply curve is upward sloping.
599
583
600
584
TODO: Do we need to add some explanation?
@@ -657,8 +641,6 @@ def f(k_prime, k, model):
657
641
return p - z
658
642
```
659
643
660
-
661
-
662
644
Let's define a function ` k_next ` that finds the value of $k_ {t+1}$.
663
645
664
646
``` {code-cell} ipython3
@@ -670,8 +652,6 @@ def k_next(k_prime, model):
670
652
plot_45(m_crra, k_next, kstar=None)
671
653
```
672
654
673
-
674
-
675
655
Unlike the log preference case now a steady state cannot be solved analytically.
676
656
677
657
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.,
@@ -709,8 +689,6 @@ print(f"k_star = {k_star}")
709
689
plot_45(m_crra, k_next, k_star)
710
690
```
711
691
712
-
713
-
714
692
The next figure shows three time paths for capital, from
715
693
three distinct initial conditions, under the parameterization listed above.
716
694
@@ -752,8 +730,6 @@ def simulate_ts(m, x0_values, ts_length):
752
730
simulate_ts(m_crra, x0, ts_length)
753
731
```
754
732
755
-
756
-
757
733
## Exercises
758
734
759
735
@@ -795,8 +771,6 @@ def find_Kstar(R_star, model):
795
771
return model.L * (R_star / model.α)**(1/(model.α-1))
796
772
```
797
773
798
-
799
-
800
774
The following function plots the equilibrium quantity and equilibrium price.
801
775
802
776
``` {code-cell} ipython3
@@ -837,8 +811,6 @@ m_crra = create_olg_model(u=crra, u_params={'γ': 0.5})
837
811
plot_ks_rs(K_t_vals, m_crra)
838
812
```
839
813
840
-
841
-
842
814
``` {solution-end}
843
815
```
844
816
@@ -885,8 +857,6 @@ def u_quasilinear(c, θ=3):
885
857
return c + c**θ
886
858
```
887
859
888
-
889
-
890
860
The function ` find_k_next ` is used to find $k_ {t+1}$ by finding
891
861
the root of equation [ ] ( euler_quasilinear1 ) using the helper
892
862
function ` solve_for_k_next ` for a given value of $k_t$.
@@ -923,8 +893,6 @@ def find_k_star_q(model):
923
893
# return optimize.newton(solve_for_k_star_q, 0.2, args=(model,))
924
894
```
925
895
926
-
927
-
928
896
Let's simulate and plot the time path capital $\{ k_t\} $.
929
897
930
898
``` {code-cell} ipython3
@@ -959,5 +927,9 @@ m_quasilinear = create_olg_model(u=u_quasilinear, u_params={'θ': 3})
959
927
simulate_ts(k0_values, m_quasilinear)
960
928
```
961
929
930
+ ``` {code-cell} ipython3
931
+ plot_45(m_quasilinear, find_k_next, kstar=None)
932
+ ```
933
+
962
934
``` {solution-end}
963
935
```
0 commit comments