{ "cells": [ { "cell_type": "markdown", "id": "31a83d46", "metadata": {}, "source": [ "\n", "\n", "\n", "" ] }, { "cell_type": "markdown", "id": "00f225d3", "metadata": {}, "source": [ "# Geometric Series for Elementary Economics" ] }, { "cell_type": "markdown", "id": "94865545", "metadata": {}, "source": [ "## Contents\n", "\n", "- [Geometric Series for Elementary Economics](#Geometric-Series-for-Elementary-Economics) \n", " - [Overview](#Overview) \n", " - [Key Formulas](#Key-Formulas) \n", " - [Example: The Money Multiplier in Fractional Reserve Banking](#Example:-The-Money-Multiplier-in-Fractional-Reserve-Banking) \n", " - [Example: The Keynesian Multiplier](#Example:-The-Keynesian-Multiplier) \n", " - [Example: Interest Rates and Present Values](#Example:-Interest-Rates-and-Present-Values) \n", " - [Back to the Keynesian Multiplier](#Back-to-the-Keynesian-Multiplier) " ] }, { "cell_type": "markdown", "id": "b6dd1327", "metadata": {}, "source": [ "## Overview\n", "\n", "The lecture describes important ideas in economics that use the mathematics of geometric series.\n", "\n", "Among these are\n", "\n", "- the Keynesian **multiplier** \n", "- the money **multiplier** that prevails in fractional reserve banking\n", " systems \n", "- interest rates and present values of streams of payouts from assets \n", "\n", "\n", "(As we shall see below, the term **multiplier** comes down to meaning **sum of a convergent geometric series**)\n", "\n", "These and other applications prove the truth of the wise crack that\n", "\n", "> “in economics, a little knowledge of geometric series goes a long way “\n", "\n", "\n", "Below we’ll use the following imports:" ] }, { "cell_type": "code", "execution_count": null, "id": "6fe0ad19", "metadata": { "hide-output": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "plt.rcParams[\"figure.figsize\"] = (11, 5) #set default figure size\n", "import numpy as np\n", "import sympy as sym\n", "from sympy import init_printing\n", "from matplotlib import cm\n", "from mpl_toolkits.mplot3d import Axes3D" ] }, { "cell_type": "markdown", "id": "15302a1b", "metadata": {}, "source": [ "## Key Formulas\n", "\n", "To start, let $ c $ be a real number that lies strictly between\n", "$ -1 $ and $ 1 $.\n", "\n", "- We often write this as $ c \\in (-1,1) $. \n", "- Here $ (-1,1) $ denotes the collection of all real numbers that\n", " are strictly less than $ 1 $ and strictly greater than $ -1 $. \n", "- The symbol $ \\in $ means *in* or *belongs to the set after the symbol*. \n", "\n", "\n", "We want to evaluate geometric series of two types – infinite and finite." ] }, { "cell_type": "markdown", "id": "f1c15d36", "metadata": {}, "source": [ "### Infinite Geometric Series\n", "\n", "The first type of geometric that interests us is the infinite series\n", "\n", "$$\n", "1 + c + c^2 + c^3 + \\cdots\n", "$$\n", "\n", "Where $ \\cdots $ means that the series continues without end.\n", "\n", "The key formula is\n", "\n", "\n", "\n", "$$\n", "1 + c + c^2 + c^3 + \\cdots = \\frac{1}{1 -c } \\tag{1.1}\n", "$$\n", "\n", "To prove key formula [(1.1)](#equation-infinite), multiply both sides by $ (1-c) $ and verify\n", "that if $ c \\in (-1,1) $, then the outcome is the\n", "equation $ 1 = 1 $." ] }, { "cell_type": "markdown", "id": "56ffde00", "metadata": {}, "source": [ "### Finite Geometric Series\n", "\n", "The second series that interests us is the finite geometric series\n", "\n", "$$\n", "1 + c + c^2 + c^3 + \\cdots + c^T\n", "$$\n", "\n", "where $ T $ is a positive integer.\n", "\n", "The key formula here is\n", "\n", "$$\n", "1 + c + c^2 + c^3 + \\cdots + c^T = \\frac{1 - c^{T+1}}{1-c}\n", "$$\n", "\n", "**Remark:** The above formula works for any value of the scalar\n", "$ c $. We don’t have to restrict $ c $ to be in the\n", "set $ (-1,1) $.\n", "\n", "We now move on to describe some famous economic applications of\n", "geometric series." ] }, { "cell_type": "markdown", "id": "bdddca16", "metadata": {}, "source": [ "## Example: The Money Multiplier in Fractional Reserve Banking\n", "\n", "In a fractional reserve banking system, banks hold only a fraction\n", "$ r \\in (0,1) $ of cash behind each **deposit receipt** that they\n", "issue\n", "\n", "- In recent times \n", " - cash consists of pieces of paper issued by the government and\n", " called dollars or pounds or $ \\ldots $ \n", " - a *deposit* is a balance in a checking or savings account that\n", " entitles the owner to ask the bank for immediate payment in cash \n", "- When the UK and France and the US were on either a gold or silver\n", " standard (before 1914, for example) \n", " - cash was a gold or silver coin \n", " - a *deposit receipt* was a *bank note* that the bank promised to\n", " convert into gold or silver on demand; (sometimes it was also a\n", " checking or savings account balance) \n", "\n", "\n", "Economists and financiers often define the **supply of money** as an\n", "economy-wide sum of **cash** plus **deposits**.\n", "\n", "In a **fractional reserve banking system** (one in which the reserve\n", "ratio $ r $ satisfies $ 0 < r < 1 $), **banks create money** by issuing deposits *backed* by fractional reserves plus loans that they make to their customers.\n", "\n", "A geometric series is a key tool for understanding how banks create\n", "money (i.e., deposits) in a fractional reserve system.\n", "\n", "The geometric series formula [(1.1)](#equation-infinite) is at the heart of the classic model of the money creation process – one that leads us to the celebrated\n", "**money multiplier**." ] }, { "cell_type": "markdown", "id": "4020c34d", "metadata": {}, "source": [ "### A Simple Model\n", "\n", "There is a set of banks named $ i = 0, 1, 2, \\ldots $.\n", "\n", "Bank $ i $’s loans $ L_i $, deposits $ D_i $, and\n", "reserves $ R_i $ must satisfy the balance sheet equation (because\n", "**balance sheets balance**):\n", "\n", "\n", "\n", "$$\n", "L_i + R_i = D_i \\tag{1.2}\n", "$$\n", "\n", "The left side of the above equation is the sum of the bank’s **assets**,\n", "namely, the loans $ L_i $ it has outstanding plus its reserves of\n", "cash $ R_i $.\n", "\n", "The right side records bank $ i $’s liabilities,\n", "namely, the deposits $ D_i $ held by its depositors; these are\n", "IOU’s from the bank to its depositors in the form of either checking\n", "accounts or savings accounts (or before 1914, bank notes issued by a\n", "bank stating promises to redeem note for gold or silver on demand).\n", "\n", "Each bank $ i $ sets its reserves to satisfy the equation\n", "\n", "\n", "\n", "$$\n", "R_i = r D_i \\tag{1.3}\n", "$$\n", "\n", "where $ r \\in (0,1) $ is its **reserve-deposit ratio** or **reserve\n", "ratio** for short\n", "\n", "- the reserve ratio is either set by a government or chosen by banks\n", " for precautionary reasons \n", "\n", "\n", "Next we add a theory stating that bank $ i+1 $’s deposits depend\n", "entirely on loans made by bank $ i $, namely\n", "\n", "\n", "\n", "$$\n", "D_{i+1} = L_i \\tag{1.4}\n", "$$\n", "\n", "Thus, we can think of the banks as being arranged along a line with\n", "loans from bank $ i $ being immediately deposited in $ i+1 $\n", "\n", "- in this way, the debtors to bank $ i $ become creditors of\n", " bank $ i+1 $ \n", "\n", "\n", "Finally, we add an *initial condition* about an exogenous level of bank\n", "$ 0 $’s deposits\n", "\n", "$$\n", "D_0 \\ \\text{ is given exogenously}\n", "$$\n", "\n", "We can think of $ D_0 $ as being the amount of cash that a first\n", "depositor put into the first bank in the system, bank number $ i=0 $.\n", "\n", "Now we do a little algebra.\n", "\n", "Combining equations [(1.2)](#equation-balance) and [(1.3)](#equation-reserves) tells us that\n", "\n", "\n", "\n", "$$\n", "L_i = (1-r) D_i \\tag{1.5}\n", "$$\n", "\n", "This states that bank $ i $ loans a fraction $ (1-r) $ of its\n", "deposits and keeps a fraction $ r $ as cash reserves.\n", "\n", "Combining equation [(1.5)](#equation-fraction) with equation [(1.4)](#equation-deposits) tells us that\n", "\n", "$$\n", "D_{i+1} = (1-r) D_i \\ \\text{ for } i \\geq 0\n", "$$\n", "\n", "which implies that\n", "\n", "\n", "\n", "$$\n", "D_i = (1 - r)^i D_0 \\ \\text{ for } i \\geq 0 \\tag{1.6}\n", "$$\n", "\n", "Equation [(1.6)](#equation-geomseries) expresses $ D_i $ as the $ i $ th term in the\n", "product of $ D_0 $ and the geometric series\n", "\n", "$$\n", "1, (1-r), (1-r)^2, \\cdots\n", "$$\n", "\n", "Therefore, the sum of all deposits in our banking system\n", "$ i=0, 1, 2, \\ldots $ is\n", "\n", "\n", "\n", "$$\n", "\\sum_{i=0}^\\infty (1-r)^i D_0 = \\frac{D_0}{1 - (1-r)} = \\frac{D_0}{r} \\tag{1.7}\n", "$$" ] }, { "cell_type": "markdown", "id": "91e47dda", "metadata": {}, "source": [ "### Money Multiplier\n", "\n", "The **money multiplier** is a number that tells the multiplicative\n", "factor by which an exogenous injection of cash into bank $ 0 $ leads\n", "to an increase in the total deposits in the banking system.\n", "\n", "Equation [(1.7)](#equation-sumdeposits) asserts that the **money multiplier** is\n", "$ \\frac{1}{r} $\n", "\n", "- An initial deposit of cash of $ D_0 $ in bank $ 0 $ leads\n", " the banking system to create total deposits of $ \\frac{D_0}{r} $. \n", "- The initial deposit $ D_0 $ is held as reserves, distributed\n", " throughout the banking system according to $ D_0 = \\sum_{i=0}^\\infty R_i $. " ] }, { "cell_type": "markdown", "id": "b43d975c", "metadata": {}, "source": [ "## Example: The Keynesian Multiplier\n", "\n", "The famous economist John Maynard Keynes and his followers created a\n", "simple model intended to determine national income $ y $ in\n", "circumstances in which\n", "\n", "- there are substantial unemployed resources, in particular **excess\n", " supply** of labor and capital \n", "- prices and interest rates fail to adjust to make aggregate **supply\n", " equal demand** (e.g., prices and interest rates are frozen) \n", "- national income is entirely determined by aggregate demand " ] }, { "cell_type": "markdown", "id": "2f4a87a2", "metadata": {}, "source": [ "### Static Version\n", "\n", "An elementary Keynesian model of national income determination consists\n", "of three equations that describe aggregate demand for $ y $ and its\n", "components.\n", "\n", "The first equation is a national income identity asserting that\n", "consumption $ c $ plus investment $ i $ equals national income\n", "$ y $:\n", "\n", "$$\n", "c+ i = y\n", "$$\n", "\n", "The second equation is a Keynesian consumption function asserting that\n", "people consume a fraction $ b \\in (0,1) $ of their income:\n", "\n", "$$\n", "c = b y\n", "$$\n", "\n", "The fraction $ b \\in (0,1) $ is called the **marginal propensity to\n", "consume**.\n", "\n", "The fraction $ 1-b \\in (0,1) $ is called the **marginal propensity\n", "to save**.\n", "\n", "The third equation simply states that investment is exogenous at level\n", "$ i $.\n", "\n", "- *exogenous* means *determined outside this model*. \n", "\n", "\n", "Substituting the second equation into the first gives $ (1-b) y = i $.\n", "\n", "Solving this equation for $ y $ gives\n", "\n", "$$\n", "y = \\frac{1}{1-b} i\n", "$$\n", "\n", "The quantity $ \\frac{1}{1-b} $ is called the **investment\n", "multiplier** or simply the **multiplier**.\n", "\n", "Applying the formula for the sum of an infinite geometric series, we can\n", "write the above equation as\n", "\n", "$$\n", "y = i \\sum_{t=0}^\\infty b^t\n", "$$\n", "\n", "where $ t $ is a nonnegative integer.\n", "\n", "So we arrive at the following equivalent expressions for the multiplier:\n", "\n", "$$\n", "\\frac{1}{1-b} = \\sum_{t=0}^\\infty b^t\n", "$$\n", "\n", "The expression $ \\sum_{t=0}^\\infty b^t $ motivates an interpretation\n", "of the multiplier as the outcome of a dynamic process that we describe\n", "next." ] }, { "cell_type": "markdown", "id": "409cf690", "metadata": {}, "source": [ "### Dynamic Version\n", "\n", "We arrive at a dynamic version by interpreting the nonnegative integer\n", "$ t $ as indexing time and changing our specification of the\n", "consumption function to take time into account\n", "\n", "- we add a one-period lag in how income affects consumption \n", "\n", "\n", "We let $ c_t $ be consumption at time $ t $ and $ i_t $ be\n", "investment at time $ t $.\n", "\n", "We modify our consumption function to assume the form\n", "\n", "$$\n", "c_t = b y_{t-1}\n", "$$\n", "\n", "so that $ b $ is the marginal propensity to consume (now) out of\n", "last period’s income.\n", "\n", "We begin with an initial condition stating that\n", "\n", "$$\n", "y_{-1} = 0\n", "$$\n", "\n", "We also assume that\n", "\n", "$$\n", "i_t = i \\ \\ \\textrm {for all } t \\geq 0\n", "$$\n", "\n", "so that investment is constant over time.\n", "\n", "It follows that\n", "\n", "$$\n", "y_0 = i + c_0 = i + b y_{-1} = i\n", "$$\n", "\n", "and\n", "\n", "$$\n", "y_1 = c_1 + i = b y_0 + i = (1 + b) i\n", "$$\n", "\n", "and\n", "\n", "$$\n", "y_2 = c_2 + i = b y_1 + i = (1 + b + b^2) i\n", "$$\n", "\n", "and more generally\n", "\n", "$$\n", "y_t = b y_{t-1} + i = (1+ b + b^2 + \\cdots + b^t) i\n", "$$\n", "\n", "or\n", "\n", "$$\n", "y_t = \\frac{1-b^{t+1}}{1 -b } i\n", "$$\n", "\n", "Evidently, as $ t \\rightarrow + \\infty $,\n", "\n", "$$\n", "y_t \\rightarrow \\frac{1}{1-b} i\n", "$$\n", "\n", "**Remark 1:** The above formula is often applied to assert that an\n", "exogenous increase in investment of $ \\Delta i $ at time $ 0 $\n", "ignites a dynamic process of increases in national income by successive amounts\n", "\n", "$$\n", "\\Delta i, (1 + b )\\Delta i, (1+b + b^2) \\Delta i , \\cdots\n", "$$\n", "\n", "at times $ 0, 1, 2, \\ldots $.\n", "\n", "**Remark 2** Let $ g_t $ be an exogenous sequence of government\n", "expenditures.\n", "\n", "If we generalize the model so that the national income identity\n", "becomes\n", "\n", "$$\n", "c_t + i_t + g_t = y_t\n", "$$\n", "\n", "then a version of the preceding argument shows that the **government\n", "expenditures multiplier** is also $ \\frac{1}{1-b} $, so that a\n", "permanent increase in government expenditures ultimately leads to an\n", "increase in national income equal to the multiplier times the increase\n", "in government expenditures." ] }, { "cell_type": "markdown", "id": "92e5b0f8", "metadata": {}, "source": [ "## Example: Interest Rates and Present Values\n", "\n", "We can apply our formula for geometric series to study how interest\n", "rates affect values of streams of dollar payments that extend over time.\n", "\n", "We work in discrete time and assume that $ t = 0, 1, 2, \\ldots $\n", "indexes time.\n", "\n", "We let $ r \\in (0,1) $ be a one-period **net nominal interest rate**\n", "\n", "- if the nominal interest rate is $ 5 $ percent,\n", " then $ r= .05 $ \n", "\n", "\n", "A one-period **gross nominal interest rate** $ R $ is defined as\n", "\n", "$$\n", "R = 1 + r \\in (1, 2)\n", "$$\n", "\n", "- if $ r=.05 $, then $ R = 1.05 $ \n", "\n", "\n", "**Remark:** The gross nominal interest rate $ R $ is an **exchange\n", "rate** or **relative price** of dollars at between times $ t $ and\n", "$ t+1 $. The units of $ R $ are dollars at time $ t+1 $ per\n", "dollar at time $ t $.\n", "\n", "When people borrow and lend, they trade dollars now for dollars later or\n", "dollars later for dollars now.\n", "\n", "The price at which these exchanges occur is the gross nominal interest\n", "rate.\n", "\n", "- If I sell $ x $ dollars to you today, you pay me $ R x $\n", " dollars tomorrow. \n", "- This means that you borrowed $ x $ dollars for me at a gross\n", " interest rate $ R $ and a net interest rate $ r $. \n", "\n", "\n", "We assume that the net nominal interest rate $ r $ is fixed over\n", "time, so that $ R $ is the gross nominal interest rate at times\n", "$ t=0, 1, 2, \\ldots $.\n", "\n", "Two important geometric sequences are\n", "\n", "\n", "\n", "$$\n", "1, R, R^2, \\cdots \\tag{1.8}\n", "$$\n", "\n", "and\n", "\n", "\n", "\n", "$$\n", "1, R^{-1}, R^{-2}, \\cdots \\tag{1.9}\n", "$$\n", "\n", "Sequence [(1.8)](#equation-geom1) tells us how dollar values of an investment **accumulate**\n", "through time.\n", "\n", "Sequence [(1.9)](#equation-geom2) tells us how to **discount** future dollars to get their\n", "values in terms of today’s dollars." ] }, { "cell_type": "markdown", "id": "39cbb152", "metadata": {}, "source": [ "### Accumulation\n", "\n", "Geometric sequence [(1.8)](#equation-geom1) tells us how one dollar invested and re-invested\n", "in a project with gross one period nominal rate of return accumulates\n", "\n", "- here we assume that net interest payments are reinvested in the\n", " project \n", "- thus, $ 1 $ dollar invested at time $ 0 $ pays interest\n", " $ r $ dollars after one period, so we have $ r+1 = R $\n", " dollars at time$ 1 $ \n", "- at time $ 1 $ we reinvest $ 1+r =R $ dollars and receive interest\n", " of $ r R $ dollars at time $ 2 $ plus the *principal*\n", " $ R $ dollars, so we receive $ r R + R = (1+r)R = R^2 $\n", " dollars at the end of period $ 2 $ \n", "- and so on \n", "\n", "\n", "Evidently, if we invest $ x $ dollars at time $ 0 $ and\n", "reinvest the proceeds, then the sequence\n", "\n", "$$\n", "x , xR , x R^2, \\cdots\n", "$$\n", "\n", "tells how our account accumulates at dates $ t=0, 1, 2, \\ldots $." ] }, { "cell_type": "markdown", "id": "12a4fb68", "metadata": {}, "source": [ "### Discounting\n", "\n", "Geometric sequence [(1.9)](#equation-geom2) tells us how much future dollars are worth in terms of today’s dollars.\n", "\n", "Remember that the units of $ R $ are dollars at $ t+1 $ per\n", "dollar at $ t $.\n", "\n", "It follows that\n", "\n", "- the units of $ R^{-1} $ are dollars at $ t $ per dollar at $ t+1 $ \n", "- the units of $ R^{-2} $ are dollars at $ t $ per dollar at $ t+2 $ \n", "- and so on; the units of $ R^{-j} $ are dollars at $ t $ per\n", " dollar at $ t+j $ \n", "\n", "\n", "So if someone has a claim on $ x $ dollars at time $ t+j $, it\n", "is worth $ x R^{-j} $ dollars at time $ t $ (e.g., today)." ] }, { "cell_type": "markdown", "id": "4c6e8f57", "metadata": {}, "source": [ "### Application to Asset Pricing\n", "\n", "A **lease** requires a payments stream of $ x_t $ dollars at\n", "times $ t = 0, 1, 2, \\ldots $ where\n", "\n", "$$\n", "x_t = G^t x_0\n", "$$\n", "\n", "where $ G = (1+g) $ and $ g \\in (0,1) $.\n", "\n", "Thus, lease payments increase at $ g $ percent per period.\n", "\n", "For a reason soon to be revealed, we assume that $ G < R $.\n", "\n", "The **present value** of the lease is\n", "\n", "$$\n", "\\begin{aligned} p_0 & = x_0 + x_1/R + x_2/(R^2) + \\ddots \\\\\n", " & = x_0 (1 + G R^{-1} + G^2 R^{-2} + \\cdots ) \\\\\n", " & = x_0 \\frac{1}{1 - G R^{-1}} \\end{aligned}\n", "$$\n", "\n", "where the last line uses the formula for an infinite geometric series.\n", "\n", "Recall that $ R = 1+r $ and $ G = 1+g $ and that $ R > G $\n", "and $ r > g $ and that $ r $ and $ g $ are typically small\n", "numbers, e.g., .05 or .03.\n", "\n", "Use the Taylor series of $ \\frac{1}{1+r} $ about $ r=0 $,\n", "namely,\n", "\n", "$$\n", "\\frac{1}{1+r} = 1 - r + r^2 - r^3 + \\cdots\n", "$$\n", "\n", "and the fact that $ r $ is small to approximate\n", "$ \\frac{1}{1+r} \\approx 1 - r $.\n", "\n", "Use this approximation to write $ p_0 $ as\n", "\n", "$$\n", "\\begin{aligned}\n", " p_0 &= x_0 \\frac{1}{1 - G R^{-1}} \\\\\n", " &= x_0 \\frac{1}{1 - (1+g) (1-r) } \\\\\n", " &= x_0 \\frac{1}{1 - (1+g - r - rg)} \\\\\n", " & \\approx x_0 \\frac{1}{r -g }\n", "\\end{aligned}\n", "$$\n", "\n", "where the last step uses the approximation $ r g \\approx 0 $.\n", "\n", "The approximation\n", "\n", "$$\n", "p_0 = \\frac{x_0 }{r -g }\n", "$$\n", "\n", "is known as the **Gordon formula** for the present value or current\n", "price of an infinite payment stream $ x_0 G^t $ when the nominal\n", "one-period interest rate is $ r $ and when $ r > g $.\n", "\n", "We can also extend the asset pricing formula so that it applies to finite leases.\n", "\n", "Let the payment stream on the lease now be $ x_t $ for $ t= 1,2, \\dots,T $, where again\n", "\n", "$$\n", "x_t = G^t x_0\n", "$$\n", "\n", "The present value of this lease is:\n", "\n", "$$\n", "\\begin{aligned} \\begin{split}p_0&=x_0 + x_1/R + \\dots +x_T/R^T \\\\ &= x_0(1+GR^{-1}+\\dots +G^{T}R^{-T}) \\\\ &= \\frac{x_0(1-G^{T+1}R^{-(T+1)})}{1-GR^{-1}} \\end{split}\\end{aligned}\n", "$$\n", "\n", "Applying the Taylor series to $ R^{-(T+1)} $ about $ r=0 $ we get:\n", "\n", "$$\n", "\\frac{1}{(1+r)^{T+1}}= 1-r(T+1)+\\frac{1}{2}r^2(T+1)(T+2)+\\dots \\approx 1-r(T+1)\n", "$$\n", "\n", "Similarly, applying the Taylor series to $ G^{T+1} $ about $ g=0 $:\n", "\n", "$$\n", "(1+g)^{T+1} = 1+(T+1)g+\\frac{T(T+1)}{2!}g^2+\\frac{(T-1)T(T+1)}{3!}g^3+\\dots \\approx 1+ (T+1)g\n", "$$\n", "\n", "Thus, we get the following approximation:\n", "\n", "$$\n", "p_0 =\\frac{x_0(1-(1+(T+1)g)(1-r(T+1)))}{1-(1-r)(1+g) }\n", "$$\n", "\n", "Expanding:\n", "\n", "$$\n", "\\begin{aligned} p_0 &=\\frac{x_0(1-1+(T+1)^2 rg -r(T+1)+g(T+1))}{1-1+r-g+rg} \\\\&=\\frac{x_0(T+1)((T+1)rg+r-g)}{r-g+rg} \\\\ &\\approx \\frac{x_0(T+1)(r-g)}{r-g}+\\frac{x_0rg(T+1)}{r-g}\\\\ &= x_0(T+1) + \\frac{x_0rg(T+1)}{r-g} \\end{aligned}\n", "$$\n", "\n", "We could have also approximated by removing the second term\n", "$ rgx_0(T+1) $ when $ T $ is relatively small compared to\n", "$ 1/(rg) $ to get $ x_0(T+1) $ as in the finite stream\n", "approximation.\n", "\n", "We will plot the true finite stream present-value and the two\n", "approximations, under different values of $ T $, and $ g $ and $ r $ in Python.\n", "\n", "First we plot the true finite stream present-value after computing it\n", "below" ] }, { "cell_type": "code", "execution_count": null, "id": "7cf60c3f", "metadata": { "hide-output": false }, "outputs": [], "source": [ "# True present value of a finite lease\n", "def finite_lease_pv_true(T, g, r, x_0):\n", " G = (1 + g)\n", " R = (1 + r)\n", " return (x_0 * (1 - G**(T + 1) * R**(-T - 1))) / (1 - G * R**(-1))\n", "# First approximation for our finite lease\n", "\n", "def finite_lease_pv_approx_1(T, g, r, x_0):\n", " p = x_0 * (T + 1) + x_0 * r * g * (T + 1) / (r - g)\n", " return p\n", "\n", "# Second approximation for our finite lease\n", "def finite_lease_pv_approx_2(T, g, r, x_0):\n", " return (x_0 * (T + 1))\n", "\n", "# Infinite lease\n", "def infinite_lease(g, r, x_0):\n", " G = (1 + g)\n", " R = (1 + r)\n", " return x_0 / (1 - G * R**(-1))" ] }, { "cell_type": "markdown", "id": "f6adb5d3", "metadata": {}, "source": [ "Now that we have defined our functions, we can plot some outcomes.\n", "\n", "First we study the quality of our approximations" ] }, { "cell_type": "code", "execution_count": null, "id": "cee076c3", "metadata": { "hide-output": false }, "outputs": [], "source": [ "def plot_function(axes, x_vals, func, args):\n", " axes.plot(x_vals, func(*args), label=func.__name__)\n", "\n", "T_max = 50\n", "\n", "T = np.arange(0, T_max+1)\n", "g = 0.02\n", "r = 0.03\n", "x_0 = 1\n", "\n", "our_args = (T, g, r, x_0)\n", "funcs = [finite_lease_pv_true,\n", " finite_lease_pv_approx_1,\n", " finite_lease_pv_approx_2]\n", " ## the three functions we want to compare\n", "\n", "fig, ax = plt.subplots()\n", "ax.set_title('Finite Lease Present Value $T$ Periods Ahead')\n", "for f in funcs:\n", " plot_function(ax, T, f, our_args)\n", "ax.legend()\n", "ax.set_xlabel('$T$ Periods Ahead')\n", "ax.set_ylabel('Present Value, $p_0$')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "48ce57a7", "metadata": {}, "source": [ "Evidently our approximations perform well for small values of $ T $.\n", "\n", "However, holding $ g $ and r fixed, our approximations deteriorate as $ T $ increases.\n", "\n", "Next we compare the infinite and finite duration lease present values\n", "over different lease lengths $ T $." ] }, { "cell_type": "code", "execution_count": null, "id": "99a51787", "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Convergence of infinite and finite\n", "T_max = 1000\n", "T = np.arange(0, T_max+1)\n", "fig, ax = plt.subplots()\n", "ax.set_title('Infinite and Finite Lease Present Value $T$ Periods Ahead')\n", "f_1 = finite_lease_pv_true(T, g, r, x_0)\n", "f_2 = np.full(T_max+1, infinite_lease(g, r, x_0))\n", "ax.plot(T, f_1, label='T-period lease PV')\n", "ax.plot(T, f_2, '--', label='Infinite lease PV')\n", "ax.set_xlabel('$T$ Periods Ahead')\n", "ax.set_ylabel('Present Value, $p_0$')\n", "ax.legend()\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "243fa10d", "metadata": {}, "source": [ "The graph above shows how as duration $ T \\rightarrow +\\infty $,\n", "the value of a lease of duration $ T $ approaches the value of a\n", "perpetual lease.\n", "\n", "Now we consider two different views of what happens as $ r $ and\n", "$ g $ covary" ] }, { "cell_type": "code", "execution_count": null, "id": "50bcb467", "metadata": { "hide-output": false }, "outputs": [], "source": [ "# First view\n", "# Changing r and g\n", "fig, ax = plt.subplots()\n", "ax.set_title('Value of lease of length $T$')\n", "ax.set_ylabel('Present Value, $p_0$')\n", "ax.set_xlabel('$T$ periods ahead')\n", "T_max = 10\n", "T=np.arange(0, T_max+1)\n", "\n", "rs, gs = (0.9, 0.5, 0.4001, 0.4), (0.4, 0.4, 0.4, 0.5),\n", "comparisons = ('$\\gg$', '$>$', r'$\\approx$', '$<$')\n", "for r, g, comp in zip(rs, gs, comparisons):\n", " ax.plot(finite_lease_pv_true(T, g, r, x_0), label=f'r(={r}) {comp} g(={g})')\n", "\n", "ax.legend()\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "1038eb82", "metadata": {}, "source": [ "This graph gives a big hint for why the condition $ r > g $ is\n", "necessary if a lease of length $ T = +\\infty $ is to have finite\n", "value.\n", "\n", "For fans of 3-d graphs the same point comes through in the following\n", "graph.\n", "\n", "If you aren’t enamored of 3-d graphs, feel free to skip the next\n", "visualization!" ] }, { "cell_type": "code", "execution_count": null, "id": "bfe33819", "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Second view\n", "fig = plt.figure()\n", "T = 3\n", "ax = plt.subplot(projection='3d')\n", "r = np.arange(0.01, 0.99, 0.005)\n", "g = np.arange(0.011, 0.991, 0.005)\n", "\n", "rr, gg = np.meshgrid(r, g)\n", "z = finite_lease_pv_true(T, gg, rr, x_0)\n", "\n", "# Removes points where undefined\n", "same = (rr == gg)\n", "z[same] = np.nan\n", "surf = ax.plot_surface(rr, gg, z, cmap=cm.coolwarm,\n", " antialiased=True, clim=(0, 15))\n", "fig.colorbar(surf, shrink=0.5, aspect=5)\n", "ax.set_xlabel('$r$')\n", "ax.set_ylabel('$g$')\n", "ax.set_zlabel('Present Value, $p_0$')\n", "ax.view_init(20, 10)\n", "ax.set_title('Three Period Lease PV with Varying $g$ and $r$')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "4666f78a", "metadata": {}, "source": [ "We can use a little calculus to study how the present value $ p_0 $\n", "of a lease varies with $ r $ and $ g $.\n", "\n", "We will use a library called [SymPy](https://www.sympy.org/).\n", "\n", "SymPy enables us to do symbolic math calculations including\n", "computing derivatives of algebraic equations.\n", "\n", "We will illustrate how it works by creating a symbolic expression that\n", "represents our present value formula for an infinite lease.\n", "\n", "After that, we’ll use SymPy to compute derivatives" ] }, { "cell_type": "code", "execution_count": null, "id": "6431e0c5", "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Creates algebraic symbols that can be used in an algebraic expression\n", "g, r, x0 = sym.symbols('g, r, x0')\n", "G = (1 + g)\n", "R = (1 + r)\n", "p0 = x0 / (1 - G * R**(-1))\n", "init_printing(use_latex='mathjax')\n", "print('Our formula is:')\n", "p0" ] }, { "cell_type": "code", "execution_count": null, "id": "eda8fc94", "metadata": { "hide-output": false }, "outputs": [], "source": [ "print('dp0 / dg is:')\n", "dp_dg = sym.diff(p0, g)\n", "dp_dg" ] }, { "cell_type": "code", "execution_count": null, "id": "c0247d24", "metadata": { "hide-output": false }, "outputs": [], "source": [ "print('dp0 / dr is:')\n", "dp_dr = sym.diff(p0, r)\n", "dp_dr" ] }, { "cell_type": "markdown", "id": "0c48a95f", "metadata": {}, "source": [ "We can see that for $ \\frac{\\partial p_0}{\\partial r}<0 $ as long as\n", "$ r>g $, $ r>0 $ and $ g>0 $ and $ x_0 $ is positive,\n", "so $ \\frac{\\partial p_0}{\\partial r} $ will always be negative.\n", "\n", "Similarly, $ \\frac{\\partial p_0}{\\partial g}>0 $ as long as $ r>g $, $ r>0 $ and $ g>0 $ and $ x_0 $ is positive, so $ \\frac{\\partial p_0}{\\partial g} $\n", "will always be positive." ] }, { "cell_type": "markdown", "id": "416e0611", "metadata": {}, "source": [ "## Back to the Keynesian Multiplier\n", "\n", "We will now go back to the case of the Keynesian multiplier and plot the\n", "time path of $ y_t $, given that consumption is a constant fraction\n", "of national income, and investment is fixed." ] }, { "cell_type": "code", "execution_count": null, "id": "5934eb95", "metadata": { "hide-output": false }, "outputs": [], "source": [ "# Function that calculates a path of y\n", "def calculate_y(i, b, g, T, y_init):\n", " y = np.zeros(T+1)\n", " y[0] = i + b * y_init + g\n", " for t in range(1, T+1):\n", " y[t] = b * y[t-1] + i + g\n", " return y\n", "\n", "# Initial values\n", "i_0 = 0.3\n", "g_0 = 0.3\n", "# 2/3 of income goes towards consumption\n", "b = 2/3\n", "y_init = 0\n", "T = 100\n", "\n", "fig, ax = plt.subplots()\n", "ax.set_title('Path of Aggregate Output Over Time')\n", "ax.set_xlabel('$t$')\n", "ax.set_ylabel('$y_t$')\n", "ax.plot(np.arange(0, T+1), calculate_y(i_0, b, g_0, T, y_init))\n", "# Output predicted by geometric series\n", "ax.hlines(i_0 / (1 - b) + g_0 / (1 - b), xmin=-1, xmax=101, linestyles='--')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "be043905", "metadata": {}, "source": [ "In this model, income grows over time, until it gradually converges to\n", "the infinite geometric series sum of income.\n", "\n", "We now examine what will\n", "happen if we vary the so-called **marginal propensity to consume**,\n", "i.e., the fraction of income that is consumed" ] }, { "cell_type": "code", "execution_count": null, "id": "260dab1d", "metadata": { "hide-output": false }, "outputs": [], "source": [ "bs = (1/3, 2/3, 5/6, 0.9)\n", "\n", "fig,ax = plt.subplots()\n", "ax.set_title('Changing Consumption as a Fraction of Income')\n", "ax.set_ylabel('$y_t$')\n", "ax.set_xlabel('$t$')\n", "x = np.arange(0, T+1)\n", "for b in bs:\n", " y = calculate_y(i_0, b, g_0, T, y_init)\n", " ax.plot(x, y, label=r'$b=$'+f\"{b:.2f}\")\n", "ax.legend()\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "ccd92e2d", "metadata": {}, "source": [ "Increasing the marginal propensity to consume $ b $ increases the\n", "path of output over time.\n", "\n", "Now we will compare the effects on output of increases in investment and government spending." ] }, { "cell_type": "code", "execution_count": null, "id": "dcfe2cd5", "metadata": { "hide-output": false }, "outputs": [], "source": [ "fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(6, 10))\n", "fig.subplots_adjust(hspace=0.3)\n", "\n", "x = np.arange(0, T+1)\n", "values = [0.3, 0.4]\n", "\n", "for i in values:\n", " y = calculate_y(i, b, g_0, T, y_init)\n", " ax1.plot(x, y, label=f\"i={i}\")\n", "for g in values:\n", " y = calculate_y(i_0, b, g, T, y_init)\n", " ax2.plot(x, y, label=f\"g={g}\")\n", "\n", "axes = ax1, ax2\n", "param_labels = \"Investment\", \"Government Spending\"\n", "for ax, param in zip(axes, param_labels):\n", " ax.set_title(f'An Increase in {param} on Output')\n", " ax.legend(loc =\"lower right\")\n", " ax.set_ylabel('$y_t$')\n", " ax.set_xlabel('$t$')\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "7bd3927c", "metadata": {}, "source": [ "Notice here, whether government spending increases from 0.3 to 0.4 or\n", "investment increases from 0.3 to 0.4, the shifts in the graphs are\n", "identical." ] } ], "metadata": { "date": 1710733971.654462, "filename": "geom_series.md", "kernelspec": { "display_name": "Python", "language": "python3", "name": "python3" }, "title": "Geometric Series for Elementary Economics" }, "nbformat": 4, "nbformat_minor": 5 }