Skip to content

Commit 5dfb6ed

Browse files
Tom's June 29 edits of equalizing difference lecture
1 parent 20fff3c commit 5dfb6ed

File tree

1 file changed

+170
-2
lines changed

1 file changed

+170
-2
lines changed

lectures/equalizing_difference.md

Lines changed: 170 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ kernelspec:
1313

1414
# Equalizing Difference Model
1515

16+
## Overview
17+
1618
This lecture presents a model of the college-high-school wage gap in which the
1719
"time to build" a college graduate plays a key role.
1820

@@ -26,13 +28,25 @@ The idea behind this condition is that lifetime earnings have to adjust to make
2628

2729
It is just one instance of an "equalizing difference" theory of relative wage rates, a class of theories dating back at least to Adam Smith's **Wealth of Nations** {cite}`smith2010wealth`.
2830

31+
For most of this lecture, the only mathematical tools that we'll use are from linear algebra, in particular, matrix multiplication and matrix inversion.
32+
33+
However, at the very end of the lecture, we'll use calculus just in case readers want to see how computing partial derivatives could let us present some findings more concisely.
34+
35+
(And doing that will let us show off how good Python is at doing calculus!)
36+
37+
But if you don't know calculus, our tools from linear algebra are certainly enough.
38+
2939
As usual, we'll start by importing some Python modules.
3040

3141
```{code-cell} ipython3
3242
import numpy as np
3343
import matplotlib.pyplot as plt
3444
```
3545

46+
## The indifference condition
47+
48+
The key idea is that the initial college wage premium has to adjust to make a representative worker indifferent between going to college and not going to college.
49+
3650
Let
3751

3852
* $R > 1$ be the gross rate of return on a one-period bond
@@ -119,6 +133,8 @@ $$
119133
w_0^h A_h = \phi w_0^h A_c - D .
120134
$$ (eq:equalize)
121135
136+
This is the "indifference condition" that is at the heart of the model.
137+
122138
Solving equation {eq}`eq:equalize` for the college wage premium $\phi$ we obtain
123139
124140
$$
@@ -139,7 +155,7 @@ But first we'll describe a possible alternative interpretation of our model.
139155
140156
141157
142-
## A tweaked model: workers and entrepreneurs
158+
## Reinterpreting the model: workers and entrepreneurs
143159
144160
145161
We can add a parameter and reinterpret variables to get a model of entrepreneurs versus workers.
@@ -308,7 +324,7 @@ plt.show()
308324
```
309325
310326
311-
**Entrepreneur-worker interpretation**
327+
## Entrepreneur-worker interpretation
312328
313329
Now let's adopt the entrepreneur-worker interpretation of our model.
314330
@@ -335,6 +351,158 @@ plt.show()
335351
336352
Does the graph make sense to you?
337353
354+
355+
356+
## An application of calculus
357+
358+
So far, we have used only linear algebra and it has been a good enough tool for us to figure out how our model works.
359+
360+
However, someone who knows calculus might ask "Instead of plotting those graphs, why didn't you just take partial derivatives?"
361+
362+
We'll briefly do just that, yes, the questioner is correct and that partial derivatives are indeed a good tool for discovering the "comparative statics" properities of our model.
363+
364+
A reader who doesn't know calculus could read no further and feel confident that applying linear algebra has taught us the main properties of the model.
365+
366+
But for a reader interested in how we can get Python to do all the hard work involved in computing partial derivatives, we'll say a few things about that now.
367+
368+
We'll use the Python module 'sympy' to compute partial derivatives of $\phi$ with respect to the parameters that determine it.
369+
370+
Let's import key functions from sympy.
371+
372+
```{code-cell} ipython3
373+
from sympy import Symbol, Lambda, symbols
374+
```
375+
376+
Define symbols
377+
378+
```{code-cell} ipython3
379+
γ_h, γ_c, w_h0, D = symbols('\gamma_h, \gamma_h_c, w_0^h, D', real=True)
380+
R, T = Symbol('R', real=True), Symbol('T', integer=True)
381+
```
382+
383+
Define function $A_h$
384+
385+
```{code-cell} ipython3
386+
A_h = Lambda((γ_h, R, T), (1 - (γ_h/R)**(T+1)) / (1 - γ_h/R))
387+
A_h
388+
```
389+
390+
Define function $A_c$
391+
338392
```{code-cell} ipython3
393+
A_c = Lambda((γ_c, R, T), (1 - (γ_c/R)**(T-3)) / (1 - γ_c/R) * (γ_c/R)**4)
394+
A_c
395+
```
396+
397+
Now, define $\phi$
339398
399+
```{code-cell} ipython3
400+
ϕ = Lambda((D, γ_h, γ_c, R, T, w_h0), A_h(γ_h, R, T)/A_c(γ_c, R, T) + D/(w_h0*A_c(γ_c, R, T)))
340401
```
402+
403+
```{code-cell} ipython3
404+
ϕ
405+
```
406+
407+
We begin by setting default parameter values.
408+
409+
```{code-cell} ipython3
410+
R_value = 1.05
411+
T_value = 40
412+
γ_h_value, γ_c_value = 1.01, 1.01
413+
w_h0_value = 1
414+
D_value = 10
415+
```
416+
417+
Now let's compute $\frac{\partial \phi}{\partial D}$ and then evaluate it at the default values
418+
419+
```{code-cell} ipython3
420+
ϕ_D = ϕ(D, γ_h, γ_c, R, T, w_h0).diff(D)
421+
ϕ_D
422+
```
423+
424+
```{code-cell} ipython3
425+
# Numerical value at default parameters
426+
ϕ_D_func = Lambda((D, γ_h, γ_c, R, T, w_h0), ϕ_D)
427+
ϕ_D_func(D_value, γ_h_value, γ_c_value, R_value, T_value, w_h0_value)
428+
```
429+
430+
Thus, as with our graph above, we find that raising $R$ increases the initial college wage premium $\phi$.
431+
432+
+++
433+
434+
Compute $\frac{\partial \phi}{\partial T}$ and evaluate it a default parameters
435+
436+
```{code-cell} ipython3
437+
ϕ_T = ϕ(D, γ_h, γ_c, R, T, w_h0).diff(T)
438+
ϕ_T
439+
```
440+
441+
```{code-cell} ipython3
442+
# Numerical value at default parameters
443+
ϕ_T_func = Lambda((D, γ_h, γ_c, R, T, w_h0), ϕ_T)
444+
ϕ_T_func(D_value, γ_h_value, γ_c_value, R_value, T_value, w_h0_value)
445+
```
446+
447+
We find that raising $T$ decreases the initial college wage premium $\phi$.
448+
449+
This is because college graduates now have longer career lengths to "pay off" the time and other costs they paid to go to college
450+
451+
+++
452+
453+
Let's compute $\frac{\partial \phi}{\partial γ_h}$ and evaluate it at default parameters.
454+
455+
```{code-cell} ipython3
456+
ϕ_γ_h = ϕ(D, γ_h, γ_c, R, T, w_h0).diff(γ_h)
457+
ϕ_γ_h
458+
```
459+
460+
```{code-cell} ipython3
461+
# Numerical value at default parameters
462+
ϕ_γ_h_func = Lambda((D, γ_h, γ_c, R, T, w_h0), ϕ_γ_h)
463+
ϕ_γ_h_func(D_value, γ_h_value, γ_c_value, R_value, T_value, w_h0_value)
464+
```
465+
466+
We find that raising $\gamma_h$ increases the initial college wage premium $\phi$, as we did with our graphical analysis earlier
467+
468+
+++
469+
470+
Compute $\frac{\partial \phi}{\partial γ_c}$ and evaluate it numerically at default parameter values
471+
472+
```{code-cell} ipython3
473+
ϕ_γ_c = ϕ(D, γ_h, γ_c, R, T, w_h0).diff(γ_c)
474+
ϕ_γ_c
475+
```
476+
477+
```{code-cell} ipython3
478+
# Numerical value at default parameters
479+
ϕ_γ_c_func = Lambda((D, γ_h, γ_c, R, T, w_h0), ϕ_γ_c)
480+
ϕ_γ_c_func(D_value, γ_h_value, γ_c_value, R_value, T_value, w_h0_value)
481+
```
482+
483+
We find that raising $\gamma_c$ decreases the initial college wage premium $\phi$, as we did with our graphical analysis earlier
484+
485+
+++
486+
487+
Let's compute $\frac{\partial \phi}{\partial R}$ and evaluate it numerically at default parameter values
488+
489+
```{code-cell} ipython3
490+
ϕ_R = ϕ(D, γ_h, γ_c, R, T, w_h0).diff(R)
491+
ϕ_R
492+
```
493+
494+
```{code-cell} ipython3
495+
# Numerical value at default parameters
496+
ϕ_R_func = Lambda((D, γ_h, γ_c, R, T, w_h0), ϕ_R)
497+
ϕ_R_func(D_value, γ_h_value, γ_c_value, R_value, T_value, w_h0_value)
498+
```
499+
500+
+++ {"tags": []}
501+
502+
We find that raising the gross interest rate $R$ increases the initial college wage premium $\phi$, as we did with our graphical analysis earlier
503+
504+
505+
506+
```{code-cell} ipython3
507+
508+
```

0 commit comments

Comments
 (0)