diff --git a/lectures/intro_supply_demand.md b/lectures/intro_supply_demand.md index 16090615..2364a9dc 100644 --- a/lectures/intro_supply_demand.md +++ b/lectures/intro_supply_demand.md @@ -21,12 +21,6 @@ Throughout the lecture, we focus on models with one good and one price. ({doc}`Later ` we will investigate settings with many goods.) -We shall describe two classic welfare theorems: - -* **first welfare theorem:** for a given a distribution of wealth among consumers, a competitive equilibrium allocation of goods solves a social planning problem. - -* **second welfare theorem:** An allocation of goods to consumers that solves a social planning problem can be supported by a competitive equilibrium with an appropriate initial distribution of wealth. - Key infrastructure concepts that we'll encounter in this lecture are * inverse demand curves @@ -37,13 +31,30 @@ Key infrastructure concepts that we'll encounter in this lecture are * social welfare as a sum of consumer and producer surpluses * competitive equilibrium -We will use the following imports. + +We will provide a version of the [first fundamental welfare theorem](https://en.wikipedia.org/wiki/Fundamental_theorems_of_welfare_economics), which was formulated by + +* [Leon Walras](https://en.wikipedia.org/wiki/L%C3%A9on_Walras) +* [Francis Ysidro Edgeworth](https://en.wikipedia.org/wiki/Francis_Ysidro_Edgeworth) +* [Vilfredo Pareto](https://en.wikipedia.org/wiki/Vilfredo_Pareto) + +Important extensions to the key ideas were obtained by + +* [Abba Lerner](https://en.wikipedia.org/wiki/Abba_P._Lerner) +* [Harold Hotelling](https://en.wikipedia.org/wiki/Harold_Hotelling) +* [Paul Samuelson](https://en.wikipedia.org/wiki/Paul_Samuelson) +* [Kenneth Arrow](https://en.wikipedia.org/wiki/Kenneth_Arrow) +* [Gerard Debreu](https://en.wikipedia.org/wiki/G%C3%A9rard_Debreu) + + +In our exposition we will use the following imports. ```{code-cell} ipython3 import numpy as np import matplotlib.pyplot as plt ``` + ## Supply and Demand We study a market for a single good in which buyers and sellers exchange a quantity $q$ for a price $p$. @@ -53,53 +64,252 @@ Quantity $q$ and price $p$ are both scalars. We assume that inverse demand and supply curves for the good are: $$ -p = d_0 - d_1 q, \quad d_0, d_1 > 0 + p = d_0 - d_1 q, \quad d_0, d_1 > 0 $$ $$ -p = s_0 + s_1 q , \quad s_0, s_1 > 0 + p = s_0 + s_1 q , \quad s_0, s_1 > 0 $$ We call them inverse demand and supply curves because price is on the left side of the equation rather than on the right side as it would be in a direct demand or supply function. -### Surpluses and Welfare -We define **consumer surplus** as the area under an inverse demand curve minus $p q$: + +Here is a class that stores parameters for our single good market, as well as +implementing the inverse demand and supply curves. + +```{code-cell} ipython3 +class Market: + + def __init__(self, + d_0=1.0, # demand intercept + d_1=0.6, # demand slope + s_0=0.1, # supply intercept + s_1=0.4): # supply slope + + self.d_0, self.d_1 = d_0, d_1 + self.s_0, self.s_1 = s_0, s_1 + + def inverse_demand(self, q): + return self.d_0 - self.d_1 * q + + def inverse_supply(self, q): + return self.s_0 + self.s_1 * q + +``` + +Let's create an instance. + +```{code-cell} ipython3 +market = Market() +``` + + +Here is a plot of these two functions using `market`. + +```{code-cell} ipython3 +:tags: [hide-input] +market = Market() + +grid_min, grid_max, grid_size = 0, 1.5, 200 +q_grid = np.linspace(grid_min, grid_max, grid_size) +supply_curve = market.inverse_supply(q_grid) +demand_curve = market.inverse_demand(q_grid) + +fig, ax = plt.subplots() +ax.plot(q_grid, supply_curve, label='supply') +ax.plot(q_grid, demand_curve, label='demand') +ax.legend(loc='upper center', frameon=False) +ax.set_ylim(0, 1.2) +ax.set_xticks((0, 1)) +ax.set_yticks((0, 1)) +ax.set_xlabel('quantity') +ax.set_ylabel('price') +plt.show() +``` + + + +### Consumer Surplus + +Let a quantity $q$ be given and let $p := d_0 - d_1 q$ be the +corresponding price on the inverse demand curve. + +We define **consumer surplus** $S_c(q)$ as the area under an inverse demand +curve minus $p q$: + +$$ + S_c(q) := + \int_0^{q} (d_0 - d_1 x) dx - p q +$$ + +The next figure illustrates + + +```{code-cell} ipython3 +:tags: [hide-input] + +q = 1.25 +p = market.inverse_demand(q) +ps = np.ones_like(q_grid) * p + +fig, ax = plt.subplots() +ax.plot(q_grid, demand_curve, label='demand') +ax.fill_between(q_grid[q_grid <= q], + demand_curve[q_grid<=q], + ps[q_grid <= q], + label='consumer surplus', + color='#EED1CF') +ax.vlines(q, 0, p, linestyle="dashed", color='black', alpha=0.7) +ax.hlines(p, 0, q, linestyle="dashed", color='black', alpha=0.7) + +ax.legend(loc='upper center', frameon=False) +ax.set_ylim(0, 1.2) +ax.set_xticks((q,)) +ax.set_xticklabels(("$q$",)) +ax.set_yticks((p,)) +ax.set_yticklabels(("$p$",)) +ax.set_xlabel('quantity') +ax.set_ylabel('price') +plt.show() +``` + + +Consumer surplus gives a measure of total consumer welfare at quantity $q$. + +The idea is that the inverse demand curve $d_0 - d_1 q$ shows willingness to +pay at a given quantity $q$. + +The difference between willingness to pay and the actual price is the surplus. + +The value $S_c(q)$ is the "sum" (i.e., integral) of these surpluses when the total +quantity purchased is $q$ and the purchase price is $p$. + +Evaluating the integral in the definition of consumer surplus gives + +$$ + S_c(q) + = d_0 q - \frac{1}{2} d_1 q^2 - p q +$$ + + + + +### Producer Surplus + +Let a quantity $q$ be given and let $p := s_0 + s_1 q$ be the +corresponding price on the inverse supply curve. + + +We define **producer surplus** as $p q$ minus the area under an inverse supply curve $$ -\int_0^q (d_0 - d_1 x) dx - pq = d_0 q -.5 d_1 q^2 - pq + S_p(q) + := p q - \int_0^q (s_0 + s_1 x) dx $$ -We define **producer surplus** as $p q$ minus the area under an inverse supply curve: +The next figure illustrates + +```{code-cell} ipython3 +:tags: [hide-input] + +q = 0.75 +p = market.inverse_supply(q) +ps = np.ones_like(q_grid) * p + +fig, ax = plt.subplots() +ax.plot(q_grid, supply_curve, label='supply') +ax.fill_between(q_grid[q_grid <= q], + supply_curve[q_grid<=q], + ps[q_grid <= q], + label='producer surplus', + color='#E6E6F5') +ax.vlines(q, 0, p, linestyle="dashed", color='black', alpha=0.7) +ax.hlines(p, 0, q, linestyle="dashed", color='black', alpha=0.7) + +ax.legend(loc='upper center', frameon=False) +ax.set_ylim(0, 1.2) +ax.set_xticks((q,)) +ax.set_xticklabels(("$q$",)) +ax.set_yticks((p,)) +ax.set_yticklabels(("$p$",)) +ax.set_xlabel('quantity') +ax.set_ylabel('price') +plt.show() +``` + +Producer surplus measures total producer welfare at quantity $q$ + +The idea is similar to that of consumer surplus. + +The inverse supply curve $s_0 + s_1 q$ shows the price at which producers are +prepared to sell, given quantity $q$. + +The difference between willingness to sell and the actual price is the surplus. + +The value $S_p(q)$ is the integral of these surpluses. + +Evaluating the integral in the definition of consumer surplus gives $$ -p q - \int_0^q (s_0 + s_1 x) dx = pq - s_0 q - .5 s_1 q^2 + S_p(q) = pq - s_0 q - \frac{1}{2} s_1 q^2 $$ -Sometimes economists measure social welfare by a **welfare criterion** that equals consumer surplus plus producer surplus + +### Social Welfare + +Sometimes economists measure social welfare by a **welfare criterion** that +equals consumer surplus plus producer surplus, assuming that consumers and +producers pay the same price: $$ -\int_0^q (d_0 - d_1 x) dx - \int_0^q (s_0 + s_1 x) dx \equiv \textrm{Welf} + W(q) + = \int_0^q (d_0 - d_1 x) dx - \int_0^q (s_0 + s_1 x) dx $$ -or +Evaluating the integrals gives $$ -\textrm{Welf} = (d_0 - s_0) q - .5 (d_1 + s_1) q^2 + W(q) = (d_0 - s_0) q - \frac{1}{2} (d_1 + s_1) q^2 $$ -To compute a quantity that maximizes welfare criterion $\textrm{Welf}$, we differentiate $\textrm{Welf}$ with respect to $q$ and then set the derivative to zero. +Here is a Python function that evaluates this social welfare at a given +quantity $q$ and a fixed set of parameters. -We get +```{code-cell} ipython3 +def W(q, market): + # Unpack + d_0, d_1, s_0, s_1 = market.d_0, market.d_1, market.s_0, market.s_1 + # Compute and return welfare + return (d_0 - s_0) * q - 0.5 * (d_1 + s_1) * q**2 +``` + +The next figure plots welfare as a function of $q$. + + +```{code-cell} ipython3 +:tags: [hide-input] +q_vals = np.linspace(0, 1.78, 200) +fig, ax = plt.subplots() +ax.plot(q_vals, W(q_vals, market), label='welfare') +ax.legend(frameon=False) +ax.set_xlabel('quantity') +plt.show() +``` + +Let's now give a social planner the task of maximizing social welfare. + +To compute a quantity that maximizes the welfare criterion, we differentiate +$W$ with respect to $q$ and then set the derivative to zero. $$ -\frac{d \textrm{Welf}}{d q} = d_0 - s_0 - (d_1 + s_1) q = 0 + \frac{d W(q)}{d q} = d_0 - s_0 - (d_1 + s_1) q = 0 $$ -which implies +Solving for $q$ yields $$ -q = \frac{ d_0 - s_0}{s_1 + d_1} + q = \frac{ d_0 - s_0}{s_1 + d_1} $$ (eq:old1) Let's remember the quantity $q$ given by equation {eq}`eq:old1` that a social planner would choose to maximize consumer plus producer surplus. @@ -107,50 +317,101 @@ Let's remember the quantity $q$ given by equation {eq}`eq:old1` that a social pl We'll compare it to the quantity that emerges in a competitive equilibrium equilibrium that equates supply to demand. + + ### Competitive Equilibrium -Instead of equating quantities supplied and demanded, we'll can accomplish the same thing by equating demand price to supply price: +Instead of equating quantities supplied and demanded, we'll can accomplish the +same thing by equating demand price to supply price: $$ -p = d_0 - d_1 q = s_0 + s_1 q , + p = d_0 - d_1 q = s_0 + s_1 q +$$ + +If we solve the equation defined by the second equality in the above line for +$q$, we obtain + $$ + q = \frac{ d_0 - s_0}{s_1 + d_1} +$$ (eq:equilib_q) -+++ -It we solve the equation defined by the second equality in the above line for $q$, we obtain the -competitive equilibrium quantity; it equals the same $q$ given by equation {eq}`eq:old1`. +This is the competitive equilibrium quantity. + +Observe that the equilibrium quantity equals the same $q$ given by equation {eq}`eq:old1`. The outcome that the quantity determined by equation {eq}`eq:old1` equates supply to demand brings us a **key finding:** -* a competitive equilibrium quantity maximizes our welfare criterion +* a competitive equilibrium quantity maximizes our welfare criterion + +This is a version of the [first fundamental welfare theorem](https://en.wikipedia.org/wiki/Fundamental_theorems_of_welfare_economics), It also brings a useful **competitive equilibrium computation strategy:** -* after solving the welfare problem for an optimal quantity, we can read a competitive equilibrium price from either supply price or demand price at the competitive equilibrium quantity +* after solving the welfare problem for an optimal quantity, we can read a + competitive equilibrium price from either supply price or demand price at + the competitive equilibrium quantity -### Generalizations -In later lectures, we'll derive generalizations of the above demand and -supply curves from other objects. +## Generalizations + +In a {doc}`later lecture `, we'll derive +generalizations of the above demand and supply curves from other objects. Our generalizations will extend the preceding analysis of a market for a single good to the analysis of $n$ simultaneous markets in $n$ goods. In addition - * we'll derive **demand curves** from a consumer problem that maximizes a **utility function** subject to a **budget constraint**. + * we'll derive **demand curves** from a consumer problem that maximizes a + **utility function** subject to a **budget constraint**. + + * we'll derive **supply curves** from the problem of a producer who is price + taker and maximizes his profits minus total costs that are described by a + **cost function**. + +## Exercises - * we'll derive **supply curves** from the problem of a producer who is price taker and maximizes his profits minus total costs that are described by a **cost function**. +Suppose now that the inverse demand and supply curves are modified to take the +form + +$$ + p = i_d(q) := d_0 - d_1 q^{0.6} +$$ + +$$ + p = i_s(q) := s_0 + s_1 q^{1.2} +$$ -## Code +All parameters are positive, as before. + + + + +```{exercise} +:label: isd_ex1 + +Define a new `Market` class that holds the same parameter values as before by +changes the `inverse_demand` and `inverse_supply` methods to +match these new definitions. + +Using the class, plot the inverse demand and supply curves $i_d$ and $i_s$ + +``` + + + +```{solution-start} isd_ex1 +:class: dropdown +``` ```{code-cell} ipython3 -class SingleGoodMarket: +class Market: def __init__(self, d_0=1.0, # demand intercept - d_1=0.5, # demand slope + d_1=0.6, # demand slope s_0=0.1, # supply intercept s_1=0.4): # supply slope @@ -158,66 +419,209 @@ class SingleGoodMarket: self.s_0, self.s_1 = s_0, s_1 def inverse_demand(self, q): - return self.d_0 - self.d_1 * q + return self.d_0 - self.d_1 * q**0.6 def inverse_supply(self, q): - return self.s_0 + self.s_1 * q + return self.s_0 + self.s_1 * q**1.8 + +``` - def equilibrium_quantity(self): - return (self.d_0 - self.s_0) / (self.d_1 + self.s_1) +Let's create an instance. - def equilibrium_price(self): - q = self.equilibrium_quantity() - return self.s_0 + self.s_1 * q +```{code-cell} ipython3 +market = Market() ``` + +Here is a plot of inverse supply and demand. + ```{code-cell} ipython3 -def plot_supply_demand(market): +:tags: [hide-input] + +grid_min, grid_max, grid_size = 0, 1.5, 200 +q_grid = np.linspace(grid_min, grid_max, grid_size) +supply_curve = market.inverse_supply(q_grid) +demand_curve = market.inverse_demand(q_grid) + +fig, ax = plt.subplots() +ax.plot(q_grid, supply_curve, label='supply') +ax.plot(q_grid, demand_curve, label='demand') +ax.legend(loc='upper center', frameon=False) +ax.set_ylim(0, 1.2) +ax.set_xticks((0, 1)) +ax.set_yticks((0, 1)) +ax.set_xlabel('quantity') +ax.set_ylabel('price') +plt.show() +``` + + +```{solution-end} +``` + + +```{exercise} +:label: isd_ex2 + + +As before, consumer surplus at $q$ is the area under the demand curve minus +price times quantity: + +$$ + S_c(q) = \int_0^{q} i_d(x) dx - p q +$$ + +Here $p$ is set to $i_d(q)$ + +Producer surplus is price times quantity minus the area under the inverse +supply curve: + +$$ + S_p(q) + = p q - \int_0^q i_s(x) dx +$$ + +Here $p$ is set to $i_s(q)$. + +Social welfare is the sum of consumer and producer surplus under the +assumption that the price is the same for buyers and sellers: + +$$ + W(q) + = \int_0^q i_d(x) dx - \int_0^q i_q(x) dx +$$ + +Solve the integrals and write a function to compute this quantity numerically +at given $q$. + +Plot welfare as a function of $q$. + +``` + + + +```{solution-start} isd_ex2 +:class: dropdown +``` + +Solving the integrals gives + +$$ + W(q) + = d_0 q - \frac{d_1 q^{1.6}}{1.6} + - \left( s_0 q + \frac{s_1 q^{2.8}}{2.8} \right) +$$ + +Here's a Python function that computes this value: + + +```{code-cell} ipython3 +def W(q, market): # Unpack - d_0, d_1 = market.d_0, market.d_1 - s_0, s_1 = market.s_0, market.s_1 - q = market.equilibrium_quantity() - p = market.equilibrium_price() - grid_size = 200 - x_grid = np.linspace(0, 2 * q, grid_size) - ps = np.ones_like(x_grid) * p - supply_curve = market.inverse_supply(x_grid) - demand_curve = market.inverse_demand(x_grid) + d_0, d_1, s_0, s_1 = market.d_0, market.d_1, market.s_0, market.s_1 + # Compute and return welfare + S_c = d_0 * q - d_1 * q**1.6 / 1.6 + S_p = s_0 * q + s_1 * q**2.8 / 2.8 + return S_c - S_p +``` + +The next figure plots welfare as a function of $q$. + + +```{code-cell} ipython3 +fig, ax = plt.subplots() +ax.plot(q_vals, W(q_vals, market), label='welfare') +ax.legend(frameon=False) +ax.set_xlabel('quantity') +plt.show() +``` + +```{solution-end} +``` - fig, ax = plt.subplots() - ax.plot(x_grid, supply_curve, label='Supply', color='#020060') - ax.plot(x_grid, demand_curve, label='Demand', color='#600001') - ax.fill_between(x_grid[x_grid <= q], - demand_curve[x_grid<=q], - ps[x_grid <= q], - label='Consumer surplus', - color='#EED1CF') - ax.fill_between(x_grid[x_grid <= q], - supply_curve[x_grid <= q], - ps[x_grid <= q], - label='Producer surplus', - color='#E6E6F5') +```{exercise} +:label: isd_ex3 - ax.vlines(q, 0, p, linestyle="dashed", color='black', alpha=0.7) - ax.hlines(p, 0, q, linestyle="dashed", color='black', alpha=0.7) - ax.legend(loc='upper center', frameon=False) - ax.margins(x=0, y=0) - ax.set_ylim(0) - ax.set_xlabel('Quantity') - ax.set_ylabel('Price') +Due to nonlinearities, the new welfare function is not easy to maximize with +pencil and paper. + +Maximize it using `scipy.optimize.minimize_scalar` instead. - plt.show() +``` + + + +```{solution-start} isd_ex3 +:class: dropdown ``` ```{code-cell} ipython3 -market = SingleGoodMarket() +from scipy.optimize import minimize_scalar + +def objective(q): + return -W(q, market) + +result = minimize_scalar(objective, bounds=(0, 10)) +print(result.message) ``` + + ```{code-cell} ipython3 -plot_supply_demand(market) +maximizing_q = result.x +print(f"{maximizing_q: .5f}") +``` + +```{solution-end} +``` + + + +```{exercise} +:label: isd_ex4 + +Now compute the equilibrium quantity by finding the price that equates supply +and demand. + +You can do this numerically by finding the root of the excess demand function + +$$ + e_d(q) := i_d(q) - i_s(q) +$$ + +You can use `scipy.optimize.newton` to compute the root. + +Initialize `newton` with a starting guess somewhere close to 1.0. + +(Similar initial conditions will give the same result.) + +You should find that the equilibrium price agrees with the welfare maximizing +price, in line with the first fundamental welfare theorem. + +``` + + + +```{solution-start} isd_ex3 +:class: dropdown +``` + + +```{code-cell} ipython3 +from scipy.optimize import newton + +def excess_demand(q): + return market.inverse_demand(q) - market.inverse_supply(q) + +equilibrium_q = newton(excess_demand, 0.1) +print(f"{equilibrium_q: .5f}") +``` + + +```{solution-end} ``` diff --git a/lectures/supply_demand_multiple_goods.md b/lectures/supply_demand_multiple_goods.md index 545ca575..7841e43e 100644 --- a/lectures/supply_demand_multiple_goods.md +++ b/lectures/supply_demand_multiple_goods.md @@ -2,7 +2,16 @@ ## Overview -We study a setting with $n$ goods and $n$ corresponding prices. +In a {doc}`previous lecture ` we studied supply, demand +and welfare in a market with just one good. + +In this lecture, we study a setting with $n$ goods and $n$ corresponding prices. + +We shall describe two classic welfare theorems: + +* **first welfare theorem:** for a given a distribution of wealth among consumers, a competitive equilibrium allocation of goods solves a social planning problem. + +* **second welfare theorem:** An allocation of goods to consumers that solves a social planning problem can be supported by a competitive equilibrium with an appropriate initial distribution of wealth. @@ -30,30 +39,35 @@ $$ ## From utility function to demand curve -Let +Our study of consumers will use the following primitives * $\Pi$ be an $m \times n$ matrix, -* $c$ be an $n \times 1$ vector of consumptions of various goods, * $b$ be an $m \times 1$ vector of bliss points, * $e$ be an $n \times 1$ vector of endowments, and -* $p$ be an $n \times 1$ vector of prices -We assume that $\Pi$ has linearly independent columns, which implies that $\Pi^\top \Pi$ is a positive definite matrix. -* it follows that $\Pi^\top \Pi$ has an inverse. +We will analyze endogenous objects $c$ and $p$, where + +* $c$ is an $n \times 1$ vector of consumptions of various goods, +* $p$ is an $n \times 1$ vector of prices + The matrix $\Pi$ describes a consumer's willingness to substitute one good for every other good. -We shall see below that $(\Pi^T \Pi)^{-1}$ is a matrix of slopes of (compensated) demand curves for $c$ with respect to a vector of prices: +We assume that $\Pi$ has linearly independent columns, which implies that $\Pi^\top \Pi$ is a positive definite matrix. + +* it follows that $\Pi^\top \Pi$ has an inverse. + +We shall see below that $(\Pi^\top \Pi)^{-1}$ is a matrix of slopes of (compensated) demand curves for $c$ with respect to a vector of prices: $$ - \frac{\partial c } {\partial p} = (\Pi^T \Pi)^{-1} + \frac{\partial c } {\partial p} = (\Pi^\top \Pi)^{-1} $$ A consumer faces $p$ as a price taker and chooses $c$ to maximize the utility function $$ - -.5 (\Pi c -b) ^\top (\Pi c -b ) + - \frac{1}{2} (\Pi c -b) ^\top (\Pi c -b ) $$ (eq:old0) subject to the budget constraint @@ -62,15 +76,16 @@ $$ p^\top (c -e ) = 0 $$ (eq:old2) -We shall specify examples in which $\Pi$ and $b$ are such that it typically happens that +We shall specify examples in which $\Pi$ and $b$ are such that $$ - \Pi c < < b + \Pi c \ll b $$ (eq:bversusc) -so that utility function {eq}`eq:old2` tells us that the consumer has much less of each good than he wants. +This means that the consumer has much less of each good than he wants. + +The deviation in {eq}`eq:bversusc` will ultimately assure us that competitive equilibrium prices are positive. -Condition {eq}`eq:bversusc` will ultimately assure us that competitive equilibrium prices are positive. ### Demand Curve Implied by Constrained Utility Maximization @@ -78,9 +93,11 @@ For now, we assume that the budget constraint is {eq}`eq:old2`. So we'll be deriving what is known as a **Marshallian** demand curve. +Our aim is to maximize [](eq:old0) subject to [](eq:old2). + Form a Lagrangian -$$ L = -.5 (\Pi c -b) ^\top (\Pi c -b ) + \mu [p^\top (e-c)] $$ +$$ L = - \frac{1}{2} (\Pi c -b)^\top (\Pi c -b ) + \mu [p^\top (e-c)] $$ where $\mu$ is a Lagrange multiplier that is often called a **marginal utility of wealth**. @@ -107,8 +124,13 @@ $$ (eq:old4) Equation {eq}`eq:old4` tells how marginal utility of wealth depends on the endowment vector $e$ and the price vector $p$. -**Remark:** Equation {eq}`eq:old4` is a consequence of imposing that $p^\top (c - e) = 0$. We could instead take $\mu$ as a parameter and use {eq}`eq:old3` and the budget constraint {eq}`eq:old2p` to solve for $W.$ Which way we proceed determines whether we are constructing a **Marshallian** or **Hicksian** demand curve. +```{note} +Equation {eq}`eq:old4` is a consequence of imposing that $p^\top (c - e) = 0$. + +We could instead take $\mu$ as a parameter and use {eq}`eq:old3` and the budget constraint {eq}`eq:old2p` to solve for wealth. +Which way we proceed determines whether we are constructing a **Marshallian** or **Hicksian** demand curve. +``` ## Endowment economy @@ -134,52 +156,63 @@ This amounts to choosing a common unit (or numeraire) in which prices of all go We'll set $\mu=1$. -**Exercise:** Verify that setting $\mu=1$ in {eq}`eq:old3` implies that formula {eq}`eq:old4` is satisfied. +```{exercise} +:label: sdm_ex1 -**Exercise:** Verify that setting $\mu=2$ in {eq}`eq:old3` also implies that formula {eq}`eq:old4` is satisfied. +Verify that setting $\mu=1$ in {eq}`eq:old3` implies that formula {eq}`eq:old4` is satisfied. + +``` + +```{exercise} +:label: sdm_ex2 + +Verify that setting $\mu=2$ in {eq}`eq:old3` also implies that formula +{eq}`eq:old4` is satisfied. + +``` ## Digression: Marshallian and Hicksian Demand Curves -**Remark:** Sometimes we'll use budget constraint {eq}`eq:old2` in situations in which a consumers's endowment vector $e$ is his **only** source of income. Other times we'll instead assume that the consumer has another source of income (positive or negative) and write his budget constraint as +Sometimes we'll use budget constraint {eq}`eq:old2` in situations in which a consumers's endowment vector $e$ is his **only** source of income. + +Other times we'll instead assume that the consumer has another source of income (positive or negative) and write his budget constraint as $$ -p ^\top (c -e ) = W +p ^\top (c -e ) = w $$ (eq:old2p) -where $W$ is measured in "dollars" (or some other **numeraire**) and component $p_i$ of the price vector is measured in dollars per unit of good $i$. +where $w$ is measured in "dollars" (or some other **numeraire**) and component $p_i$ of the price vector is measured in dollars per unit of good $i$. -Whether the consumer's budget constraint is {eq}`eq:old2` or {eq}`eq:old2p` and whether we take $W$ as a free parameter or instead as an endogenous variable will affect the consumer's marginal utility of wealth. +Whether the consumer's budget constraint is {eq}`eq:old2` or {eq}`eq:old2p` and whether we take $w$ as a free parameter or instead as an endogenous variable will affect the consumer's marginal utility of wealth. Consequently, how we set $\mu$ determines whether we are constructing * a **Marshallian** demand curve, as when we use {eq}`eq:old2` and solve for $\mu$ using equation {eq}`eq:old4` below, or -* a **Hicksian** demand curve, as when we treat $\mu$ as a fixed parameter and solve for $W$ from {eq}`eq:old2p`. +* a **Hicksian** demand curve, as when we treat $\mu$ as a fixed parameter and solve for $w$ from {eq}`eq:old2p`. Marshallian and Hicksian demand curves contemplate different mental experiments: -* For a Marshallian demand curve, hypothetical changes in a price vector have both **substitution** and **income** effects +For a Marshallian demand curve, hypothetical changes in a price vector have both **substitution** and **income** effects - * income effects are consequences of changes in $p^\top e$ associated with the change in the price vector +* income effects are consequences of changes in $p^\top e$ associated with the change in the price vector -* For a Hicksian demand curve, hypothetical price vector changes have only **substitution** effects +For a Hicksian demand curve, hypothetical price vector changes have only **substitution** effects - * changes in the price vector leave the $p^\top e + W$ unaltered because we freeze $\mu$ and solve for $W$ +* changes in the price vector leave the $p^\top e + w$ unaltered because we freeze $\mu$ and solve for $w$ -Sometimes a Hicksian demand curve is called a **compensated** demand curve in order to emphasize that, to disarm the income (or wealth) effect associated with a price change, the consumer's wealth $W$ is adjusted. +Sometimes a Hicksian demand curve is called a **compensated** demand curve in order to emphasize that, to disarm the income (or wealth) effect associated with a price change, the consumer's wealth $w$ is adjusted. We'll discuss these distinct demand curves more below. -## Dynamics and Risk as Special Cases of Pure Exchange Economy +## Dynamics and Risk as Special Cases Special cases of our $n$-good pure exchange model can be created to represent -* dynamics - - by putting different dates on different commodities -* risk - - by interpreting delivery of goods as being contingent on states of the world whose realizations are described by a **known probability distribution** +* **dynamics** --- by putting different dates on different commodities +* **risk** --- by interpreting delivery of goods as being contingent on states of the world whose realizations are described by a *known probability distribution* Let's illustrate how. @@ -188,7 +221,7 @@ Let's illustrate how. Suppose that we want to represent a utility function $$ - -.5 [(c_1 - b_1)^2 + \beta (c_2 - b_2)^2] + - \frac{1}{2} [(c_1 - b_1)^2 + \beta (c_2 - b_2)^2] $$ where $\beta \in (0,1)$ is a discount factor, $c_1$ is consumption at time $1$ and $c_2$ is consumption at time 2. @@ -223,7 +256,13 @@ The right side is the **discounted present value** of the consumer's endowment. The relative price $\frac{p_1}{p_2}$ has units of time $2$ goods per unit of time $1$ goods. -Consequently, $(1+r) = R \equiv \frac{p_1}{p_2}$ is the **gross interest rate** and $r$ is the **net interest rate**. +Consequently, + +$$ + (1+r) := R := \frac{p_1}{p_2} +$$ + +is the **gross interest rate** and $r$ is the **net interest rate**. ### Risk and state-contingent claims @@ -242,7 +281,7 @@ As an example, our consumer confronts **risk** meaning in particular that Before the outcome is realized, the the consumer's **expected utility** is $$ --.5 [\lambda (c_1 - b_1)^2 + (1-\lambda)(c_2 - b_2)^2] +- \frac{1}{2} [\lambda (c_1 - b_1)^2 + (1-\lambda)(c_2 - b_2)^2] $$ where @@ -312,7 +351,7 @@ to maximize total revenue minus total costs. The firm's total revenue equals $p^\top q$ and its total cost equals $C(q)$ where $C(q)$ is a total cost function $$ -C(q) = h ^\top q + .5 q^\top J q +C(q) = h ^\top q + \frac{1}{2} q^\top J q $$ @@ -336,7 +375,7 @@ $$ where $$ -H = .5 (J + J') +H = \frac{1}{2} (J + J') $$ An $n \times 1$ vector of marginal revenues for the price-taking firm is $\frac{\partial p^\top q} @@ -410,7 +449,7 @@ Thus, instead of being a price-taker, a monopolist sets prices to maximize profi So the monopolist's total profits as a function of its output $q$ is $$ -[\mu^{-1} \Pi^\top (b - \Pi q)]^\top q - h^\top q - .5 q^\top J q +[\mu^{-1} \Pi^\top (b - \Pi q)]^\top q - h^\top q - \frac{1}{2} q^\top J q $$ (eq:monopprof) After finding @@ -418,7 +457,7 @@ first-order necessary conditions for maximizing monopoly profits with respect to and solving them for $q$, we find that the monopolist sets $$ -q = (H + 2 \mu^{-1} \Pi^T \Pi)^{-1} (\mu^{-1} \Pi^\top b - h) +q = (H + 2 \mu^{-1} \Pi^\top \Pi)^{-1} (\mu^{-1} \Pi^\top b - h) $$ (eq:qmonop) We'll soon see that a monopolist sets a **lower output** $q$ than does either a @@ -428,7 +467,13 @@ We'll soon see that a monopolist sets a **lower output** $q$ than does either a * a competitive equilibrium -**Exercise:** Please verify the monopolist's supply curve {eq}`eq:qmonop`. + +```{exercise} +:label: sdm_ex3 + +Please verify the monopolist's supply curve {eq}`eq:qmonop`. + +``` @@ -438,19 +483,20 @@ We'll soon see that a monopolist sets a **lower output** $q$ than does either a Our welfare maximization problem -- also sometimes called a social planning problem -- is to choose $c$ to maximize $$ --.5 \mu^{-1}(\Pi c -b) ^\top (\Pi c -b ) + - \frac{1}{2} \mu^{-1}(\Pi c -b) ^\top (\Pi c -b ) $$ minus the area under the inverse supply curve, namely, $$ -h c + .5 c^\top J c . + h c + \frac{1}{2} c^\top J c $$ So the welfare criterion is $$ --.5 \mu^{-1}(\Pi c -b) ^\top (\Pi c -b ) -h c - .5 c^\top J c + - \frac{1}{2} \mu^{-1}(\Pi c -b)^\top (\Pi c -b ) -h c + - \frac{1}{2} c^\top J c $$ In this formulation, $\mu$ is a parameter that describes how the planner weights interests of outside suppliers and our representative consumer. @@ -472,8 +518,4 @@ We can deduce a competitive equilibrium price vector from either * the inverse demand curve, or * the inverse supply curve - - - - - +