From b11d0bb5ac881b2795efcd4ad2a8babdd3b4edd4 Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Tue, 19 Sep 2023 16:49:25 -0400 Subject: [PATCH] Tom's Sept 19 edits of two Cass-Koopmans lectures --- lectures/cass_koopmans_1.md | 71 +++++++++++++++++-------------- lectures/cass_koopmans_2.md | 85 ++++++++++++++++++++----------------- 2 files changed, 86 insertions(+), 70 deletions(-) diff --git a/lectures/cass_koopmans_1.md b/lectures/cass_koopmans_1.md index 5c668b38a..cfca78c11 100644 --- a/lectures/cass_koopmans_1.md +++ b/lectures/cass_koopmans_1.md @@ -93,13 +93,13 @@ Let $K_t$ be the stock of physical capital at time $t$. Let $\vec{C}$ = $\{C_0,\dots, C_T\}$ and $\vec{K}$ = $\{K_0,\dots,K_{T+1}\}$. -### Digression: an Aggregation Theory +### Digression: Aggregation Theory We use a concept of a representative consumer to be thought of as follows. -There is a unit mass of identical consumers. +There is a unit mass of identical consumers indexed by $\omega \in [0,1]$. -For $\omega \in [0,1]$, consumption of consumer is $c(\omega)$. +Consumption of consumer $\omega$ is $c(\omega)$. Aggregate consumption is @@ -107,7 +107,7 @@ $$ C = \int_0^1 c(\omega) d \omega $$ -Consider the a welfare problem of choosing an allocation $\{c(\omega)\}$ across consumers to maximize +Consider a welfare problem that chooses an allocation $\{c(\omega)\}$ across consumers to maximize $$ \int_0^1 u(c(\omega)) d \omega @@ -122,16 +122,16 @@ $$ (eq:feas200) Form a Lagrangian $L = \int_0^1 u(c(\omega)) d \omega + \lambda [C - \int_0^1 c(\omega) d \omega ] $. Differentiate under the integral signs with respect to each $\omega$ to obtain the first-order -necessary condtions +necessary conditions $$ u'(c(\omega)) = \lambda. $$ -This condition implies that $c(\omega)$ equals a constant $c$ that is independent +These conditions imply that $c(\omega)$ equals a constant $c$ that is independent of $\omega$. -To find $c$, use the feasibility constraint {eq}`eq:feas200` to conclude that +To find $c$, use feasibility constraint {eq}`eq:feas200` to conclude that $$ c(\omega) = c = C. @@ -142,7 +142,7 @@ consumes amount $C$. It appears often in aggregate economics. -We shall use it in this lecture and in {doc}`Cass-Koopmans Competitive Equilibrium `. +We shall use this aggregation theory here and also in this lecture {doc}`Cass-Koopmans Competitive Equilibrium `. #### An Economy @@ -153,7 +153,7 @@ $t$ and likes the consumption good at each $t$. The representative household inelastically supplies a single unit of labor $N_t$ at each $t$, so that -$N_t =1 \text{ for all } t \in [0,T]$. +$N_t =1 \text{ for all } t \in \{0, 1, \ldots, T\}$. The representative household has preferences over consumption bundles ordered by the utility functional: @@ -165,7 +165,9 @@ U(\vec{C}) = \sum_{t=0}^{T} \beta^t \frac{C_t^{1-\gamma}}{1-\gamma} ``` where $\beta \in (0,1)$ is a discount factor and $\gamma >0$ -governs the curvature of the one-period utility function with larger $\gamma$ implying more curvature. +governs the curvature of the one-period utility function. + +Larger $\gamma$'s imply more curvature. Note that @@ -200,7 +202,7 @@ A feasible allocation $\vec{C}, \vec{K}$ satisfies ```{math} :label: allocation -C_t + K_{t+1} \leq F(K_t,N_t) + (1-\delta) K_t, \quad \text{for all } t \in [0, T] +C_t + K_{t+1} \leq F(K_t,N_t) + (1-\delta) K_t \quad \text{for all } t \in \{0, 1, \ldots, T\} ``` where $\delta \in (0,1)$ is a depreciation rate of capital. @@ -221,7 +223,7 @@ $$ \left(F(K_t,1) + (1-\delta) K_t- C_t - K_{t+1} \right)\right\} $$ (eq:Lagrangian201) -and then pose the following min-max problem: +and pose the following min-max problem: ```{math} :label: min-max-prob @@ -233,9 +235,9 @@ and then pose the following min-max problem: maximization with respect to $\vec{C}, \vec{K}$ and minimization with respect to $\vec{\mu}$. - Our problem satisfies - conditions that assure that required second-order + conditions that assure that second-order conditions are satisfied at an allocation that satisfies the - first-order conditions that we are about to compute. + first-order necessary conditions that we are about to compute. Before computing first-order conditions, we present some handy formulas. @@ -290,9 +292,11 @@ f(K_t) - f'(K_t) K_t \end{aligned} $$ +(Here we are using that $N_t = 1$ for all $t$, so that $K_t = \frac{K_t}{N_t}$.) + ### First-order necessary conditions -We now compute **first-order necessary conditions** for extremization of the Lagrangian {eq}`eq:Lagrangian201`: +We now compute **first-order necessary conditions** for extremization of Lagrangian {eq}`eq:Lagrangian201`: ```{math} :label: constraint1 @@ -319,7 +323,7 @@ K_{T+1}: \qquad -\mu_T \leq 0, \ \leq 0 \text{ if } K_{T+1}=0; \ =0 \text{ if } ``` In computing {eq}`constraint3` we recognize that $K_t$ appears -in both the time $t$ and time $t-1$ feasibility constraints. +in both the time $t$ and time $t-1$ feasibility constraints {eq}`allocation`. Restrictions {eq}`constraint4` come from differentiating with respect to $K_{T+1}$ and applying the following **Karush-Kuhn-Tucker condition** (KKT) @@ -347,7 +351,7 @@ u'\left(C_{t+1}\right)\left[(1-\delta)+f'\left(K_{t+1}\right)\right]= u'\left(C_{t}\right) \quad \text{ for all } t=0,1,\dots, T ``` -Applying the inverse of the utility function on both sides of the above +Applying the inverse marginal utility of consumption function on both sides of the above equation gives $$ @@ -363,6 +367,8 @@ $$ (1-\delta)]\right)^{1/\gamma} \end{aligned} $$ +This is a non-linear first-order difference equation that an optimal sequence $\vec C$ must satisfy. + Below we define a `jitclass` that stores parameters and functions that define our economy. @@ -454,7 +460,7 @@ We use **shooting** to compute an optimal allocation $\vec{C}, \vec{K}$ and an associated Lagrange multiplier sequence $\vec{\mu}$. -The first-order necessary conditions +First-order necessary conditions {eq}`constraint1`, {eq}`constraint2`, and {eq}`constraint3` for the planning problem form a system of **difference equations** with two boundary conditions: @@ -476,10 +482,13 @@ If we did, our job would be easy: - We could continue in this way to compute the remaining elements of $\vec{C}, \vec{K}, \vec{\mu}$. -But we don't have an initial condition for $\mu_0$, so this -won't work. +However, we woujld not be assured that the Kuhn-Tucker condition {eq}`kkt` would be satisfied. + +Furthermore, we don't have an initial condition for $\mu_0$. + +So this won't work. -Indeed, part of our task is to compute the optimal value of $\mu_0$. +Indeed, part of our task is to compute the **optimal** value of $\mu_0$. To compute $\mu_0$ and the other objects we want, a simple modification of the above procedure will work. @@ -490,7 +499,7 @@ algorithm that consists of the following steps: - Guess an initial Lagrange multiplier $\mu_0$. - Apply the **simple algorithm** described above. -- Compute $k_{T+1}$ and check whether it +- Compute $K_{T+1}$ and check whether it equals zero. - If $K_{T+1} =0$, we have solved the problem. - If $K_{T+1} > 0$, lower $\mu_0$ and try again. @@ -499,8 +508,8 @@ algorithm that consists of the following steps: The following Python code implements the shooting algorithm for the planning problem. -We actually modify the algorithm slightly by starting with a guess for -$c_0$ instead of $\mu_0$ in the following code. +(Actually, we modified the preceding algorithm slightly by starting with a guess for +$c_0$ instead of $\mu_0$ in the following code.) ```{code-cell} python3 @njit @@ -569,7 +578,7 @@ We make an initial guess for $C_0$ (we can eliminate $\mu_0$ because $C_0$ is an exact function of $\mu_0$). -We know that the lowest $C_0$ can ever be is $0$ and the +We know that the lowest $C_0$ can ever be is $0$ and that the largest it can be is initial output $f(K_0)$. Guess $C_0$ and shoot forward to $T+1$. @@ -670,7 +679,7 @@ to the $\lim_{T \rightarrow + \infty } K_t$, which we'll call steady state capi In a steady state $K_{t+1} = K_t=\bar{K}$ for all very large $t$. -Evalauating the feasibility constraint {eq}`allocation` at $\bar K$ gives +Evalauating feasibility constraint {eq}`allocation` at $\bar K$ gives ```{math} :label: feasibility-constraint @@ -703,7 +712,7 @@ $$ \bar{K} = f'^{-1}(\rho+\delta) $$ -For the production function {eq}`production-function` this becomes +For production function {eq}`production-function`, this becomes $$ \alpha \bar{K}^{\alpha-1} = \rho + \delta @@ -763,10 +772,10 @@ its steady state value most of the time. plot_paths(pp, 0.3, k_ss/3, [250, 150, 50, 25], k_ss=k_ss); ``` -Different colors in the above graphs are associated with +In the above graphs, different colors are associated with different horizons $T$. -Notice that as the horizon increases, the planner puts $K_t$ +Notice that as the horizon increases, the planner keeps $K_t$ closer to the steady state value $\bar K$ for longer. This pattern reflects a **turnpike** property of the steady state. @@ -859,7 +868,7 @@ Since $K_0<\bar K$, $f'(K_0)>\rho +\delta$. The planner chooses a positive saving rate that is higher than the steady state saving rate. -Note, $f''(K)<0$, so as $K$ rises, $f'(K)$ declines. +Note that $f''(K)<0$, so as $K$ rises, $f'(K)$ declines. The planner slowly lowers the saving rate until reaching a steady state in which $f'(K)=\rho +\delta$. @@ -893,7 +902,7 @@ technology and preference structure as deployed here. In that lecture, we replace the planner of this lecture with Adam Smith's **invisible hand**. -In place of quantity choices made by the planner, there are market prices that are set by a mechanism outside the model, a so-called invisible hand. +In place of quantity choices made by the planner, there are market prices that are set by a *deus ex machina* from outside the model, a so-called invisible hand. Equilibrium market prices must reconcile distinct decisions that are made independently by a representative household and a representative firm. diff --git a/lectures/cass_koopmans_2.md b/lectures/cass_koopmans_2.md index 7ec20b1e8..4cc9d0b3b 100644 --- a/lectures/cass_koopmans_2.md +++ b/lectures/cass_koopmans_2.md @@ -80,10 +80,7 @@ The physical setting is identical with that in {doc}`Cass-Koopmans Planning Mode Time is discrete and takes values $t = 0, 1 , \ldots, T$. -A single good can either be consumed or invested in physical capital. - -The consumption good is not durable and depreciates completely if not -consumed immediately. +Output of a single good can either be consumed or invested in physical capital. The capital good is durable but partially depreciates each period at a constant rate. @@ -99,7 +96,7 @@ $t$ and likes the consumption good at each $t$. The representative household inelastically supplies a single unit of labor $N_t$ at each $t$, so that -$N_t =1 \text{ for all } t \in [0,T]$. +$N_t =1 \text{ for all } t \in \{0, 1, \ldots, T\}$. The representative household has preferences over consumption bundles ordered by the utility functional: @@ -124,7 +121,7 @@ with $0 < \alpha<1$, $A > 0$. A feasible allocation $\vec{C}, \vec{K}$ satisfies $$ -C_t + K_{t+1} \leq F(K_t,N_t) + (1-\delta) K_t, \quad \text{for all } t \in [0, T] +C_t + K_{t+1} \leq F(K_t,N_t) + (1-\delta) K_t \quad \text{for all } t \in \{0, 1, \ldots, T\} $$ where $\delta \in (0,1)$ is a depreciation rate of capital. @@ -145,18 +142,18 @@ technology and preference structure as the planned economy studied in this lectu But now there is no planner. -There are (unit masses of) price taking consumers and firms. +There are (unit masses of) price-taking consumers and firms. Market prices are set to reconcile distinct decisions that are made -separately by a representative household and a representative firm. +separately by a representative consumer and a representative firm. There is a representative consumer who has the same preferences over consumption plans as did a consumer in the planned economy. Instead of being told what to consume and save by a planner, a -consumer (also known as a *household*) chooses for itself subject to a budget constraint +consumer (also known as a *household*) chooses for itself subject to a budget constraint. -- At each time $t$, the household receives wages and rentals +- At each time $t$, the consumer receives wages and rentals of capital from a firm -- these comprise its **income** at time $t$. - The consumer decides how much income to allocate to consumption or @@ -165,7 +162,7 @@ consumer (also known as a *household*) chooses for itself subject to a budget co capital (it trades one for one with time $t$ consumption) or by acquiring claims on consumption at dates other than $t$. -- The household owns all physical capital and labor +- The household owns physical capital and labor and rents them to the firm. - The household consumes, supplies labor, and invests in physical capital. @@ -178,7 +175,7 @@ consumer (also known as a *household*) chooses for itself subject to a budget co **price takers** who believe that prices are not affected by their choices ```{note} -We can think of there being unit measures of identical representative consumers and +Again, we can think of there being unit measures of identical representative consumers and identical representative firms. ``` @@ -191,7 +188,7 @@ The household owns both factors of production, namely, labor and physical capita Each period, the firm rents both factors from the household. There is a **single** grand competitive market in which a -household can trade date $0$ goods for goods at +household trades date $0$ goods for goods at all other dates $t=1, 2, \ldots, T$. ### Prices @@ -212,14 +209,18 @@ to a good at date $0$. We call $\{q^0_t\}_{t=0}^T$ a vector of **Hicks-Arrow prices**, named after the 1972 economics Nobel prize winners. -Units of $q_t^0$ could be + + +But because $q^0_t$ is a **relative price**, the units in terms of +which prices are quoted are arbitrary, we are free to re-normalize them. + +Units of $q_t^0$ could be set so that $$ \frac{\text{number of time 0 goods}}{\text{number of time t goods}} $$ -But because $q^0_t$ is a **relative price**, the units in terms of -which prices are quoted are arbitrary, we are free to re-normalize them. +In this case, we would be taking the time $0$ consumption good to be the **numeraire**. ## Firm Problem @@ -243,7 +244,7 @@ $$ ### Zero Profit Conditions -Zero-profits condition for capital and labor are +Zero-profits conditions for capital and labor are $$ F_k(\tilde k_t, \tilde n_t) =\eta_t @@ -263,7 +264,7 @@ To describe this no-arbitrage profits reasoning, we begin by applying a theorem Euler about linearly homogenous functions. The theorem applies to the Cobb-Douglas production function because -it assumed displays constant returns to scale: +we it displays constant returns to scale: $$ \alpha F(\tilde k_t, \tilde n_t) = F(\alpha \tilde k_t, \alpha \tilde n_t) @@ -271,12 +272,12 @@ $$ for $\alpha \in (0,1)$. -Taking the partial derivative -$\frac{\partial F }{\partial \alpha}$ on both sides of the +Taking partial derivatives +$\frac{\partial }{\partial \alpha}$ on both sides of the above equation gives $$ -F(\tilde k_t,\tilde n_t) =_\text{chain rule} \frac{\partial F}{\partial \tilde k_t} +F(\tilde k_t,\tilde n_t) = \frac{\partial F}{\partial \tilde k_t} \tilde k_t + \frac{\partial F}{\partial \tilde n_t} \tilde n_t $$ @@ -306,7 +307,7 @@ $\tilde k_t$, so it would want to make $\tilde k_t$ arbitrarily large. But setting $\tilde k_t = + \infty$ is not physically feasible, -so presumably **equilibrium** prices will assume values that present +so **equilibrium** prices must take values that present the firm with no such arbitrage opportunity. A similar argument applies if @@ -316,7 +317,7 @@ If $\frac{\partial \tilde k_t}{\partial \tilde k_t}< \eta_t$, the firm would want to set $\tilde k_t$ to zero, which is not feasible. It is convenient to define -$\vec{w} =\{w_0, \dots,w_T\}$and $\vec{\eta}= \{\eta_0, \dots, \eta_T\}$. +$\vec{w} =\{w_0, \dots,w_T\}$ and $\vec{\eta}= \{\eta_0, \dots, \eta_T\}$. ## Household Problem @@ -340,12 +341,12 @@ Here $\left(k_{t+1} -(1-\delta)k_t\right)$ is the household's net investment in physical capital and $\delta \in (0,1)$ is again a depreciation rate of capital. -In period $t$ is free to purchase more goods to be consumed and +In period $t$, the consumer is free to purchase more goods to be consumed and invested in physical capital than its income from supplying capital and labor to the firm, provided that in some other periods its income exceeds its purchases. -A household's net excess demand for time $t$ consumption goods +A consumer's net excess demand for time $t$ consumption goods is the gap $$ @@ -356,8 +357,8 @@ Let $\vec{c} = \{c_0,\dots,c_T\}$ and let $\vec{k} = \{k_1,\dots,k_{T+1}\}$. $k_0$ is given to the household. -The household faces a **single** budget constraint. -that states that the present value of the household's net excess +The household faces a **single** budget constraint +that requires that the present value of the household's net excess demands must be zero: $$ @@ -370,7 +371,7 @@ $$ \sum_{t=0}^T q^0_t \left(c_t + (k_{t+1} -(1-\delta)k_t)-(w_t 1 + \eta_t k_t) \right) \leq 0 $$ -The household chooses an allocation to solve the constrained optimization problem: +The household faces price system $\{q^0_t, w_t, \eta_t\}$ as a price-taker and chooses an allocation to solve the constrained optimization problem: $$ \begin{aligned}& \max_{\vec{c}, \vec{k} } \sum_{t=0}^T \beta^t u(c_t) \\ \text{subject to} \ \ & \sum_{t=0}^T q_t^0\left(c_t +\left(k_{t+1}-(1-\delta) k_t\right) -w_t -\eta_t k_t\right) \leq 0 \notag \end{aligned} @@ -402,15 +403,18 @@ verify** approach. ### Guess for Price System In this lecture {doc}`Cass-Koopmans Planning Model `, we computed an allocation $\{\vec{C}, \vec{K}, \vec{N}\}$ -that solves the planning problem. +that solves a planning problem. -(This allocation will constitute the **Big** $K$ to be in the present instance of the **Big** $K$ **, little** $k$ trick -that we'll apply to a competitive equilibrium in the spirit of [this lecture](https://python.quantecon.org/rational_expectations.html) -and [this lecture](https://python-advanced.quantecon.org/dyn_stack.html).) We use that allocation to construct a guess for the equilibrium price system. + +```{note} +This allocation will constitute the **Big** $K$ to be in the present instance of the **Big** $K$ **, little** $k$ trick +that we'll apply to a competitive equilibrium in the spirit of [this lecture](https://python.quantecon.org/rational_expectations.html) +and [this lecture](https://python-advanced.quantecon.org/dyn_stack.html).``` + In particular, we guess that for $t=0,\dots,T$: ```{math} @@ -526,7 +530,7 @@ k_t: \quad -\lambda q_t^0 \left[(1-\delta)+\eta_t \right]+\lambda q^0_{t-1}=0 \q k_{T+1}: \quad -\lambda q_0^{T+1} \leq 0, \ \leq 0 \text{ if } k_{T+1}=0; \ =0 \text{ if } k_{T+1}>0 ``` -Now we plug in our guesses of prices and embark on some algebra in the hope of recovering all first-order necessary conditions +Now we plug in our guesses of prices and do some algebra in the hope of recovering all first-order necessary conditions {eq}`constraint1`-{eq}`constraint4` for the planning problem from this lecture {doc}`Cass-Koopmans Planning Model `. Combining {eq}`cond1` and {eq}`eq-price`, we get: @@ -538,7 +542,7 @@ $$ which is {eq}`constraint1`. Combining {eq}`cond2`, {eq}`eq-price`, and -{eq}`eq-price3` we get: +{eq}`eq-price3`, we get: ```{math} :label: co-re @@ -578,7 +582,7 @@ $$ Since $\beta^t \mu_t >0$ for $t =0, \ldots, T$, it follows that $$ -C_t+K_{t+1}-(1-\delta)K_t -F(K_t,1)=0 \quad \text{ for all }t \text{ in } 0,\dots,T +C_t+K_{t+1}-(1-\delta)K_t -F(K_t,1)=0 \quad \text{ for all }t \text{ in } \{0, 1, \ldots, T\} $$ which is {eq}`constraint3`. @@ -601,6 +605,8 @@ Thus, at our guess of the equilibrium price system, the allocation that solves the planning problem also solves the problem faced by a representative household living in a competitive equilibrium. +### Representative Firm's Problem + We now turn to the problem faced by a firm in a competitive equilibrium: @@ -894,9 +900,10 @@ Adjusting $\gamma$ means adjusting how much individuals prefer to smooth consumption. Higher $\gamma$ means individuals prefer to smooth more -resulting in slower adjustments to the steady state allocations. +resulting in slower convergence to a steady state allocation. -Vice-versa for lower $\gamma$. +Lower $\gamma$ means individuals prefer to smooth less, +resulting in faster convergence to a steady state allocation. ## Yield Curves and Hicks-Arrow Prices @@ -904,7 +911,7 @@ We return to Hicks-Arrow prices and calculate how they are related to **yield This will let us plot a **yield curve** that graphs yields on bonds of maturities $j=1, 2, \ldots$ against $j=1,2, \ldots$. -The formulas we want are: +We use the following formulas. A **yield to maturity** on a loan made at time $t_0$ that matures at time $t > t_0$ @@ -912,7 +919,7 @@ $$ r_{t_0,t}= -\frac{\log q^{t_0}_t}{t - t_0} $$ -A Hicks-Arrow price for a base-year $t_0\leq t$ +A Hicks-Arrow price system for a base-year $t_0\leq t$ satisfies $$ q^{t_0}_t = \beta^{t-t_0} \frac{u'(c_t)}{u'(c_{t_0})}= \beta^{t-t_0}