Skip to content

Commit d037ca8

Browse files
Tom's June 25 corrections of rosen lecture
1 parent a192fbf commit d037ca8

1 file changed

Lines changed: 218 additions & 6 deletions

File tree

‎lectures/rosen_schooling_model.md‎

Lines changed: 218 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $$
7272
student:
7373

7474
$$
75-
v_t = \beta_k \mathbb{E} \sum_{j=0}^\infty (\beta \delta_N)^j w_{t+k+j}
75+
v_t = \beta^k \mathbb{E} \sum_{j=0}^\infty (\beta \delta_N)^j w_{t+k+j}
7676
$$
7777

7878
- a supply curve of new students driven by present value $v_t$:
@@ -81,7 +81,7 @@ $$
8181
n_t = \alpha_s v_t + \epsilon_{st}
8282
$$
8383

84-
## Mapping into HS2013 framework
84+
## Mapping into Hansen-Sargent (2013) framework
8585

8686
We represent this model in the {cite}`HS2013` framework by
8787

@@ -107,8 +107,8 @@ $$
107107
\end{bmatrix}
108108
$$
109109

110-
where $\Lambda$ is a k+1 x 1 matrix, $\Delta_h$ is a k_1 x
111-
k+1 matrix, and $\Theta_h$ is a k+1 x 1 matrix.
110+
where $\Lambda$ is a $1 \times (k+1)$ matrix, $\Delta_h$ is a $(k+1) \times
111+
(k+1)$ matrix, and $\Theta_h$ is a $(k+1) \times 1$ matrix.
112112

113113
This specification sets $N_t = h_{1t-1}$, $n_t = c_t$,
114114
$h_{\tau+1,t-1} = n_{t-(k-\tau)}$ for $\tau = 1,...,k$.
@@ -182,7 +182,7 @@ k = 4 # Number of periods of schooling required to become an engineer
182182
α_s = 1
183183
ε_1 = 1e-7
184184
λ_1 = np.full((1, k), ε_1)
185-
# Use of ε_1 is trick to aquire detectability, see HS2013 p. 228 footnote 4
185+
# Use of ε_1 is a trick to acquire detectability, see HS2013 p. 228 footnote 4
186186
l_λ = np.hstack((α_d, λ_1))
187187
π_h = np.array([[0]])
188188
@@ -297,7 +297,7 @@ ax1.legend()
297297
ax1.set_title('Response of $n_t$ to a demand shock')
298298
299299
ax2.plot(econ1.h_irf[:, 0], label=r'$\alpha_d = 0.1$')
300-
ax2.plot(econ2.h_irf[:, 0], label=r'$\alpha_d = 24$')
300+
ax2.plot(econ2.h_irf[:, 0], label=r'$\alpha_d = 2$')
301301
ax2.legend()
302302
ax2.set_title('Response of $N_t$ to a demand shock')
303303
plt.show()
@@ -330,3 +330,215 @@ Increasing the number of periods of schooling lowers
330330
the number of new students in response to a demand shock.
331331

332332
This occurs because with longer required schooling, new students ultimately benefit less from the impact of that shock on wages.
333+
334+
## Exercises
335+
336+
```{exercise}
337+
:label: rsm_ex1
338+
339+
In the lecture we varied the slope of the demand curve $\alpha_d$ and the
340+
length of schooling $k$, holding the persistence of the demand shock fixed at
341+
$\rho_d = 0.8$.
342+
343+
Now investigate how the **persistence of the demand shock** matters.
344+
345+
Holding $k = 4$ and $\alpha_d = 0.1$, compute and plot the impulse responses of
346+
$n_t$ and $N_t$ to a unit demand shock for $\rho_d \in \{0.2, 0.5, 0.8, 0.95\}$.
347+
348+
You should find that as $\rho_d$ falls towards zero the responses shrink towards
349+
zero, so that a nearly transitory demand shock leaves entry and the engineer
350+
stock almost unchanged.
351+
352+
Predict the direction of the effect before running the code, and then explain
353+
*why* a transitory demand shock produces essentially no response.
354+
```
355+
356+
```{solution-start} rsm_ex1
357+
:class: dropdown
358+
```
359+
360+
Recall that the present value of entering engineering school is
361+
362+
$$
363+
v_t = \beta^k \mathbb{E}_t \sum_{j=0}^\infty (\beta \delta_N)^j w_{t+k+j}.
364+
$$
365+
366+
A student who enters at $t$ does not start earning the wage until $t+k$.
367+
368+
Ignoring the general-equilibrium feedback through $N_t$, the wage premium
369+
expected $k+j$ periods ahead is $\rho_d^{\,k+j}\,\epsilon_{dt}$, so
370+
371+
$$
372+
v_t \;\propto\; (\beta \rho_d)^k\, \epsilon_{dt}
373+
\sum_{j=0}^\infty (\beta \delta_N \rho_d)^j .
374+
$$
375+
376+
The decisive term is the factor $(\beta \rho_d)^k$ out front: what matters is how
377+
much of the wage premium *survives the $k$ periods of schooling*.
378+
379+
Hence the more persistent is the demand shock (the larger is $\rho_d$), the more
380+
of the wage increase remains by graduation, so $v_t$ — and therefore entry $n_t$
381+
and ultimately the stock $N_t$ — responds more strongly.
382+
383+
In the limit $\rho_d \to 0$ the factor $(\beta\rho_d)^k \to 0$: a purely
384+
transitory demand shock has fully died out (in expectation) before any new
385+
student can graduate, so $v_t = 0$ and there is *no* response of $n_t$ or $N_t$
386+
at all. This is the sharpest expression of the time-to-build mechanism.
387+
388+
We rebuild the model for $k = 4$ and loop over values of $\rho_d$.
389+
390+
```{code-cell} python3
391+
k = 4
392+
393+
β = np.array([[1 / 1.05]])
394+
α_d = np.array([[0.1]])
395+
α_s = 1
396+
ε_1 = 1e-7
397+
λ_1 = np.full((1, k), ε_1)
398+
l_λ = np.hstack((α_d, λ_1))
399+
π_h = np.array([[0]])
400+
401+
δ_n = np.array([[0.95]])
402+
d1 = np.vstack((δ_n, np.zeros((k - 1, 1))))
403+
d2 = np.hstack((d1, np.eye(k)))
404+
δ_h = np.vstack((d2, np.zeros((1, k + 1))))
405+
θ_h = np.vstack((np.zeros((k, 1)), np.ones((1, 1))))
406+
407+
ψ_1 = 1 / α_s
408+
ϕ_c = np.array([[1], [0]])
409+
ϕ_g = np.array([[0], [-1]])
410+
ϕ_i = np.array([[-1], [ψ_1]])
411+
γ = np.array([[0], [0]])
412+
δ_k = np.array([[0]])
413+
θ_k = np.array([[0]])
414+
415+
ρ_s = 0.8
416+
c2 = np.array([[0, 0], [10, 0], [0, 10]])
417+
ub = np.array([[30, 0, 1]])
418+
ud = np.array([[10, 1, 0], [0, 0, 0]])
419+
420+
pref = Preferences(β, l_λ, π_h, δ_h, θ_h)
421+
tech = Technology(ϕ_c, ϕ_g, ϕ_i, γ, δ_k, θ_k)
422+
423+
shock_demand = np.array([[0], [1]])
424+
425+
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))
426+
427+
for ρ_d in [0.2, 0.5, 0.8, 0.95]:
428+
a22 = np.array([[1, 0, 0],
429+
[0, ρ_s, 0],
430+
[0, 0, ρ_d]])
431+
info = Information(a22, c2, ub, ud)
432+
econ = DLE(info, tech, pref)
433+
econ.irf(ts_length=25, shock=shock_demand)
434+
ax1.plot(econ.c_irf, label=fr'$\rho_d = {ρ_d}$')
435+
ax2.plot(econ.h_irf[:, 0], label=fr'$\rho_d = {ρ_d}$')
436+
437+
ax1.legend()
438+
ax1.set_title('Response of $n_t$ to a demand shock')
439+
ax2.legend()
440+
ax2.set_title('Response of $N_t$ to a demand shock')
441+
plt.show()
442+
```
443+
444+
As anticipated, a more persistent demand shock produces a larger response of
445+
both entry $n_t$ and the stock of engineers $N_t$.
446+
447+
Notice how steeply the responses fall as $\rho_d$ declines: the $\rho_d = 0.2$
448+
curves sit almost on top of the zero line. This is the $(\beta\rho_d)^k$ factor
449+
at work — with $k = 4$ and $\beta \approx 0.95$ we have $(\beta \times 0.2)^4
450+
\approx 0.0013$ against $(\beta \times 0.95)^4 \approx 0.67$, so the
451+
$\rho_d = 0.2$ response is only about two tenths of one percent of the
452+
$\rho_d = 0.95$ response.
453+
454+
When $\rho_d$ is small the wage increase has largely dissipated by the time a
455+
new student graduates $k$ periods later, so the incentive to enter is weak — and
456+
for a purely transitory shock ($\rho_d = 0$) it disappears entirely.
457+
458+
```{solution-end}
459+
```
460+
461+
```{exercise}
462+
:label: rsm_ex2
463+
464+
The slope of Ryoo and Rosen's supply curve is governed by $\alpha_s$, which
465+
enters the household technology through $\psi_1 = 1 / \alpha_s$.
466+
467+
Holding $k = 4$, $\alpha_d = 0.1$ and $\rho_d = 0.8$, compute and plot the
468+
impulse responses of $n_t$ and $N_t$ to a unit demand shock for
469+
$\alpha_s \in \{0.5, 1, 2\}$.
470+
471+
Explain the economic intuition for what you find.
472+
```
473+
474+
```{solution-start} rsm_ex2
475+
:class: dropdown
476+
```
477+
478+
A larger $\alpha_s$ means a flatter (more elastic) supply curve of new
479+
students, so a given rise in the present value $v_t$ of entering the profession
480+
draws in more new students.
481+
482+
We therefore expect the response of $n_t$ — and, with a lag, the response of
483+
$N_t$ — to grow as $\alpha_s$ increases.
484+
485+
```{code-cell} python3
486+
k = 4
487+
488+
β = np.array([[1 / 1.05]])
489+
α_d = np.array([[0.1]])
490+
ε_1 = 1e-7
491+
λ_1 = np.full((1, k), ε_1)
492+
l_λ = np.hstack((α_d, λ_1))
493+
π_h = np.array([[0]])
494+
495+
δ_n = np.array([[0.95]])
496+
d1 = np.vstack((δ_n, np.zeros((k - 1, 1))))
497+
d2 = np.hstack((d1, np.eye(k)))
498+
δ_h = np.vstack((d2, np.zeros((1, k + 1))))
499+
θ_h = np.vstack((np.zeros((k, 1)), np.ones((1, 1))))
500+
501+
γ = np.array([[0], [0]])
502+
δ_k = np.array([[0]])
503+
θ_k = np.array([[0]])
504+
505+
ρ_s = 0.8
506+
ρ_d = 0.8
507+
a22 = np.array([[1, 0, 0],
508+
[0, ρ_s, 0],
509+
[0, 0, ρ_d]])
510+
c2 = np.array([[0, 0], [10, 0], [0, 10]])
511+
ub = np.array([[30, 0, 1]])
512+
ud = np.array([[10, 1, 0], [0, 0, 0]])
513+
514+
info = Information(a22, c2, ub, ud)
515+
pref = Preferences(β, l_λ, π_h, δ_h, θ_h)
516+
517+
shock_demand = np.array([[0], [1]])
518+
519+
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))
520+
521+
for α_s in [0.5, 1, 2]:
522+
ψ_1 = 1 / α_s
523+
ϕ_c = np.array([[1], [0]])
524+
ϕ_g = np.array([[0], [-1]])
525+
ϕ_i = np.array([[-1], [ψ_1]])
526+
tech = Technology(ϕ_c, ϕ_g, ϕ_i, γ, δ_k, θ_k)
527+
econ = DLE(info, tech, pref)
528+
econ.irf(ts_length=25, shock=shock_demand)
529+
ax1.plot(econ.c_irf, label=fr'$\alpha_s = {α_s}$')
530+
ax2.plot(econ.h_irf[:, 0], label=fr'$\alpha_s = {α_s}$')
531+
532+
ax1.legend()
533+
ax1.set_title('Response of $n_t$ to a demand shock')
534+
ax2.legend()
535+
ax2.set_title('Response of $N_t$ to a demand shock')
536+
plt.show()
537+
```
538+
539+
The figures confirm the intuition: a more elastic supply of students (a larger
540+
$\alpha_s$) amplifies the response of new entrants $n_t$ to the demand shock,
541+
and this feeds through into a larger response of the stock of engineers $N_t$.
542+
543+
```{solution-end}
544+
```

0 commit comments

Comments
 (0)