diff --git a/lectures/_config.yml b/lectures/_config.yml index 4e8c9093..6b99e06b 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -35,7 +35,7 @@ latex: targetname: quantecon-python-intro.tex sphinx: - extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx_proof, sphinx_tojupyter] + extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx.ext.intersphinx, sphinx_proof, sphinx_tojupyter] config: # false-positive links linkcheck_ignore: ['https://doi.org/https://doi.org/10.2307/1235116'] @@ -68,6 +68,31 @@ sphinx: binderhub_url : https://mybinder.org # The URL of the BinderHub (e.g., https://mybinder.org) colab_url : https://colab.research.google.com thebe : false # Add a thebe button to pages (requires the repository to run on Binder) + intersphinx_mapping: + pyprog: + - https://python-programming.quantecon.org/ + - null + intro: + - https://intro.quantecon.org/ + - null + dle: + - https://quantecon.github.io/lecture-dle/ + - null + dps: + - https://quantecon.github.io/lecture-dps/ + - null + eqm: + - https://quantecon.github.io/lecture-eqm/ + - null + stats: + - https://quantecon.github.io/lecture-stats/ + - null + tools: + - https://quantecon.github.io/lecture-tools-techniques/ + - null + dynam: + - https://quantecon.github.io/lecture-dynamics/ + - null mathjax3_config: tex: macros: diff --git a/lectures/_toc.yml b/lectures/_toc.yml index 04d3b875..8a9ba039 100644 --- a/lectures/_toc.yml +++ b/lectures/_toc.yml @@ -14,6 +14,7 @@ parts: - caption: Essential Tools numbered: true chapters: + - file: complex_and_trig - file: linear_equations - file: eigen_I - file: intro_supply_demand diff --git a/lectures/cagan_ree.md b/lectures/cagan_ree.md index 2ae3e749..4273c69c 100644 --- a/lectures/cagan_ree.md +++ b/lectures/cagan_ree.md @@ -13,23 +13,26 @@ kernelspec: # A Monetarist Theory of Price Levels -## Introduction +## Overview We'll use linear algebra first to explain and then do some experiments with a "monetarist theory of price levels". -Sometimes this theory is also called a "fiscal theory of price levels". -Such a theory of price levels was described by Thomas Sargent and Neil Wallace in chapter 5 of -{cite}`sargent2013rational`, which reprints a 1981 Federal Reserve Bank of Minneapolis article entitled "Unpleasant Monetarist Arithmetic". + -Sometimes people call it a "monetary" or "monetarist" theory of price levels because fiscal effects on price levels occur through the effects of government fiscal policy decisions on the path of the money supply. +Economist call it a "monetary" or "monetarist" theory of price levels because effects on price levels occur via a central banks's decisions to print money supply. * a goverment's fiscal policies determine whether it **expenditures** exceed its **tax collections** - * if its expenditures exceeds it tax collections, it can cover the difference by **printing money** + * if its expenditures exceeds it tax collections, the government can instruct the central bank to cover the difference by **printing money** * that leads to effects on the price level as price level path adjusts to equate the supply of money to the demand for money -The theory has been extended, criticized, and applied by John Cochrane in {cite}`cochrane2023fiscal`. +Such a theory of price levels was described by Thomas Sargent and Neil Wallace in chapter 5 of +{cite}`sargent2013rational`, which reprints a 1981 Federal Reserve Bank of Minneapolis article entitled "Unpleasant Monetarist Arithmetic". + +Sometimes this theory is also called a "fiscal theory of price levels" to emphasize the importance of fisal deficits in shaping changes in the money supply. + +The theory has been extended, criticized, and applied by John Cochrane {cite}`cochrane2023fiscal`. In another lecture {doc}`price level histories `, we described some European hyperinflations that occurred in the wake of World War I. @@ -39,29 +42,29 @@ Elemental forces at work in the fiscal theory of the price level help to underst According to this theory, when the government persistently spends more than it collects in taxes and prints money to finance the shortfall (the "shortfall" is called the "government deficit"), it puts upward pressure on the price level and generates persistent inflation. -The "monetarist or fiscal theory of price levels" asserts that +The ''monetarist'' or ''fiscal theory of price levels" asserts that -* to **start** a persistent inflation the government simply persistently runs a money-financed government deficit +* to **start** a persistent inflation the government beings persistently to run a money-financed government deficit -* to **stop** a persistent inflation the government simply stops persistently running a money-financed government deficit +* to **stop** a persistent inflation the government stops persistently running a money-financed government deficit -Our model is a "rational expectations" (or "perfect foresight") version of a model that Philip Cagan {cite}`Cagan` used to study the monetary dynamics of hyperinflations. +The model in this lecture is a "rational expectations" (or "perfect foresight") version of a model that Philip Cagan {cite}`Cagan` used to study the monetary dynamics of hyperinflations. While Cagan didn't use that "rational expectations" version of the model, Thomas Sargent {cite}`sargent1982ends` did when he studied the Ends of Four Big Inflations in Europe after World War I. * this lecture {doc}`fiscal theory of the price level with adaptive expectations ` describes a version of the model that does not impose "rational expectations" but instead uses what Cagan and his teacher Milton Friedman called "adaptive expectations" - * a reader of both lectures will notice that the algebra is easier and more streamlined in the present rational expectations version of the model - * this can be traced to the following source: the adaptive expectations version of the model has more endogenous variables and more free parameters + * a reader of both lectures will notice that the algebra is less complicated in the present rational expectations version of the model + * the difference in algebra complications can be traced to the following source: the adaptive expectations version of the model has more endogenous variables and more free parameters -Some of our quantitative experiments with our rational expectations version of the model are designed to illustrate how the fiscal theory explains the abrupt end of those big inflations. +Some of our quantitative experiments with the rational expectations version of the model are designed to illustrate how the fiscal theory explains the abrupt end of those big inflations. In those experiments, we'll encounter an instance of a ''velocity dividend'' that has sometimes accompanied successful inflation stabilization programs. To facilitate using linear matrix algebra as our main mathematical tool, we'll use a finite horizon version of the model. -As in the {doc}`present values ` and {doc}`consumption smoothing` lectures, the only linear algebra that we'll be using are matrix multiplication and matrix inversion. +As in the {doc}`present values ` and {doc}`consumption smoothing` lectures, our mathematical tools are matrix multiplication and matrix inversion. ## Structure of the model @@ -71,7 +74,7 @@ The model consists of * a function that expresses the demand for real balances of government printed money as an inverse function of the public's expected rate of inflation -* an exogenous sequence of rates of growth of the money supply. The money supply grows because the government is printing it to finance some of its expenditures +* an exogenous sequence of rates of growth of the money supply. The money supply grows because the government prints it to pay for goods and services * an equilibrium condition that equates the demand for money to the supply diff --git a/lectures/complex_and_trig.md b/lectures/complex_and_trig.md new file mode 100644 index 00000000..a8ebb1bb --- /dev/null +++ b/lectures/complex_and_trig.md @@ -0,0 +1,530 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst +kernelspec: + display_name: Python 3 + language: python + name: python3 +--- + +(complex_and_trig)= +```{raw} html + +``` + +```{index} single: python +``` + +# Complex Numbers and Trigonometry + +```{admonition} Migrated lecture +:class: warning + +This lecture has moved from our [Intermediate Quantitative Economics with Python](https://python.quantecon.org/intro.html) lecture series and is now a part of [A First Course in Quantitative Economics](https://intro.quantecon.org/intro.html). +``` + +## Overview + +This lecture introduces some elementary mathematics and trigonometry. + +Useful and interesting in its own right, these concepts reap substantial rewards when studying dynamics generated +by linear difference equations or linear differential equations. + +For example, these tools are keys to understanding outcomes attained by Paul +Samuelson (1939) {cite}`Samuelson1939` in his classic paper on interactions +between the investment accelerator and the Keynesian consumption function, our +topic in the lecture {doc}`Samuelson Multiplier Accelerator `. + +In addition to providing foundations for Samuelson's work and extensions of +it, this lecture can be read as a stand-alone quick reminder of key results +from elementary high school trigonometry. + +So let's dive in. + +### Complex Numbers + +A complex number has a **real part** $x$ and a purely **imaginary part** $y$. + +The Euclidean, polar, and trigonometric forms of a complex number $z$ are: + +$$ +z = x + iy = re^{i\theta} = r(\cos{\theta} + i \sin{\theta}) +$$ + +The second equality above is known as **Euler's formula** + +- [Euler](https://en.wikipedia.org/wiki/Leonhard_Euler) contributed many other formulas too! + +The complex conjugate $\bar z$ of $z$ is defined as + +$$ +\bar z = x - iy = r e^{-i \theta} = r (\cos{\theta} - i \sin{\theta} ) +$$ + +The value $x$ is the **real** part of $z$ and $y$ is the +**imaginary** part of $z$. + +The symbol $| z |$ = $\sqrt{\bar{z}\cdot z} = r$ represents the **modulus** of $z$. + +The value $r$ is the Euclidean distance of vector $(x,y)$ from the +origin: + +$$ +r = |z| = \sqrt{x^2 + y^2} +$$ + +The value $\theta$ is the angle of $(x,y)$ with respect to the real axis. + +Evidently, the tangent of $\theta$ is $\left(\frac{y}{x}\right)$. + +Therefore, + +$$ +\theta = \tan^{-1} \Big( \frac{y}{x} \Big) +$$ + +Three elementary trigonometric functions are + +$$ +\cos{\theta} = \frac{x}{r} = \frac{e^{i\theta} + e^{-i\theta}}{2} , \quad +\sin{\theta} = \frac{y}{r} = \frac{e^{i\theta} - e^{-i\theta}}{2i} , \quad +\tan{\theta} = \frac{y}{x} +$$ + +We'll need the following imports: + +```{code-cell} ipython +import matplotlib.pyplot as plt +plt.rcParams["figure.figsize"] = (11, 5) #set default figure size +import numpy as np +from sympy import (Symbol, symbols, Eq, nsolve, sqrt, cos, sin, simplify, + init_printing, integrate) +``` + +### An Example + +Consider the complex number $z = 1 + \sqrt{3} i$. + +For $z = 1 + \sqrt{3} i$, $x = 1$, $y = \sqrt{3}$. + +It follows that $r = 2$ and +$\theta = \tan^{-1}(\sqrt{3}) = \frac{\pi}{3} = 60^o$. + +Let's use Python to plot the trigonometric form of the complex number +$z = 1 + \sqrt{3} i$. + +```{code-cell} python3 +# Abbreviate useful values and functions +π = np.pi + + +# Set parameters +r = 2 +θ = π/3 +x = r * np.cos(θ) +x_range = np.linspace(0, x, 1000) +θ_range = np.linspace(0, θ, 1000) + +# Plot +fig = plt.figure(figsize=(8, 8)) +ax = plt.subplot(111, projection='polar') + +ax.plot((0, θ), (0, r), marker='o', color='b') # Plot r +ax.plot(np.zeros(x_range.shape), x_range, color='b') # Plot x +ax.plot(θ_range, x / np.cos(θ_range), color='b') # Plot y +ax.plot(θ_range, np.full(θ_range.shape, 0.1), color='r') # Plot θ + +ax.margins(0) # Let the plot starts at origin + +ax.set_title("Trigonometry of complex numbers", va='bottom', + fontsize='x-large') + +ax.set_rmax(2) +ax.set_rticks((0.5, 1, 1.5, 2)) # Less radial ticks +ax.set_rlabel_position(-88.5) # Get radial labels away from plotted line + +ax.text(θ, r+0.01 , r'$z = x + iy = 1 + \sqrt{3}\, i$') # Label z +ax.text(θ+0.2, 1 , '$r = 2$') # Label r +ax.text(0-0.2, 0.5, '$x = 1$') # Label x +ax.text(0.5, 1.2, r'$y = \sqrt{3}$') # Label y +ax.text(0.25, 0.15, r'$\theta = 60^o$') # Label θ + +ax.grid(True) +plt.show() +``` + +## De Moivre's Theorem + +de Moivre's theorem states that: + +$$ +(r(\cos{\theta} + i \sin{\theta}))^n = +r^n e^{in\theta} = +r^n(\cos{n\theta} + i \sin{n\theta}) +$$ + +To prove de Moivre's theorem, note that + +$$ +(r(\cos{\theta} + i \sin{\theta}))^n = \big( re^{i\theta} \big)^n +$$ + +and compute. + +## Applications of de Moivre's Theorem + +### Example 1 + +We can use de Moivre's theorem to show that +$r = \sqrt{x^2 + y^2}$. + +We have + +$$ +\begin{aligned} +1 &= e^{i\theta} e^{-i\theta} \\ +&= (\cos{\theta} + i \sin{\theta})(\cos{(\text{-}\theta)} + i \sin{(\text{-}\theta)}) \\ +&= (\cos{\theta} + i \sin{\theta})(\cos{\theta} - i \sin{\theta}) \\ +&= \cos^2{\theta} + \sin^2{\theta} \\ +&= \frac{x^2}{r^2} + \frac{y^2}{r^2} +\end{aligned} +$$ + +and thus + +$$ +x^2 + y^2 = r^2 +$$ + +We recognize this as a theorem of **Pythagoras**. + +### Example 2 + +Let $z = re^{i\theta}$ and $\bar{z} = re^{-i\theta}$ so that $\bar{z}$ is the **complex conjugate** of $z$. + +$(z, \bar z)$ form a **complex conjugate pair** of complex numbers. + +Let $a = pe^{i\omega}$ and $\bar{a} = pe^{-i\omega}$ be +another complex conjugate pair. + +For each element of a sequence of integers $n = 0, 1, 2, \ldots, $. + +To do so, we can apply de Moivre's formula. + +Thus, + +$$ +\begin{aligned} +x_n &= az^n + \bar{a}\bar{z}^n \\ +&= p e^{i\omega} (re^{i\theta})^n + p e^{-i\omega} (re^{-i\theta})^n \\ +&= pr^n e^{i (\omega + n\theta)} + pr^n e^{-i (\omega + n\theta)} \\ +&= pr^n [\cos{(\omega + n\theta)} + i \sin{(\omega + n\theta)} + + \cos{(\omega + n\theta)} - i \sin{(\omega + n\theta)}] \\ +&= 2 pr^n \cos{(\omega + n\theta)} +\end{aligned} +$$ + +### Example 3 + +This example provides machinery that is at the heard of Samuelson's analysis of his multiplier-accelerator model {cite}`Samuelson1939`. + +Thus, consider a **second-order linear difference equation** + +$$ +x_{n+2} = c_1 x_{n+1} + c_2 x_n +$$ + +whose **characteristic polynomial** is + +$$ +z^2 - c_1 z - c_2 = 0 +$$ + +or + +$$ +(z^2 - c_1 z - c_2 ) = (z - z_1)(z- z_2) = 0 +$$ + +has roots $z_1, z_1$. + +A **solution** is a sequence $\{x_n\}_{n=0}^\infty$ that satisfies +the difference equation. + +Under the following circumstances, we can apply our example 2 formula to +solve the difference equation + +- the roots $z_1, z_2$ of the characteristic polynomial of the + difference equation form a complex conjugate pair +- the values $x_0, x_1$ are given initial conditions + +To solve the difference equation, recall from example 2 that + +$$ +x_n = 2 pr^n \cos{(\omega + n\theta)} +$$ + +where $\omega, p$ are coefficients to be determined from +information encoded in the initial conditions $x_1, x_0$. + +Since +$x_0 = 2 p \cos{\omega}$ and $x_1 = 2 pr \cos{(\omega + \theta)}$ +the ratio of $x_1$ to $x_0$ is + +$$ +\frac{x_1}{x_0} = \frac{r \cos{(\omega + \theta)}}{\cos{\omega}} +$$ + +We can solve this equation for $\omega$ then solve for $p$ using $x_0 = 2 pr^0 \cos{(\omega + n\theta)}$. + +With the `sympy` package in Python, we are able to solve and plot the +dynamics of $x_n$ given different values of $n$. + +In this example, we set the initial values: - $r = 0.9$ - +$\theta = \frac{1}{4}\pi$ - $x_0 = 4$ - +$x_1 = r \cdot 2\sqrt{2} = 1.8 \sqrt{2}$. + +We first numerically solve for $\omega$ and $p$ using +`nsolve` in the `sympy` package based on the above initial +condition: + +```{code-cell} python3 +# Set parameters +r = 0.9 +θ = π/4 +x0 = 4 +x1 = 2 * r * sqrt(2) + +# Define symbols to be calculated +ω, p = symbols('ω p', real=True) + +# Solve for ω +## Note: we choose the solution near 0 +eq1 = Eq(x1/x0 - r * cos(ω+θ) / cos(ω), 0) +ω = nsolve(eq1, ω, 0) +ω = float(ω) +print(f'ω = {ω:1.3f}') + +# Solve for p +eq2 = Eq(x0 - 2 * p * cos(ω), 0) +p = nsolve(eq2, p, 0) +p = float(p) +print(f'p = {p:1.3f}') +``` + +Using the code above, we compute that +$\omega = 0$ and $p = 2$. + +Then we plug in the values we solve for $\omega$ and $p$ +and plot the dynamic. + +```{code-cell} python3 +# Define range of n +max_n = 30 +n = np.arange(0, max_n+1, 0.01) + +# Define x_n +x = lambda n: 2 * p * r**n * np.cos(ω + n * θ) + +# Plot +fig, ax = plt.subplots(figsize=(12, 8)) + +ax.plot(n, x(n)) +ax.set(xlim=(0, max_n), ylim=(-5, 5), xlabel='$n$', ylabel='$x_n$') + +# Set x-axis in the middle of the plot +ax.spines['bottom'].set_position('center') +ax.spines['right'].set_color('none') +ax.spines['top'].set_color('none') +ax.xaxis.set_ticks_position('bottom') +ax.yaxis.set_ticks_position('left') + +ticklab = ax.xaxis.get_ticklabels()[0] # Set x-label position +trans = ticklab.get_transform() +ax.xaxis.set_label_coords(31, 0, transform=trans) + +ticklab = ax.yaxis.get_ticklabels()[0] # Set y-label position +trans = ticklab.get_transform() +ax.yaxis.set_label_coords(0, 5, transform=trans) + +ax.grid() +plt.show() +``` + +### Trigonometric Identities + +We can obtain a complete suite of trigonometric identities by +appropriately manipulating polar forms of complex numbers. + +We'll get many of them by deducing implications of the equality + +$$ +e^{i(\omega + \theta)} = e^{i\omega} e^{i\theta} +$$ + +For example, we'll calculate identities for + +$\cos{(\omega + \theta)}$ and $\sin{(\omega + \theta)}$. + +Using the sine and cosine formulas presented at the beginning of this +lecture, we have: + +$$ +\begin{aligned} +\cos{(\omega + \theta)} = \frac{e^{i(\omega + \theta)} + e^{-i(\omega + \theta)}}{2} \\ +\sin{(\omega + \theta)} = \frac{e^{i(\omega + \theta)} - e^{-i(\omega + \theta)}}{2i} +\end{aligned} +$$ + +We can also obtain the trigonometric identities as follows: + +$$ +\begin{aligned} +\cos{(\omega + \theta)} + i \sin{(\omega + \theta)} +&= e^{i(\omega + \theta)} \\ +&= e^{i\omega} e^{i\theta} \\ +&= (\cos{\omega} + i \sin{\omega})(\cos{\theta} + i \sin{\theta}) \\ +&= (\cos{\omega}\cos{\theta} - \sin{\omega}\sin{\theta}) + +i (\cos{\omega}\sin{\theta} + \sin{\omega}\cos{\theta}) +\end{aligned} +$$ + +Since both real and imaginary parts of the above formula should be +equal, we get: + +$$ +\begin{aligned} +\cos{(\omega + \theta)} = \cos{\omega}\cos{\theta} - \sin{\omega}\sin{\theta} \\ +\sin{(\omega + \theta)} = \cos{\omega}\sin{\theta} + \sin{\omega}\cos{\theta} +\end{aligned} +$$ + +The equations above are also known as the **angle sum identities**. We +can verify the equations using the `simplify` function in the +`sympy` package: + +```{code-cell} python3 +# Define symbols +ω, θ = symbols('ω θ', real=True) + +# Verify +print("cos(ω)cos(θ) - sin(ω)sin(θ) =", + simplify(cos(ω)*cos(θ) - sin(ω) * sin(θ))) +print("cos(ω)sin(θ) + sin(ω)cos(θ) =", + simplify(cos(ω)*sin(θ) + sin(ω) * cos(θ))) +``` + +### Trigonometric Integrals + +We can also compute the trigonometric integrals using polar forms of +complex numbers. + +For example, we want to solve the following integral: + +$$ +\int_{-\pi}^{\pi} \cos(\omega) \sin(\omega) \, d\omega +$$ + +Using Euler's formula, we have: + +$$ +\begin{aligned} +\int \cos(\omega) \sin(\omega) \, d\omega +&= +\int +\frac{(e^{i\omega} + e^{-i\omega})}{2} +\frac{(e^{i\omega} - e^{-i\omega})}{2i} +\, d\omega \\ +&= +\frac{1}{4i} +\int +e^{2i\omega} - e^{-2i\omega} +\, d\omega \\ +&= +\frac{1}{4i} +\bigg( \frac{-i}{2} e^{2i\omega} - \frac{i}{2} e^{-2i\omega} + C_1 \bigg) \\ +&= +-\frac{1}{8} +\bigg[ \bigg(e^{i\omega}\bigg)^2 + \bigg(e^{-i\omega}\bigg)^2 - 2 \bigg] + C_2 \\ +&= +-\frac{1}{8} (e^{i\omega} - e^{-i\omega})^2 + C_2 \\ +&= +\frac{1}{2} \bigg( \frac{e^{i\omega} - e^{-i\omega}}{2i} \bigg)^2 + C_2 \\ +&= \frac{1}{2} \sin^2(\omega) + C_2 +\end{aligned} +$$ + +and thus: + +$$ +\int_{-\pi}^{\pi} \cos(\omega) \sin(\omega) \, d\omega = +\frac{1}{2}\sin^2(\pi) - \frac{1}{2}\sin^2(-\pi) = 0 +$$ + +We can verify the analytical as well as numerical results using +`integrate` in the `sympy` package: + +```{code-cell} python3 +# Set initial printing +init_printing() + +ω = Symbol('ω') +print('The analytical solution for integral of cos(ω)sin(ω) is:') +integrate(cos(ω) * sin(ω), ω) +``` + +```{code-cell} python3 +print('The numerical solution for the integral of cos(ω)sin(ω) \ +from -π to π is:') +integrate(cos(ω) * sin(ω), (ω, -π, π)) +``` + +### Exercises + +```{exercise} +:label: complex_ex1 + +We invite the reader to verify analytically and with the `sympy` package the following two equalities: + +$$ +\int_{-\pi}^{\pi} \cos (\omega)^2 \, d\omega = \pi +$$ + +$$ +\int_{-\pi}^{\pi} \sin (\omega)^2 \, d\omega = \pi +$$ +``` + +```{solution-start} complex_ex1 +:class: dropdown +``` + +Let's import symbolic $\pi$ from `sympy` + +```{code-cell} ipython3 +# Import symbolic π from sympy +from sympy import pi +``` + +```{code-cell} ipython3 +print('The analytical solution for the integral of cos(ω)**2 \ +from -π to π is:') + +integrate(cos(ω)**2, (ω, -pi, pi)) +``` + +```{code-cell} ipython3 +print('The analytical solution for the integral of sin(ω)**2 \ +from -π to π is:') + +integrate(sin(ω)**2, (ω, -pi, pi)) +``` + +```{solution-end} +``` diff --git a/lectures/cons_smooth.md b/lectures/cons_smooth.md index bc43a5d4..886ed823 100644 --- a/lectures/cons_smooth.md +++ b/lectures/cons_smooth.md @@ -17,17 +17,28 @@ kernelspec: ## Overview -Technically, this lecture is a sequel to this quantecon lecture {doc}`present values `, although it might not seem so at first. -It will take a while for a "present value" or asset price explicilty to appear in this lecture, but when it does it will be a key actor. +In this lecture, we'll study a famous model of the "consumption function" that Milton Friedman {cite}`Friedman1956` and Robert Hall {cite}`Hall1978`) proposed to fit some empirical data patterns that the original Keynesian consumption function described in this quantecon lecture {doc}`geometric series ` missed. + +In this lecture, we'll study what is often called the "consumption-smoothing model" using matrix multiplication and matrix inversion, the same tools that we used in this quantecon lecture {doc}`present values `. + +Formulas presented in {doc}`present value formulas` are at the core of the consumption smoothing model because we shall use them to define a consumer's "human wealth". -In this lecture, we'll study a famous model of the "consumption function" that Milton Friedman {cite}`Friedman1956` and Robert Hall {cite}`Hall1978`) proposed to fit some empirical data patterns that the simple Keynesian model described in this quantecon lecture {doc}`geometric series ` had missed. +The key idea that inspired Milton Friedman was that a person's non-financial income, i.e., his or +her wages from working, could be viewed as a dividend stream from that person's ``human capital'' +and that standard asset-pricing formulas could be applied to compute a person's +``non-financial wealth'' that capitalizes the earnings stream. + +```{note} +As we'll see in this quantecon lecture {doc}`equalizing difference model `, +Milton Friedman had used this idea in his PhD thesis at Columbia University, +eventually published as {cite}`kuznets1939incomes` and {cite}`friedman1954incomes`. +``` -The key insight of Friedman and Hall was that today's consumption ought not to depend just on today's non-financial income: it should also depend on a person's anticipations of her **future** non-financial incomes at various dates. +It will take a while for a "present value" or asset price explicilty to appear in this lecture, but when it does it will be a key actor. -In this lecture, we'll study what is sometimes called the "consumption-smoothing model" using only linear algebra, in particular matrix multiplication and matrix inversion. -Formulas presented in {doc}`present value formulas` are at the core of the consumption smoothing model because they are used to define a consumer's "human wealth". +## Analysis As usual, we'll start with by importing some Python modules. @@ -39,13 +50,13 @@ from collections import namedtuple +++ {"user_expressions": []} -Our model describes the behavior of a consumer who lives from time $t=0, 1, \ldots, T$, receives a stream $\{y_t\}_{t=0}^T$ of non-financial income and chooses a consumption stream $\{c_t\}_{t=0}^T$. +The model describes a consumer who lives from time $t=0, 1, \ldots, T$, receives a stream $\{y_t\}_{t=0}^T$ of non-financial income and chooses a consumption stream $\{c_t\}_{t=0}^T$. We usually think of the non-financial income stream as coming from the person's salary from supplying labor. -The model takes that non-financial income stream as an input, regarding it as "exogenous" in the sense of not being determined by the model. +The model takes a non-financial income stream as an input, regarding it as "exogenous" in the sense of not being determined by the model. -The consumer faces a gross interest rate of $R >1$ that is constant over time, at which she is free to borrow or lend, up to some limits that we'll describe below. +The consumer faces a gross interest rate of $R >1$ that is constant over time, at which she is free to borrow or lend, up to limits that we'll describe below. To set up the model, let @@ -65,22 +76,27 @@ To set up the model, let * $a_{T+1} \geq 0$ be a terminal condition on final assets -While the sequence of financial wealth $a$ is to be determined by the model, it must satisfy two **boundary conditions** that require it to be equal to $a_0$ at time $0$ and $a_{T+1}$ at time $T+1$. +The sequence of financial wealth $a$ is to be determined by the model. + +We require it to satisfy two **boundary conditions**: + + * it must equal an exogenous value $a_0$ at time $0$ + * it must equal or exceed an exogenous value $a_{T+1}$ at time $T+1$. -The **terminal condition** $a_{T+1} \geq 0$ requires that the consumer not die leaving debts. +The **terminal condition** $a_{T+1} \geq 0$ requires that the consumer not leave the model in debt. -(We'll see that a utility maximizing consumer won't **want** to die leaving positive assets, so she'll arrange her affairs to make -$a_{T+1} = 0.) +(We'll soon see that a utility maximizing consumer won't **want** to die leaving positive assets, so she'll arrange her affairs to make +$a_{T+1} = 0$.) -The consumer faces a sequence of budget constraints that constrains the triple of sequences $y, c, a$ +The consumer faces a sequence of budget constraints that constrains sequences $(y, c, a)$ $$ a_{t+1} = R (a_t+ y_t - c_t), \quad t =0, 1, \ldots T $$ (eq:a_t) -Notice that there are $T+1$ such budget constraints, one for each $t=0, 1, \ldots, T$. +Equations {eq}`eq:a_t` constitute $T+1$ such budget constraints, one for each $t=0, 1, \ldots, T$. -Given a sequence $y$ of non-financial income, there is a big set of **pairs** $(a, c)$ of (financial wealth, consumption) sequences that satisfy the sequence of budget constraints {eq}`eq:a_t`. +Given a sequence $y$ of non-financial incomes, a large set of **pairs** $(a, c)$ of (financial wealth, consumption) sequences satisfy the sequence of budget constraints {eq}`eq:a_t`. Our model has the following logical flow. @@ -93,19 +109,19 @@ Our model has the following logical flow. * If it does, declare that the candidate path is **budget feasible**. - * if the candidate consumption path is not budget feasible, propose a path with less consumption sometimes and start over + * if the candidate consumption path is not budget feasible, propose a less greedy consumption path and start over Below, we'll describe how to execute these steps using linear algebra -- matrix inversion and multiplication. The above procedure seems like a sensible way to find "budget-feasible" consumption paths $c$, i.e., paths that are consistent with the exogenous non-financial income stream $y$, the initial financial asset level $a_0$, and the terminal asset level $a_{T+1}$. -In general, there will be many budget feasible consumption paths $c$. +In general, there are **many** budget feasible consumption paths $c$. -Among all budget-feasible consumption paths, which one **should** the consumer want to choose? +Among all budget-feasible consumption paths, which one **should** a consumer want? -We shall eventually evaluate alternative budget feasible consumption paths $c$ using the following **welfare criterion** +To answer this question, we shall eventually evaluate alternative budget feasible consumption paths $c$ using the following utility functional or **welfare criterion**: ```{math} :label: welfare @@ -115,9 +131,9 @@ W = \sum_{t=0}^T \beta^t (g_1 c_t - \frac{g_2}{2} c_t^2 ) where $g_1 > 0, g_2 > 0$. -The fact that the utility function $g_1 c_t - \frac{g_2}{2} c_t^2$ has diminishing marginal utility imparts a preference for consumption that is very smooth when $\beta R \approx 1$. +When $\beta R \approx 1$, the fact that the utility function $g_1 c_t - \frac{g_2}{2} c_t^2$ has diminishing marginal utility imparts a preference for consumption that is very smooth. -Indeed, we shall see that when $\beta R = 1$ (a condition assumed by Milton Friedman {cite}`Friedman1956` and Robert Hall {cite}`Hall1978`), this criterion assigns higher welfare to **smoother** consumption paths. +Indeed, we shall see that when $\beta R = 1$ (a condition assumed by Milton Friedman {cite}`Friedman1956` and Robert Hall {cite}`Hall1978`), criterion {eq}`welfare` assigns higher welfare to **smoother** consumption paths. By **smoother** we mean as close as possible to being constant over time. @@ -127,7 +143,7 @@ Let's dive in and do some calculations that will help us understand how the mode Here we use default parameters $R = 1.05$, $g_1 = 1$, $g_2 = 1/2$, and $T = 65$. -We create a namedtuple to store these parameters with default values. +We create a Python **namedtuple** to store these parameters with default values. ```{code-cell} ipython3 ConsumptionSmoothing = namedtuple("ConsumptionSmoothing", @@ -145,7 +161,7 @@ def creat_cs_model(R=1.05, g1=1, g2=1/2, T=65): ## Friedman-Hall consumption-smoothing model -A key object in the model is what Milton Friedman called "human" or "non-financial" wealth at time $0$: +A key object is what Milton Friedman called "human" or "non-financial" wealth at time $0$: $$ @@ -153,9 +169,9 @@ h_0 \equiv \sum_{t=0}^T R^{-t} y_t = \begin{bmatrix} 1 & R^{-1} & \cdots & R^{-T \begin{bmatrix} y_0 \cr y_1 \cr \vdots \cr y_T \end{bmatrix} $$ -Human or non-financial wealth is evidently just the present value at time $0$ of the consumer's non-financial income stream $y$. +Human or non-financial wealth at time $0$ is evidently just the present value of the consumer's non-financial income stream $y$. -Notice that formally it very much resembles the asset price that we computed in this quantecon lecture {doc}`present values `. +Formally it very much resembles the asset price that we computed in this quantecon lecture {doc}`present values `. Indeed, this is why Milton Friedman called it "human capital". @@ -165,22 +181,22 @@ $$ a_{T+1} = 0, $$ -it is possible to convert a sequence of budget constraints into the single intertemporal constraint +it is possible to convert a sequence of budget constraints {eq}`eq:a_t` into a single intertemporal constraint -$$ -\sum_{t=0}^T R^{-t} c_t = a_0 + h_0, -$$ +$$ +\sum_{t=0}^T R^{-t} c_t = a_0 + h_0. +$$ (eq:budget_intertemp) -which says that the present value of the consumption stream equals the sum of finanical and non-financial (or human) wealth. +Equation {eq}`eq:budget_intertemp` says that the present value of the consumption stream equals the sum of finanical and non-financial (or human) wealth. -Robert Hall {cite}`Hall1978` showed that when $\beta R = 1$, a condition Milton Friedman had also assumed, -it is "optimal" for a consumer to **smooth consumption** by setting +Robert Hall {cite}`Hall1978` showed that when $\beta R = 1$, a condition Milton Friedman had also assumed, it is "optimal" for a consumer to **smooth consumption** by setting $$ c_t = c_0 \quad t =0, 1, \ldots, T $$ -(Later we'll present a "variational argument" that shows that this constant path is indeed optimal when $\beta R =1$.) +(Later we'll present a "variational argument" that shows that this constant path maximizes +criterion {eq}`welfare` when $\beta R =1$.) In this case, we can use the intertemporal budget constraint to write @@ -194,23 +210,22 @@ Equation {eq}`eq:conssmoothing` is the consumption-smoothing model in a nutshell ## Mechanics of Consumption smoothing model -As promised, we'll provide step by step instructions on how to use linear algebra, readily implemented -in Python, to compute all the objects in play in the consumption-smoothing model. +As promised, we'll provide step-by-step instructions on how to use linear algebra, readily implemented in Python, to compute all objects in play in the consumption-smoothing model. In the calculations below, we'll set default values of $R > 1$, e.g., $R = 1.05$, and $\beta = R^{-1}$. ### Step 1 -For some $(T+1) \times 1$ $y$ vector, use matrix algebra to compute $h_0$ +For a $(T+1) \times 1$ vector $y$, use matrix algebra to compute $h_0$ $$ -\sum_{t=0}^T R^{-t} y_t = \begin{bmatrix} 1 & R^{-1} & \cdots & R^{-T} \end{bmatrix} +h_0 = \sum_{t=0}^T R^{-t} y_t = \begin{bmatrix} 1 & R^{-1} & \cdots & R^{-T} \end{bmatrix} \begin{bmatrix} y_0 \cr y_1 \cr \vdots \cr y_T \end{bmatrix} $$ ### Step 2 -Compute the optimal level of consumption $c_0 $ +Compute an time $0$ consumption $c_0 $ : $$ c_t = c_0 = \left( \frac{1 - R^{-1}}{1 - R^{-(T+1)}} \right) (a_0 + \sum_{t=0}^T R^t y_t ) , \quad t = 0, 1, \ldots, T @@ -218,9 +233,10 @@ $$ ### Step 3 -In this step, we use the system of equations {eq}`eq:a_t` for $t=0, \ldots, T$ to compute a path $a$ of financial wealth. +Use the system of equations {eq}`eq:a_t` for $t=0, \ldots, T$ to compute a path $a$ of financial wealth. + +To do this, we translate that system of difference equations into a single matrix equation as follows: -To do this, we translated that system of difference equations into a single matrix equation as follows (we'll say more about the mechanics of using linear algebra to solve such difference equations later in the last part of this lecture): $$ \begin{bmatrix} @@ -244,18 +260,18 @@ $$ \begin{bmatrix} a_1 \cr a_2 \cr a_3 \cr \vdots \cr a_T \cr a_{T+1} \end{bmatrix} $$ -It should turn out automatically that + +Because we have built into our calculations that the consumer leaves the model with exactly zero assets, just barely satisfying the +terminal condition that $a_{T+1} \geq 0$, it should turn out that $$ a_{T+1} = 0. $$ + -We have built into the our calculations that the consumer leaves life with exactly zero assets, just barely satisfying the -terminal condition that $a_{T+1} \geq 0$. - -Let's verify this with our Python code. +Let's verify this with Python code. -First we implement this model in `compute_optimal` +First we implement the model with `compute_optimal` ```{code-cell} ipython3 def compute_optimal(model, a0, y_seq): @@ -279,10 +295,14 @@ def compute_optimal(model, a0, y_seq): return c_seq, a_seq ``` -We use an example where the consumer inherits $a_0<0$ (which can be interpreted as a student debt). +We use an example where the consumer inherits $a_0<0$. + +This can be interpreted as a student debt. The non-financial process $\{y_t\}_{t=0}^{T}$ is constant and positive up to $t=45$ and then becomes zero afterward. +The drop in non-financial income late in life reflects retirement from work. + ```{code-cell} ipython3 # Financial wealth a0 = -2 # such as "student debt" @@ -297,7 +317,7 @@ print('check a_T+1=0:', np.abs(a_seq[-1] - 0) <= 1e-8) ``` -The visualization shows the path of non-financial income, consumption, and financial assets. +The graphs below show paths of non-financial income, consumption, and financial assets. ```{code-cell} ipython3 # Sequence Length @@ -314,9 +334,9 @@ plt.ylabel(r'$c_t,y_t,a_t$') plt.show() ``` -Note that $a_{T+1} = 0$ is satisfied. +Note that $a_{T+1} = 0$, as anticipated. -We can further evaluate the welfare using the formula {eq}`welfare` +We can evaluate welfare criterion {eq}`welfare` ```{code-cell} ipython3 def welfare(model, c_seq): @@ -332,12 +352,12 @@ print('Welfare:', welfare(cs_model, c_seq)) ### Feasible consumption variations -Earlier, we had promised to present an argument that supports our claim that a constant consumption play $c_t = c_0$ for all +We promised to justify our claim that a constant consumption play $c_t = c_0$ for all $t$ is optimal. Let's do that now. -Although simple and direct, the approach we'll take is actually an example of what is called the "calculus of variations". +The approach we'll take is an elementary example of the "calculus of variations". Let's dive in and see what the key idea is. @@ -348,18 +368,20 @@ $$ \sum_{t=0}^T R^{-t} v_t = 0 $$ -This equation says that the **present value** of admissible variations must be zero. +This equation says that the **present value** of admissible consumption path variations must be zero. -(So once again, we encounter our formula for the present value of an "asset".) +So once again, we encounter a formula for the present value of an "asset": -Here we'll compute a two-parameter class of admissible variations + * we require that the present value of consumption path variations be zero. + +Here we'll restrict ourselves to a two-parameter class of admissible consumption path variations of the form $$ v_t = \xi_1 \phi^t - \xi_0 $$ -We say two and not three-parameter class because $\xi_0$ will be a function of $(\phi, \xi_1; R)$ that guarantees that the variation is feasible. +We say two and not three-parameter class because $\xi_0$ will be a function of $(\phi, \xi_1; R)$ that guarantees that the variation sequence is feasible. Let's compute that function. @@ -389,13 +411,13 @@ $$ This is our formula for $\xi_0$. -Evidently, if $c^o$ is a budget-feasible consumption path, then so is $c^o + v$, +**Key Idea:** if $c^o$ is a budget-feasible consumption path, then so is $c^o + v$, where $v$ is a budget-feasible variation. Given $R$, we thus have a two parameter class of budget feasible variations $v$ that we can use to compute alternative consumption paths, then evaluate their welfare. -Now let's compute and visualize the variations +Now let's compute and plot consumption path variations variations ```{code-cell} ipython3 def compute_variation(model, ξ1, ϕ, a0, y_seq, verbose=1): @@ -415,7 +437,7 @@ def compute_variation(model, ξ1, ϕ, a0, y_seq, verbose=1): +++ {"user_expressions": []} -We visualize variations with $\xi_1 \in \{.01, .05\}$ and $\phi \in \{.95, 1.02\}$ +We visualize variations for $\xi_1 \in \{.01, .05\}$ and $\phi \in \{.95, 1.02\}$ ```{code-cell} ipython3 fig, ax = plt.subplots() @@ -518,26 +540,25 @@ plt.show() ## Wrapping up the consumption-smoothing model -The consumption-smoothing model of Milton Friedman {cite}`Friedman1956` and Robert Hall {cite}`Hall1978`) is a cornerstone of modern macro -that has important ramifications about the size of the Keynesian "fiscal policy multiplier" described briefly in +The consumption-smoothing model of Milton Friedman {cite}`Friedman1956` and Robert Hall {cite}`Hall1978`) is a cornerstone of modern macro that has important ramifications for the size of the Keynesian "fiscal policy multiplier" described briefly in quantecon lecture {doc}`geometric series `. -In particular, Milton Friedman and others showed that it **lowered** the fiscal policy multiplier relative to the one implied by -the simple Keynesian consumption function presented in {doc}`geometric series `. +In particular, it **lowers** the government expenditure multiplier relative to one implied by +the original Keynesian consumption function presented in {doc}`geometric series `. -Friedman and Hall's work opened the door to a lively literature on the aggregate consumption function and implied fiscal multipliers that -remains very active today. +Friedman's work opened the door to an enlighening literature on the aggregate consumption function and associated government expenditure multipliers that +remains active today. -## Difference equations with linear algebra +## Appendix: solving difference equations with linear algebra In the preceding sections we have used linear algebra to solve a consumption smoothing model. -The same tools from linear algebra -- matrix multiplication and matrix inversion -- can be used to study many other dynamic models too. +The same tools from linear algebra -- matrix multiplication and matrix inversion -- can be used to study many other dynamic models. -We'll concluse this lecture by giving a couple of examples. +We'll conclude this lecture by giving a couple of examples. -In particular, we'll describe a useful way of representing and "solving" linear difference equations. +We'll describe a useful way of representing and "solving" linear difference equations. To generate some $y$ vectors, we'll just write down a linear difference equation with appropriate initial conditions and then use linear algebra to solve it. @@ -570,10 +591,10 @@ y_1 \cr y_2 \cr y_3 \cr \vdots \cr y_T \begin{bmatrix} \lambda y_0 \cr 0 \cr 0 \cr \vdots \cr 0 \end{bmatrix} -$$ +$$ (eq:first_order_lin_diff) -Multiplying both sides by inverse of the matrix on the left provides the solution +Multiplying both sides of {eq}`eq:first_order_lin_diff` by the inverse of the matrix on the left provides the solution ```{math} :label: fst_ord_inverse @@ -597,7 +618,7 @@ y_1 \cr y_2 \cr y_3 \cr \vdots \cr y_T ```{exercise} :label: consmooth_ex1 -In the {eq}`fst_ord_inverse`, we multiply the inverse of the matrix $A$. In this exercise, please confirm that +To get {eq}`fst_ord_inverse`, we multiplied both sides of {eq}`eq:first_order_lin_diff` by the inverse of the matrix $A$. Please confirm that $$ \begin{bmatrix} diff --git a/lectures/equalizing_difference.md b/lectures/equalizing_difference.md index bb95bf75..623367cc 100644 --- a/lectures/equalizing_difference.md +++ b/lectures/equalizing_difference.md @@ -18,27 +18,30 @@ kernelspec: This lecture presents a model of the college-high-school wage gap in which the "time to build" a college graduate plays a key role. -```{note} -Milton Friedman used our model to study whether differences in the earnings of US dentists and doctors were justified by competitive labor markets or whether -they reflected entry barriers imposed by US governments working in conjunction with doctors' lobbies. Chapter 4 of Jennifer Burns {cite}`Burns_2023` presents an -interesting account of Milton Friedman's joint work with Simon Kuznets that eventually led to the publication of {cite}`kuznets1939incomes` and {cite}`friedman1954incomes`. To map Friedman's application to our model, think of our high school students as Friedman's dentists and our college graduates as Friedman's doctors. -``` -The model is "incomplete" in the sense that it is just one "condition" in the form of a single equation that would be part of set equations comprising all "equilibrium conditions" of a more fully articulated model. +Milton Friedman invented the model to study whether differences in earnings of US dentists and doctors were outcomes of competitive labor markets or whether +they reflected entry barriers imposed by governments working in conjunction with doctors' professional organizations. + +Chapter 4 of Jennifer Burns {cite}`Burns_2023` describes Milton Friedman's joint work with Simon Kuznets that eventually led to the publication of {cite}`kuznets1939incomes` and {cite}`friedman1954incomes`. + +To map Friedman's application into our model, think of our high school students as Friedman's dentists and our college graduates as Friedman's doctors. + -The condition featured in our model determines a college, high-school wage ratio that equalizes the present values of a high school worker and a college educated worker. +Our presentation is "incomplete" in the sense that it is based on a single equation that would be part of set equilibrium conditions of a more fully articulated model. -The idea behind this condition is that lifetime earnings have to adjust to make someone indifferent between going to college and not going to college. +This ''equalizing difference'' equation determines a college, high-school wage ratio that equalizes present values of a high school educated worker and a college educated worker. -(The job of the "other equations" in a more complete model would be to fill in details about what adjusts to bring about this outcome.) +The idea is that lifetime earnings somehow adjust to make a new high school worker indifferent between going to college and not going to college but instead going to work immmediately. -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`. +(The job of the "other equations" in a more complete model would be to describe what adjusts to bring about this outcome.) + +Our model is just one example 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`. For most of this lecture, the only mathematical tools that we'll use are from linear algebra, in particular, matrix multiplication and matrix inversion. -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. +However, near the 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. -(And doing that will let us show off how good Python is at doing calculus!) +And doing that will let illustrate how good Python is at doing calculus! But if you don't know calculus, our tools from linear algebra are certainly enough. @@ -51,7 +54,7 @@ import matplotlib.pyplot as plt ## The indifference condition -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. +The key idea is that the entry level college wage premium has to adjust to make a representative worker indifferent between going to college and not going to college. Let @@ -59,7 +62,7 @@ Let * $t = 0, 1, 2, \ldots T$ denote the years that a person either works or attends college - * $0$ denote the first period after high school that a person can go to work + * $0$ denote the first period after high school that a person can work if he does not go to college * $T$ denote the last period that a person works @@ -75,7 +78,12 @@ Let * $D$ be the upfront monetary costs of going to college +We now compute present values that a new high school graduate earns if + + * he goes to work immediately and earns wages paid to someone without a college education + * he goes to college for four years and after graduating earns wages paid to a college graduate +### Present value of a high school educated worker If someone goes to work immediately after high school and works for the $T+1$ years $t=0, 1, 2, \ldots, T$, she earns present value @@ -91,6 +99,8 @@ $$ The present value $h_0$ is the "human wealth" at the beginning of time $0$ of someone who chooses not to attend college but instead to go to work immediately at the wage of a high school graduate. +### Present value of a college-bound new high school graduate + If someone goes to college for the four years $t=0, 1, 2, 3$ during which she earns $0$, but then goes to work immediately after college and works for the $T-3$ years $t=4, 5, \ldots ,T$, she earns present value @@ -101,13 +111,13 @@ $$ where $$ -A_c = (R^{-1} \gamma_c)^4 \left[ \frac{1 - (R^{-1} \gamma_c)^{T-3} }{1 - R^{-1} \gamma_c } \right] +A_c = (R^{-1} \gamma_c)^4 \left[ \frac{1 - (R^{-1} \gamma_c)^{T-3} }{1 - R^{-1} \gamma_c } \right] . $$ The present value $c_0$ is the "human wealth" at the beginning of time $0$ of someone who chooses to attend college for four years and then start to work at time $t=4$ at the wage of a college graduate. -Assume that college tuition plus four years of room and board paid for up front costs $D$. +Assume that college tuition plus four years of room and board amount to $D$ and must be paid at time $0$. So net of monetary cost of college, the present value of attending college as of the first period after high school is @@ -115,9 +125,7 @@ $$ c_0 - D $$ -We now formulate a pure **equalizing difference** model of the initial college-high school wage gap $\phi$ defined by - -Let +We now formulate a pure **equalizing difference** model of the initial college-high school wage gap $\phi$ that verifies $$ w_0^c = \phi w_0^h @@ -125,7 +133,7 @@ $$ We suppose that $R, \gamma_h, \gamma_c, T$ and also $w_0^h$ are fixed parameters. -We start by noting that the pure equalizing difference model asserts that the college-high-school wage gap $\phi$ solves +We start by noting that the pure equalizing difference model asserts that the college-high-school wage gap $\phi$ solves an "equalizing" equation that sets the present value not going to college equal to the present value of going go college: @@ -139,7 +147,7 @@ $$ w_0^h A_h = \phi w_0^h A_c - D . $$ (eq:equalize) -This is the "indifference condition" that is at the heart of the model. +This "indifference condition" is the heart of the model. Solving equation {eq}`eq:equalize` for the college wage premium $\phi$ we obtain @@ -147,7 +155,9 @@ $$ \phi = \frac{A_h}{A_c} + \frac{D}{w_0^h A_c} . $$ (eq:wagepremium) -In a **free college** special case $D =0$ so that the only cost of going to college is the forgone earnings from not working as a high school worker. +In a **free college** special case $D =0$. + +Here the only cost of going to college is the forgone earnings from being a high school educated worker. In that case, @@ -155,9 +165,9 @@ $$ \phi = \frac{A_h}{A_c} . $$ -Soon we'll write Python code to compute the gap and plot it as a function of its determinants. +Soon we'll write Python code to compute $\phi$ and plot it as a function of its determinants. -But first we'll describe a possible alternative interpretation of our model. +But first we'll describe an alternative interpretation of our model that mostly just relabels variables. @@ -185,13 +195,18 @@ This cost might include costs of hiring workers, office space, and lawyers. What we used to call the college, high school wage gap $\phi$ now becomes the ratio of a successful entrepreneur's earnings to a worker's earnings. -We'll find that as $\pi$ decreases, $\phi$ increases. +We'll find that as $\pi$ decreases, $\phi$ increases, indicating that the riskier it is to +be an entrepreuner, the higher must be the reward for a successful project. + +## Computations -Now let's write some Python code to compute $\phi$ and plot it as a function of some of its determinants. -We can have some fun providing some example calculations that tweak various parameters, +We can have some fun with examples that tweak various parameters, prominently including $\gamma_h, \gamma_c, R$. +Now let's write some Python code to compute $\phi$ and plot it as a function of some of its determinants. + + ```{code-cell} ipython3 class equalizing_diff: """ @@ -219,10 +234,10 @@ class equalizing_diff: ``` +Using vectorization instead of loops, +we build some functions to help do comparative statics . -We can build some functions to help do comparative statics using vectorization instead of loops. - -For a given instance of the class, we want to compute $\phi$ when one parameter changes and others remain unchanged. +For a given instance of the class, we want to recompute $\phi$ when one parameter changes and others remain fixed. Let's do an example. @@ -315,7 +330,7 @@ plt.show() ``` Notice how the intitial wage gap falls when the rate of growth $\gamma_c$ of college wages rises. -It falls to "equalize" the present values of the two types of career, one as a high school worker, the other as a college worker. +The wage gap falls to "equalize" the present values of the two types of career, one as a high school worker, the other as a college worker. Can you guess what happens to the initial wage ratio $\phi$ when next we vary the rate of growth of high school wages, holding all other determinants of $\phi$ constant? @@ -363,9 +378,9 @@ Does the graph make sense to you? 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. -However, someone who knows calculus might ask "Instead of plotting those graphs, why didn't you just take partial derivatives?" +However, someone who knows calculus might want us just to take partial derivatives. -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. +We'll do that now. 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. @@ -433,7 +448,7 @@ Now let's compute $\frac{\partial \phi}{\partial D}$ and then evaluate it at the ϕ_D_func(D_value, γ_h_value, γ_c_value, R_value, T_value, w_h0_value) ``` -Thus, as with our graph above, we find that raising $R$ increases the initial college wage premium $\phi$. +Thus, as with our earlier graph, we find that raising $R$ increases the initial college wage premium $\phi$. +++ @@ -469,7 +484,7 @@ Let's compute $\frac{\partial \phi}{\partial γ_h}$ and evaluate it at default p ϕ_γ_h_func(D_value, γ_h_value, γ_c_value, R_value, T_value, w_h0_value) ``` -We find that raising $\gamma_h$ increases the initial college wage premium $\phi$, as we did with our graphical analysis earlier +We find that raising $\gamma_h$ increases the initial college wage premium $\phi$, as we did with our earlier graphical analysis. +++ diff --git a/lectures/geom_series.md b/lectures/geom_series.md index 3d9bfe70..af7ec7b8 100644 --- a/lectures/geom_series.md +++ b/lectures/geom_series.md @@ -25,8 +25,10 @@ kernelspec: # Geometric Series for Elementary Economics -```{contents} Contents -:depth: 2 +```{admonition} Migrated lecture +:class: warning + +This lecture has moved from our [Intermediate Quantitative Economics with Python](https://python.quantecon.org/intro.html) lecture series and is now a part of [A First Course in Quantitative Economics](https://intro.quantecon.org/intro.html). ``` ## Overview diff --git a/lectures/inflation_history.md b/lectures/inflation_history.md index e6e0ac83..b82c628f 100644 --- a/lectures/inflation_history.md +++ b/lectures/inflation_history.md @@ -13,7 +13,7 @@ kernelspec: # Price Level Histories -This lecture offers some scraps of historical evidence about fluctuations in levels of aggregate price indexes. +This lecture offers some historical evidence about fluctuations in levels of aggregate price indexes. The rate of growth of the price level is called **inflation** in the popular press and in discussions among central bankers and treasury officials. @@ -21,36 +21,34 @@ The price level is measured in units of domestic currency per units of a represe Thus, in the US, the price level at $t$ is measured in dollars in month $t$ or year $t$ per unit of the consumption bundle. -Until the early 20th century, throughout much of the west, although price levels fluctuated from year to year, -they didn't have much of a trend. +Until the early 20th century, throughout much of the west, although price levels fluctuated from year to year, they didn't have much of a trend. -Thus, they tended to end a century at close to a level at which they started it. +They tended to end a century near where they started it. Things were different in the 20th century, as we shall see in this lecture. -This lecture will set the stage for some subsequent lectures about a particular theory that economists use to -think about determinants of the price level. +We'll indicater a widely believed explanation of this big difference -- countries' abandoning gold and silver standards in early twentieth century. +This lecture sets the stage for some subsequent lectures about a theory that macroeconomists economists use to think about determinants of the price level, namely, {doc}`this lecture ` and +{doc}`this lecture ` -## Four Centuries of Price Levels -We begin by displaying some data that originally appeared on page 35 of {cite}`sargent2002big`. +## Four Centuries of Price Levels -The data price levels for four "hard currency" countries from 1600 to 1914. +We begin by displaying data that originally appeared on page 35 of {cite}`sargent2002big` and that show price levels for four "hard currency" countries from 1600 to 1914. -The four countries are * France * Spain (Castile) * United Kingdom * United States -In the present context, the phrase hard currency means that the countries were on a commodity-money standard: money consisted of gold and silver coins that circulated at values largely determined by the weights of their gold and silver contents. +In the present context, the phrase ''hard currency'' means that the countries were on a commodity-money standard: money consisted of gold and silver coins that circulated at values largely determined by the weights of their gold and silver contents. -(Under a gold or silver standard, some money also consisted of "warehouse certificates" that represented paper claims on gold or silver coins. Bank notes issued by the government or private banks can be viewed as examples of such "warehouse certificate".) - -The data we want to study data originally appeared in a graph on page 35 of {cite}`sargent2002big`. +```{note} +Under a gold or silver standard, some money also consisted of "warehouse certificates" that represented paper claims on gold or silver coins. Bank notes issued by the government or private banks can be viewed as examples of such "warehouse certificates''. +``` As usual, we'll start by importing some Python modules. @@ -107,49 +105,50 @@ plt.show() We say "most years" because there were temporary lapses from the gold or silver standard. -By staring at the graph carefully, you might be able to guess when these temporary lapses occurred, because they were also times during which price levels rose markedly from what had been average values during more typical years. +By staring at the graph carefully, you might be able to guess when these temporary lapses occurred, because they were also times during which price levels temporarily rose markedly: - * 1791-1797 in France (the French Revolution) - * 1776-1793 in the US (the US War for Independence from Great Britain) - * 1861-1865 in the US (the US Civil War) + * 1791-1797 in France (French Revolution) + * 1776-1790 in the US (War for Independence from Great Britain) + * 1861-1865 in the US (Civil War) -During each of these episodes, the gold/silver standard was temporarily abandoned as a government printed paper money to help it finance war expenditures. +During these episodes, the gold/silver standard was temporarily abandoned when a government printed paper money to pay for war expenditures. Despite these temporary lapses, a striking thing about the figure is that price levels hovered around roughly constant long-term levels for over three centuries. -Two other features of the figure attracted the attention of leading economists such as Irving Fisher of Yale University and John Maynard Keynes of Cambridge University in the early century. +In the early centuryTwo other features of these data attracted the attention of Irving Fisher of Yale University and John Maynard Keynes of Cambridge University. - * There was considerable year-to-year instability of the price levels despite their long begin anchored to the same average level in the long term + * Despite beig anchored to the same average level over long time spans, there were considerable year-to-year variations in price levels - * While using valuable gold and silver as coins was a time-tested way to anchor the price level by limiting the supply of money, it cost real resources. + * While using valuable gold and silver as coins succeeded in anchoring the price level by limiting the supply of money, it cost real resources. - * that is, society paid a high "opportunity cost" for using gold and silver as coins; gold and silver could instead be used as valuable jewelry and also as an industrial input. + * a country paid a high "opportunity cost" for using gold and silver as coins as money: that gold and silver could instead have been made into valuable jewelry and other durable goods. -Keynes and Fisher proposed what they suggested would be a socially more efficient way to achieve a price level that would be at least as firmly anchored, and would also exhibit less year-to-year short-term fluctuations. +Keynes and Fisher proposed what they claimed would be a more efficient way to achieve a price level that + * would be at least as firmly anchored as achieved under a gold or silver standard, and + * would also exhibit less year-to-year short-term fluctuations. -In particular, they argued that a well-managed central bank could achieve price level stability by +They said that central bank could achieve price level stability by - * issuing a **limited supply** of paper currency - * guaranteeing that it would not print money to finance government expenditures + * issuing **limited supplies** of paper currency + * refusing to print money to finance government expenditures -Thus, the waste from using gold and silver as coins prompted John Maynard Keynes to call a commodity standard a “barbarous relic.” +This logic prompted John Maynard Keynes to call a commodity standard a “barbarous relic.” -A paper fiat money system disposes of all reserves behind a currency. +A paper currency or ''fiat money'' system disposes of all reserves behind a currency. -But notice that in doing so, it also eliminates an automatic supply mechanism constraining the price level. +But adhereing to a gold or silver standard had provided an automatic mechanism for limiting the supply of money, thereby anchoring the price level. -A low-inflation paper fiat money system replaces that automatic mechanism with an enlightened government that commits itself to limiting the quantity of a pure token, no-cost currency. +To anchor the price level, a pure paper or fiat money system replaces that automatic mechanism with a central bank with the authority and determination to limit the supply of money +(and to deter counterfeiters!) -Now let's see what happened to the price level in our four countries when after 1914 one after another of them -left the gold/silver standard. - -We'll show a version of the complete graph that originally appeared on page 35 of {cite}`sargent2002big`. +Now let's see what happened to the price level in our four countries when after 1914 one after another of them left the gold/silver standard by showing the complete graph that originally appeared on page 35 of {cite}`sargent2002big`. The graph shows logarithms of price levels our four "hard currency" countries from 1600 to 2000. -Although we didn't have to use logarithms in our earlier graphs that had stopped in 1914 -- we use logarithms now because we want also to fit observations after 1914 in the same graph as the earlier observations. +Although we didn't have to use logarithms in our earlier graphs that had stopped in 1914, now we use logarithms because we want also to fit observations after 1914 in the same graph as the earlier observations. + +After the outbreak of the Great War in 1914, the four countries left the gold standard and in so doing acquired the ability to print money to finance government expenditures. -All four of the countries eventually permanently left the gold standard by modifying their monetary and fiscal policies in several ways, starting the outbreak of the Great War in 1914. ```{code-cell} ipython3 fig, ax = plt.subplots(figsize=[8, 5], dpi=200) @@ -170,18 +169,21 @@ fig.text(.5, .0001, plt.show() ``` -The graph shows that achieving a price level system with a well-managed paper money system proved to be more challenging than Irving Fisher and Keynes perhaps imagined. +The graph shows that paper-money-printing central banks didn't do as well as the gold and standard silver standard in anchoring price levels. + +That would probably have surprised or disappointed Irving Fisher and John Maynard Keynes. -Actually, earlier economists and statesmen knew about the possibility of fiat money systems long before -Keynes and Fisher advocated them in the early 20th century. +Actually, earlier economists and statesmen knew about the possibility of fiat money systems long before Keynes and Fisher advocated them in the early 20th century. -It was because earlier proponents of a commodity money system did not trust governments properly to manage a fiat money system that they were willing to pay the resource costs associated with setting up and maintaining a commodity money system. +Proponents of a commodity money system did not trust governments and central banks properly to manage a fiat money system. -In light of the high inflation episodes that many countries experienced in the twentieth century after they abandoned commodity monies, it is difficult to criticize them for their preference to stay on the pre-1914 gold/silver standard. +They were willing to pay the resource costs associated with setting up and maintaining a commodity money system. -The breadth and length of the inflationary experiences of the twentieth century, the century of paper money, are historically unprecedented. +In light of the high and persistent inflation that many countries experienced after they abandoned commodity monies in the twentieth century, we hesitate to criticize advocates of a gold or silver standard for their preference to stay on the pre-1914 gold/silver standard. -## Ends of Four Big Inflations +The breadth and lengths of the inflationary experiences of the twentieth century under paper money fiat standards are historically unprecedented. + +## Four Big Inflations In the wake of World War I, which ended in November 1918, monetary and fiscal authorities struggled to achieve price level stability without being on a gold or silver standard. @@ -358,7 +360,7 @@ for i in range(4): df_Aus, df_Hung, df_Pol, df_Germ = df_list ``` -Let's dive in and construct graphs for our four countries. +Let's construct graphs for our four countries. For each country, we'll plot two graphs. @@ -577,29 +579,43 @@ plt.show() ## Starting and Stopping Big Inflations -A striking thing about our four graphs is how **quickly** the (log) price levels in Austria, Hungary, Poland, -and Germany leveled off after having been rising so quickly. +It is striking how **quickly** (log) price levels in Austria, Hungary, Poland, +and Germany leveled off after rising so quickly. -These "sudden stops" are also revealed by the permanent drops in three-month moving averages of inflation for the four countries. +These "sudden stops" are also revealed by the permanent drops in three-month moving averages of inflation for the four countries plotted above. In addition, the US dollar exchange rates for each of the four countries shadowed their price levels. - * This pattern is an instance of a force modeled in the **purchasing power parity** theory of exchange rates. + * This pattern is an instance of a force featured in the **purchasing power parity** theory of exchange rates (see ). Each of these big inflations seemed to have "stopped on a dime". -Chapter 3 of {cite}`sargent2002big` attempts to offer an explanation for this remarkable pattern. +Chapter 3 of {cite}`sargent2002big` offers an explanation for this remarkable pattern. + +In a nutshell, here is the explanation offered there. + +After World War I, the United States was on a gold standard. + +The US government stood ready to convert a dollar into a specified amount of gold on demand. -In a nutshell, here is his story. +Immediately after World War I, Hungary, Austria, Poland, and Germany were not on the gold standard. -After World War I, the United States was on the gold standard. The US government stood ready to convert a dollar into a specified amount of gold on demand. To understate things, immediately after the war, Hungary, Austria, Poland, and Germany were not on the gold standard. +Their currencies were “fiat” or "unbacked", meaning that they were not backed by credible government promises to convert them into gold or silver coins on demand. + +The governments printed new paper notes to pay for goods and services. + +```{note} +Technically the notes were "backed" mainly by treasury bills. But people could not expect that those treasury bills would be paid off by levying taxes, but instead by printing more notes or treasury bills. +``` + This was done on such a scale that it led to a depreciation of the currencies of spectacular proportions. + + In the end, the German mark stabilized at 1 trillion ($10^{12}$) paper marks to the prewar gold mark, the Polish mark at 1.8 million paper marks to the gold zloty, the Austrian crown at 14,400 paper crowns to the prewar Austro-Hungarian crown, and the Hungarian krone at 14,500 paper crowns to the prewar Austro-Hungarian crown. -In practice, their currencies were largely “fiat” or "unbacked", meaning that they were not backed by credible government promises to convert them into gold or silver coins on demand. The governments of these countries resorted to the printing of new unbacked money to finance government deficits. (The notes were "backed" mainly by treasury bills that, in those times, could not be expected to be paid off by levying taxes, but only by printing more notes or treasury bills.) This was done on such a scale that it led to a depreciation of the currencies of spectacular proportions. In the end, the German mark stabilized at 1 trillion ($10^{12}$) paper marks to the prewar gold mark, the Polish mark at 1.8 million paper marks to the gold zloty, the Austrian crown at 14,400 paper crowns to the prewar Austro-Hungarian crown, and the Hungarian krone at 14,500 paper crowns to the prewar Austro-Hungarian crown. +Chapter 3 of {cite}`sargent2002big` described deliberate changes in policy that Hungary, Austria, Poland, and Germany made to end their hyperinflations. -Chapter 3 of {cite}`sargent2002big` focuses on the deliberate changes in policy that Hungary, Austria, Poland, and Germany made to end their hyperinflations. -The hyperinflations were each ended by restoring or virtually restoring convertibility to the dollar or equivalently to gold. +Each governent stoppped printing money to pay for goods and services once again made its currency convertible to the US dollar or the UK pound, thereby vitually to gold. -The story told in {cite}`sargent2002big` is grounded in a "monetarist theory of the price level" described in {doc}`this lecture ` and further discussed in +The story told in {cite}`sargent2002big` is grounded in a "monetarist theory of the price level" described in {doc}`this lecture ` and {doc}`this lecture `. -Those lectures discuss theories about what holders of those rapidly depreciating currencies were thinking about them and how that shaped responses of inflation to government policies. +Those lectures discuss theories about what owners of those rapidly depreciating currencies were thinking and how their beliefs shaped responses of inflation to government monetary and fiscal policies. diff --git a/lectures/lp_intro.md b/lectures/lp_intro.md index 8f2c02af..26896607 100644 --- a/lectures/lp_intro.md +++ b/lectures/lp_intro.md @@ -12,6 +12,12 @@ kernelspec: (lp_intro)= # Linear Programming +```{admonition} Migrated lecture +:class: warning + +This lecture has moved from our [Intermediate Quantitative Economics with Python](https://python.quantecon.org/intro.html) lecture series and is now a part of [A First Course in Quantitative Economics](https://intro.quantecon.org/intro.html). +``` + In this lecture, we will need the following library. Install [ortools](https://developers.google.com/optimization) using `pip`. ```{code-cell} ipython3 diff --git a/lectures/pv.md b/lectures/pv.md index f4678a2a..7bdfa0fc 100644 --- a/lectures/pv.md +++ b/lectures/pv.md @@ -18,40 +18,73 @@ kernelspec: This lecture describes the **present value model** that is a starting point of much asset pricing theory. -We'll use the calculations described here in several subsequent lectures. +Asset pricing theory is a component of theories about many economic decisions including -Our only tool is some elementary linear algebra operations, namely, matrix multiplication and matrix inversion. + * consumption + * labor supply + * education choice + * demand for money + +In asset pricing theory, and in economic dynamics more generally, a basic topic is the relationship +among different **time series**. + +A **time series** is a **sequence** indexed by time. + +In this lecture, we'll represent a sequence as a vector. + +So our analysis will typically boil down to studying relationships among vectors. + +Our main tools in this lecture will be + + * matrix multiplication, and + * matrix inversion. + +We'll use the calculations described here in subsequent lectures, including {doc}`consumption smoothing `, {doc}`equalizing difference model `, and +{doc}`monetarist theory of price levels `. Let's dive in. +## Analysis + + + Let * $\{d_t\}_{t=0}^T $ be a sequence of dividends or "payouts" * $\{p_t\}_{t=0}^T $ be a sequence of prices of a claim on the continuation of - the asset stream from date $t$ on, namely, $\{d_s\}_{s=t}^T $ + the asset's payout stream from date $t$ on, namely, $\{d_s\}_{s=t}^T $ * $ \delta \in (0,1) $ be a one-period "discount factor" * $p_{T+1}^*$ be a terminal price of the asset at time $T+1$ We assume that the dividend stream $\{d_t\}_{t=0}^T $ and the terminal price $p_{T+1}^*$ are both exogenous. +This means that they are determined outside the model. + Assume the sequence of asset pricing equations $$ p_t = d_t + \delta p_{t+1}, \quad t = 0, 1, \ldots , T $$ (eq:Euler1) -This is a "cost equals benefits" formula. +We say equation**s**, plural, because there are $T+1$ equations, one for each $t =0, 1, \ldots, T$. + + +Equations {eq}`eq:Euler1` assert that price paid to purchase the asset at time $t$ equals the payout $d_t$ plus the price at time $t+1$ multiplied by a time discount factor $\delta$. -It says that the cost of buying the asset today equals the reward for holding it -for one period (which is the dividend $d_t$) and then selling it, at $t+1$. +Discounting tomorrow's price by multiplying it by $\delta$ accounts for the ``value of waiting one period''. -The future value $p_{t+1}$ is discounted using $\delta$ to shift it to a present value, so it is comparable with $d_t$ and $p_t$. +We want to solve the system of $T+1$ equations {eq}`eq:Euler1` for the asset price sequence $\{p_t\}_{t=0}^T $ as a function of the divident sequence $\{d_t\}_{t=0}^T $ and the exogenous terminal +price $p_{T+1}^*$. -We want to solve for the asset price sequence $\{p_t\}_{t=0}^T $ as a function -of $\{d_t\}_{t=0}^T $ and $p_{T+1}^*$. +A system of equations like {eq}`eq:Euler1` is an example of a linear **difference equation**. -In this lecture we show how this can be done using matrix algebra. +There are powerful mathematical methods available for solving such systems and they are well worth +studying in their own right, being the foundation for the analysis of many interesting economic models. + +For an example, see {doc}`Samuelson multiplier-accelerator ` + +In this lecture, we'll solve system {eq}`eq:Euler1` using matrix multiplication and matrix inversion, basic tools from linear algebra introduced in {doc}`linear equations and matrix algebra `. We will use the following imports @@ -64,9 +97,9 @@ import matplotlib.pyplot as plt +++ -## Present value calculations +## Representing sequences as vectors -The equations in [](eq:Euler1) can be stacked, as in +The equations in system {eq}`eq:Euler1` can be arranged as follows: $$ \begin{aligned} @@ -109,7 +142,7 @@ recover the equations in [](eq:Euler_stack). ```{exercise-end} ``` -In vector-matrix notation, we can write the system [](eq:pvpieq) as +In vector-matrix notation, we can write system {eq}`eq:pvpieq` as $$ A p = d + b @@ -143,19 +176,20 @@ $$ \end{bmatrix} $$ -The solution for prices is given by +The solution for the vector of prices is $$ p = A^{-1}(d + b) $$ (eq:apdb_sol) -Here is a small example, where the dividend stream is given by +For example, suppose that the dividend stream is $$ d_{t+1} = 1.05 d_t, \quad t = 0, 1, \ldots , T-1. $$ +Let's write Python code to compute and plot the dividend stream. ```{code-cell} ipython3 T = 6 @@ -171,6 +205,7 @@ ax.legend() ax.set_xlabel('time') plt.show() ``` +Now let's compute and plot the asset price. We set $\delta$ and $p_{T+1}^*$ to @@ -198,7 +233,7 @@ Let's inspect $A$ A ``` -Now let's solve for prices using [](eq:apdb_sol). +Now let's solve for prices using {eq}`eq:apdb_sol`. ```{code-cell} ipython3 b = np.zeros(T+1) @@ -212,7 +247,7 @@ plt.show() ``` -We can also consider a cyclically growing dividend sequence, such as +Now let's consider a cyclically growing dividend sequence: $$ d_{t+1} = 1.01 d_t + 0.1 \sin t, \quad t = 0, 1, \ldots , T-1. @@ -248,7 +283,7 @@ Compute the corresponding asset price sequence when $p^*_{T+1} = 0$ and $\delta :class: dropdown ``` -We proceed as above after modifying parameters and $A$. +We proceed as above after modifying parameters and consequently the matrix $A$. ```{code-cell} ipython3 δ = 0.98 @@ -281,6 +316,8 @@ eliminates the cycles. ## Analytical expressions +By the [inverse matrix theorem](https://en.wikipedia.org/wiki/Invertible_matrix), a matrix $B$ is the inverse of $A$ whenever $A B$ is the identity. + It can be verified that the inverse of the matrix $A$ in {eq}`eq:pvpieq` is @@ -302,13 +339,13 @@ $$ (eq:Ainv) Check this by showing that $A A^{-1}$ is equal to the identity matrix. -(By the [inverse matrix theorem](https://en.wikipedia.org/wiki/Invertible_matrix), a matrix $B$ is the inverse of $A$ whenever $A B$ is the identity.) + ```{exercise-end} ``` -If we use the expression [](eq:Ainv) in [](eq:apdb_sol) and perform the indicated matrix multiplication, we shall find that +If we use the expression {eq}`eq:Ainv` in {eq}`eq:apdb_sol` and perform the indicated matrix multiplication, we shall find that $$ p_t = \sum_{s=t}^T \delta^{s-t} d_s + \delta^{T+1-t} p_{T+1}^* @@ -317,12 +354,12 @@ $$ (eq:ptpveq) Pricing formula {eq}`eq:ptpveq` asserts that two components sum to the asset price $p_t$: - * a **fundamental component** $\sum_{s=t}^T \delta^{s-t} d_s$ that equals the discounted present value of prospective dividends + * a **fundamental component** $\sum_{s=t}^T \delta^{s-t} d_s$ that equals the **discounted present value** of prospective dividends * a **bubble component** $\delta^{T+1-t} p_{T+1}^*$ The fundamental component is pinned down by the discount factor $\delta$ and the -"fundamentals" of the asset (in this case, the dividends). +payout of the asset (in this case, dividends). The bubble component is the part of the price that is not pinned down by fundamentals. @@ -343,7 +380,7 @@ $$ ## More about bubbles -For a few moments, let's focus on the special case of an asset that will never pay dividends, in which case +For a few moments, let's focus on the special case of an asset that never pays dividends, in which case $$ \begin{bmatrix} @@ -385,8 +422,9 @@ $$ (eq:eqbubbleterm) for some positive constant $c$. -In this case, it can be verified that when we multiply both sides of {eq}`eq:pieq2` by -the matrix $A^{-1}$ presented in equation {eq}`eq:Ainv`, we shall find that +In this case, when we multiply both sides of {eq}`eq:pieq2` by +the matrix $A^{-1}$ presented in equation {eq}`eq:Ainv`, we + find that $$ p_t = c \delta^{-t} @@ -402,11 +440,10 @@ $$ R_t = \frac{p_{t+1}}{p_t} $$ (eq:rateofreturn) -Equation {eq}`eq:bubble` confirms that an asset whose sole source of value is a bubble -that earns a gross rate of return +Substituting equation {eq}`eq:bubble` into equation {eq}`eq:rateofreturn` confirms that an asset whose sole source of value is a bubble earns a gross rate of return $$ -R_t = \delta^{-1} > 1 . +R_t = \delta^{-1} > 1 , t = 0, 1, \ldots, T $$ @@ -417,7 +454,7 @@ $$ :label: pv_ex_a ``` -Give analytical expressions for the asset price $p_t$ under the +Give analytical expressions for an asset price $p_t$ under the following settings for $d$ and $p_{T+1}^*$: 1. $p_{T+1}^* = 0, d_t = g^t d_0$ (a modified version of the Gordon growth formula) diff --git a/lectures/scalar_dynam.md b/lectures/scalar_dynam.md index bfb1274e..864cb54d 100644 --- a/lectures/scalar_dynam.md +++ b/lectures/scalar_dynam.md @@ -20,6 +20,12 @@ kernelspec: (scalar_dynam)= # Dynamics in One Dimension +```{admonition} Migrated lecture +:class: warning + +This lecture has moved from our [Intermediate Quantitative Economics with Python](https://python.quantecon.org/intro.html) lecture series and is now a part of [A First Course in Quantitative Economics](https://intro.quantecon.org/intro.html). +``` + ## Overview In this lecture we give a quick introduction to discrete time dynamics in one dimension. diff --git a/lectures/schelling.md b/lectures/schelling.md index 94dd0987..1bdc9004 100644 --- a/lectures/schelling.md +++ b/lectures/schelling.md @@ -28,6 +28,12 @@ kernelspec: ```{index} single: Models; Schelling's Segregation Model ``` +```{admonition} Migrated lecture +:class: warning + +This lecture has moved from our [Intermediate Quantitative Economics with Python](https://python.quantecon.org/intro.html) lecture series and is now a part of [A First Course in Quantitative Economics](https://intro.quantecon.org/intro.html). +``` + ## Outline In 1969, Thomas C. Schelling developed a simple but striking model of racial diff --git a/lectures/short_path.md b/lectures/short_path.md index d9eb0771..68ab9e97 100644 --- a/lectures/short_path.md +++ b/lectures/short_path.md @@ -23,6 +23,12 @@ kernelspec: ```{index} single: Dynamic Programming; Shortest Paths ``` +```{admonition} Migrated lecture +:class: warning + +This lecture has moved from our [Intermediate Quantitative Economics with Python](https://python.quantecon.org/intro.html) lecture series and is now a part of [A First Course in Quantitative Economics](https://intro.quantecon.org/intro.html). +``` + ## Overview The shortest path problem is a [classic problem](https://en.wikipedia.org/wiki/Shortest_path) in mathematics and computer science with applications in