{ "cells": [ { "cell_type": "markdown", "id": "e40791d9", "metadata": {}, "source": [ "\n", "\n", "\n", "" ] }, { "cell_type": "markdown", "id": "88fff5a2", "metadata": {}, "source": [ "# Rosen Schooling Model" ] }, { "cell_type": "markdown", "id": "2d5e8283", "metadata": {}, "source": [ "## Contents\n", "\n", "- [Rosen Schooling Model](#Rosen-Schooling-Model) \n", " - [A One-Occupation Model](#A-One-Occupation-Model) \n", " - [Mapping into HS2013 Framework](#Mapping-into-HS2013-Framework) " ] }, { "cell_type": "markdown", "id": "cfaa2b8e", "metadata": {}, "source": [ "This lecture is yet another part of a suite of lectures that use the quantecon DLE class to instantiate models within the\n", "[[HS13](https://python-advanced.quantecon.org/zreferences.html#id71)] class of models described in detail in [Recursive Models of Dynamic Linear Economies](https://python-advanced.quantecon.org/hs_recursive_models.html).\n", "\n", "In addition to what’s included in Anaconda, this lecture uses the quantecon library" ] }, { "cell_type": "code", "execution_count": null, "id": "674add3b", "metadata": { "hide-output": false }, "outputs": [], "source": [ "!pip install --upgrade quantecon" ] }, { "cell_type": "markdown", "id": "74daef4d", "metadata": {}, "source": [ "We’ll also need the following imports:" ] }, { "cell_type": "code", "execution_count": null, "id": "0e480e25", "metadata": { "hide-output": false }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from collections import namedtuple\n", "from quantecon import DLE\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "id": "415f6c20", "metadata": {}, "source": [ "## A One-Occupation Model\n", "\n", "Ryoo and Rosen’s (2004) [[RR04](https://python-advanced.quantecon.org/zreferences.html#id69)] partial equilibrium model determines\n", "\n", "- a stock of “Engineers” $ N_t $ \n", "- a number of new entrants in engineering school, $ n_t $ \n", "- the wage rate of engineers, $ w_t $ \n", "\n", "\n", "It takes k periods of schooling to become an engineer.\n", "\n", "The model consists of the following equations:\n", "\n", "- a demand curve for engineers: \n", "\n", "\n", "$$\n", "w_t = - \\alpha_d N_t + \\epsilon_{dt}\n", "$$\n", "\n", "- a time-to-build structure of the education process: \n", "\n", "\n", "$$\n", "N_{t+k} = \\delta_N N_{t+k-1} + n_t\n", "$$\n", "\n", "- a definition of the discounted present value of each new engineering\n", " student: \n", "\n", "\n", "$$\n", "v_t = \\beta_k \\mathbb{E} \\sum_{j=0}^\\infty (\\beta \\delta_N)^j w_{t+k+j}\n", "$$\n", "\n", "- a supply curve of new students driven by present value $ v_t $: \n", "\n", "\n", "$$\n", "n_t = \\alpha_s v_t + \\epsilon_{st}\n", "$$" ] }, { "cell_type": "markdown", "id": "7c461683", "metadata": {}, "source": [ "## Mapping into HS2013 Framework\n", "\n", "We represent this model in the [[HS13](https://python-advanced.quantecon.org/zreferences.html#id71)] framework by\n", "\n", "- sweeping the time-to-build structure and the demand for engineers\n", " into the household technology, and \n", "- putting the supply of engineers into the technology for producing\n", " goods " ] }, { "cell_type": "markdown", "id": "f6421986", "metadata": {}, "source": [ "### Preferences\n", "\n", "$$\n", "\\Pi = 0, \\Lambda=\n", "\\begin{bmatrix}\n", " \\alpha_d & 0 & \\cdots & 0\n", " \\end{bmatrix}\n", ", \\Delta_h =\n", "\\begin{bmatrix}\n", " \\delta_N & 1 & 0 & \\cdots & 0 \\\\ 0 & 0 & 1 & \\cdots & 0 \\\\ \\vdots & \\vdots & \\vdots & \\ddots & \\vdots \\\\ 0 & \\cdots& \\cdots & 0 & 1 \\\\ 0 & 0 & 0 & \\cdots & 0\n", " \\end{bmatrix}\n", " , \\Theta_h =\n", "\\begin{bmatrix}\n", " 0 \\\\ 0 \\\\ \\vdots \\\\ 0 \\\\ 1\n", " \\end{bmatrix}\n", "$$\n", "\n", "where $ \\Lambda $ is a k+1 x 1 matrix, $ \\Delta_h $ is a k_1 x\n", "k+1 matrix, and $ \\Theta_h $ is a k+1 x 1 matrix.\n", "\n", "This specification sets $ N_t = h_{1t-1} $, $ n_t = c_t $,\n", "$ h_{\\tau+1,t-1} = n_{t-(k-\\tau)} $ for $ \\tau = 1,...,k $.\n", "\n", "Below we set things up so that the number of years of education, $ k $, can\n", "be varied." ] }, { "cell_type": "markdown", "id": "a913ba3c", "metadata": {}, "source": [ "### Technology\n", "\n", "To capture Ryoo and Rosen’s [[RR04](https://python-advanced.quantecon.org/zreferences.html#id69)] supply curve, we use the physical\n", "technology:\n", "\n", "$$\n", "c_t = i_t + d_{1t}\n", "$$\n", "\n", "$$\n", "\\psi_1i_t = g_t\n", "$$\n", "\n", "where $ \\psi_1 $ is inversely proportional to $ \\alpha_s $." ] }, { "cell_type": "markdown", "id": "0caba65d", "metadata": {}, "source": [ "### Information\n", "\n", "Because we want $ b_t = \\epsilon_{dt} $ and $ d_{1t} =\\epsilon_{st} $, we set\n", "\n", "$$\n", "A_{22}=\n", "\\begin{bmatrix}\n", " 1 & 0 & 0 \\\\ 0 & \\rho_s & 0 \\\\ 0 & 0 & \\rho_d\n", " \\end{bmatrix}\n", ", C_2 =\n", "\\begin{bmatrix}\n", " 0 & 0 \\\\ 1 & 0 \\\\ 0 & 1\n", " \\end{bmatrix}\n", ", U_b =\n", "\\begin{bmatrix}\n", " 30 & 0 & 1\n", " \\end{bmatrix}\n", ", U_d =\n", "\\begin{bmatrix}\n", " 10 & 1 & 0 \\\\ 0 & 0 & 0\n", " \\end{bmatrix}\n", "$$\n", "\n", "where $ \\rho_s $ and $ \\rho_d $ describe the persistence of the\n", "supply and demand shocks" ] }, { "cell_type": "code", "execution_count": null, "id": "563ba82a", "metadata": { "hide-output": false }, "outputs": [], "source": [ "Information = namedtuple('Information', ['a22', 'c2','ub','ud'])\n", "Technology = namedtuple('Technology', ['ϕ_c', 'ϕ_g', 'ϕ_i', 'γ', 'δ_k', 'θ_k'])\n", "Preferences = namedtuple('Preferences', ['β', 'l_λ', 'π_h', 'δ_h', 'θ_h'])" ] }, { "cell_type": "markdown", "id": "0769ca87", "metadata": {}, "source": [ "### Effects of Changes in Education Technology and Demand\n", "\n", "We now study how changing\n", "\n", "- the number of years of education required to become an engineer and \n", "- the slope of the demand curve \n", "\n", "\n", "affects responses to demand shocks.\n", "\n", "To begin, we set $ k = 4 $ and $ \\alpha_d = 0.1 $" ] }, { "cell_type": "code", "execution_count": null, "id": "06ee5855", "metadata": { "hide-output": false }, "outputs": [], "source": [ "k = 4 # Number of periods of schooling required to become an engineer\n", "\n", "β = np.array([[1 / 1.05]])\n", "α_d = np.array([[0.1]])\n", "α_s = 1\n", "ε_1 = 1e-7\n", "λ_1 = np.full((1, k), ε_1)\n", "# Use of ε_1 is trick to aquire detectability, see HS2013 p. 228 footnote 4\n", "l_λ = np.hstack((α_d, λ_1))\n", "π_h = np.array([[0]])\n", "\n", "δ_n = np.array([[0.95]])\n", "d1 = np.vstack((δ_n, np.zeros((k - 1, 1))))\n", "d2 = np.hstack((d1, np.eye(k)))\n", "δ_h = np.vstack((d2, np.zeros((1, k + 1))))\n", "\n", "θ_h = np.vstack((np.zeros((k, 1)),\n", " np.ones((1, 1))))\n", "\n", "ψ_1 = 1 / α_s\n", "\n", "ϕ_c = np.array([[1], [0]])\n", "ϕ_g = np.array([[0], [-1]])\n", "ϕ_i = np.array([[-1], [ψ_1]])\n", "γ = np.array([[0], [0]])\n", "\n", "δ_k = np.array([[0]])\n", "θ_k = np.array([[0]])\n", "\n", "ρ_s = 0.8\n", "ρ_d = 0.8\n", "\n", "a22 = np.array([[1, 0, 0],\n", " [0, ρ_s, 0],\n", " [0, 0, ρ_d]])\n", "\n", "c2 = np.array([[0, 0], [10, 0], [0, 10]])\n", "ub = np.array([[30, 0, 1]])\n", "ud = np.array([[10, 1, 0], [0, 0, 0]])\n", "\n", "info1 = Information(a22, c2, ub, ud)\n", "tech1 = Technology(ϕ_c, ϕ_g, ϕ_i, γ, δ_k, θ_k)\n", "pref1 = Preferences(β, l_λ, π_h, δ_h, θ_h)\n", "\n", "econ1 = DLE(info1, tech1, pref1)" ] }, { "cell_type": "markdown", "id": "04494247", "metadata": {}, "source": [ "We create three other instances by:\n", "\n", "1. Raising $ \\alpha_d $ to 2 \n", "1. Raising $ k $ to 7 \n", "1. Raising $ k $ to 10 " ] }, { "cell_type": "code", "execution_count": null, "id": "38e9ac7a", "metadata": { "hide-output": false }, "outputs": [], "source": [ "α_d = np.array([[2]])\n", "l_λ = np.hstack((α_d, λ_1))\n", "pref2 = Preferences(β, l_λ, π_h, δ_h, θ_h)\n", "econ2 = DLE(info1, tech1, pref2)\n", "\n", "α_d = np.array([[0.1]])\n", "\n", "k = 7\n", "λ_1 = np.full((1, k), ε_1)\n", "l_λ = np.hstack((α_d, λ_1))\n", "d1 = np.vstack((δ_n, np.zeros((k - 1, 1))))\n", "d2 = np.hstack((d1, np.eye(k)))\n", "δ_h = np.vstack((d2, np.zeros((1, k+1))))\n", "θ_h = np.vstack((np.zeros((k, 1)),\n", " np.ones((1, 1))))\n", "\n", "Pref3 = Preferences(β, l_λ, π_h, δ_h, θ_h)\n", "econ3 = DLE(info1, tech1, Pref3)\n", "\n", "k = 10\n", "λ_1 = np.full((1, k), ε_1)\n", "l_λ = np.hstack((α_d, λ_1))\n", "d1 = np.vstack((δ_n, np.zeros((k - 1, 1))))\n", "d2 = np.hstack((d1, np.eye(k)))\n", "δ_h = np.vstack((d2, np.zeros((1, k + 1))))\n", "θ_h = np.vstack((np.zeros((k, 1)),\n", " np.ones((1, 1))))\n", "\n", "pref4 = Preferences(β, l_λ, π_h, δ_h, θ_h)\n", "econ4 = DLE(info1, tech1, pref4)\n", "\n", "shock_demand = np.array([[0], [1]])\n", "\n", "econ1.irf(ts_length=25, shock=shock_demand)\n", "econ2.irf(ts_length=25, shock=shock_demand)\n", "econ3.irf(ts_length=25, shock=shock_demand)\n", "econ4.irf(ts_length=25, shock=shock_demand)" ] }, { "cell_type": "markdown", "id": "f97aedf6", "metadata": {}, "source": [ "The first figure plots the impulse response of $ n_t $ (on the left)\n", "and $ N_t $ (on the right) to a positive demand shock, for\n", "$ \\alpha_d = 0.1 $ and $ \\alpha_d = 2 $.\n", "\n", "When $ \\alpha_d = 2 $, the number of new students $ n_t $ rises\n", "initially, but the response then turns negative.\n", "\n", "A positive demand shock raises wages, drawing new students into the\n", "profession.\n", "\n", "However, these new students raise $ N_t $.\n", "\n", "The higher is $ \\alpha_d $, the larger the effect of this rise in\n", "$ N_t $ on wages.\n", "\n", "This counteracts the demand shock’s positive effect on wages, reducing\n", "the number of new students in subsequent periods.\n", "\n", "Consequently, when $ \\alpha_d $ is lower, the effect of a demand\n", "shock on $ N_t $ is larger" ] }, { "cell_type": "code", "execution_count": null, "id": "6ba136f1", "metadata": { "hide-output": false }, "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))\n", "ax1.plot(econ1.c_irf,label='$\\\\alpha_d = 0.1$')\n", "ax1.plot(econ2.c_irf,label='$\\\\alpha_d = 2$')\n", "ax1.legend()\n", "ax1.set_title('Response of $n_t$ to a demand shock')\n", "\n", "ax2.plot(econ1.h_irf[:, 0], label='$\\\\alpha_d = 0.1$')\n", "ax2.plot(econ2.h_irf[:, 0], label='$\\\\alpha_d = 24$')\n", "ax2.legend()\n", "ax2.set_title('Response of $N_t$ to a demand shock')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "8b352b67", "metadata": {}, "source": [ "The next figure plots the impulse response of $ n_t $ (on the left)\n", "and $ N_t $ (on the right) to a positive demand shock, for\n", "$ k=4 $, $ k=7 $ and $ k=10 $ (with $ \\alpha_d = 0.1 $)" ] }, { "cell_type": "code", "execution_count": null, "id": "06d87664", "metadata": { "hide-output": false }, "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))\n", "ax1.plot(econ1.c_irf, label='$k=4$')\n", "ax1.plot(econ3.c_irf, label='$k=7$')\n", "ax1.plot(econ4.c_irf, label='$k=10$')\n", "ax1.legend()\n", "ax1.set_title('Response of $n_t$ to a demand shock')\n", "\n", "ax2.plot(econ1.h_irf[:,0], label='$k=4$')\n", "ax2.plot(econ3.h_irf[:,0], label='$k=7$')\n", "ax2.plot(econ4.h_irf[:,0], label='$k=10$')\n", "ax2.legend()\n", "ax2.set_title('Response of $N_t$ to a demand shock')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "d93be850", "metadata": {}, "source": [ "Both panels in the above figure show that raising $ k $ lowers the effect of\n", "a positive demand shock on entry into the engineering profession.\n", "\n", "Increasing the number of periods of schooling lowers\n", "the number of new students in response to a demand shock.\n", "\n", "This occurs because with longer required schooling, new students ultimately benefit less from the impact of that shock on wages." ] } ], "metadata": { "date": 1705369587.2692988, "filename": "rosen_schooling_model.md", "kernelspec": { "display_name": "Python", "language": "python3", "name": "python3" }, "title": "Rosen Schooling Model" }, "nbformat": 4, "nbformat_minor": 5 }