Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b7b439d

Browse files
authoredApr 26, 2023
Merge pull request #169 from QuantEcon/update_sd1
Edits to introductory supply and demand lecture
2 parents 2045e81 + 9a0e439 commit b7b439d

File tree

2 files changed

+572
-126
lines changed

2 files changed

+572
-126
lines changed
 

‎lectures/intro_supply_demand.md

Lines changed: 482 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ Throughout the lecture, we focus on models with one good and one price.
2121
({doc}`Later <supply_demand_multiple_goods>` we will investigate settings with
2222
many goods.)
2323

24-
We shall describe two classic welfare theorems:
25-
26-
* **first welfare theorem:** for a given a distribution of wealth among consumers, a competitive equilibrium allocation of goods solves a social planning problem.
27-
28-
* **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.
29-
3024
Key infrastructure concepts that we'll encounter in this lecture are
3125

3226
* inverse demand curves
@@ -37,13 +31,30 @@ Key infrastructure concepts that we'll encounter in this lecture are
3731
* social welfare as a sum of consumer and producer surpluses
3832
* competitive equilibrium
3933

40-
We will use the following imports.
34+
35+
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
36+
37+
* [Leon Walras](https://en.wikipedia.org/wiki/L%C3%A9on_Walras)
38+
* [Francis Ysidro Edgeworth](https://en.wikipedia.org/wiki/Francis_Ysidro_Edgeworth)
39+
* [Vilfredo Pareto](https://en.wikipedia.org/wiki/Vilfredo_Pareto)
40+
41+
Important extensions to the key ideas were obtained by
42+
43+
* [Abba Lerner](https://en.wikipedia.org/wiki/Abba_P._Lerner)
44+
* [Harold Hotelling](https://en.wikipedia.org/wiki/Harold_Hotelling)
45+
* [Paul Samuelson](https://en.wikipedia.org/wiki/Paul_Samuelson)
46+
* [Kenneth Arrow](https://en.wikipedia.org/wiki/Kenneth_Arrow)
47+
* [Gerard Debreu](https://en.wikipedia.org/wiki/G%C3%A9rard_Debreu)
48+
49+
50+
In our exposition we will use the following imports.
4151

4252
```{code-cell} ipython3
4353
import numpy as np
4454
import matplotlib.pyplot as plt
4555
```
4656

57+
4758
## Supply and Demand
4859

4960
We study a market for a single good in which buyers and sellers exchange a quantity $q$ for a price $p$.
@@ -53,171 +64,564 @@ Quantity $q$ and price $p$ are both scalars.
5364
We assume that inverse demand and supply curves for the good are:
5465

5566
$$
56-
p = d_0 - d_1 q, \quad d_0, d_1 > 0
67+
p = d_0 - d_1 q, \quad d_0, d_1 > 0
5768
$$
5869

5970
$$
60-
p = s_0 + s_1 q , \quad s_0, s_1 > 0
71+
p = s_0 + s_1 q , \quad s_0, s_1 > 0
6172
$$
6273

6374
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.
6475

65-
### Surpluses and Welfare
6676

67-
We define **consumer surplus** as the area under an inverse demand curve minus $p q$:
77+
78+
Here is a class that stores parameters for our single good market, as well as
79+
implementing the inverse demand and supply curves.
80+
81+
```{code-cell} ipython3
82+
class Market:
83+
84+
def __init__(self,
85+
d_0=1.0, # demand intercept
86+
d_1=0.6, # demand slope
87+
s_0=0.1, # supply intercept
88+
s_1=0.4): # supply slope
89+
90+
self.d_0, self.d_1 = d_0, d_1
91+
self.s_0, self.s_1 = s_0, s_1
92+
93+
def inverse_demand(self, q):
94+
return self.d_0 - self.d_1 * q
95+
96+
def inverse_supply(self, q):
97+
return self.s_0 + self.s_1 * q
98+
99+
```
100+
101+
Let's create an instance.
102+
103+
```{code-cell} ipython3
104+
market = Market()
105+
```
106+
107+
108+
Here is a plot of these two functions using `market`.
109+
110+
```{code-cell} ipython3
111+
:tags: [hide-input]
112+
market = Market()
113+
114+
grid_min, grid_max, grid_size = 0, 1.5, 200
115+
q_grid = np.linspace(grid_min, grid_max, grid_size)
116+
supply_curve = market.inverse_supply(q_grid)
117+
demand_curve = market.inverse_demand(q_grid)
118+
119+
fig, ax = plt.subplots()
120+
ax.plot(q_grid, supply_curve, label='supply')
121+
ax.plot(q_grid, demand_curve, label='demand')
122+
ax.legend(loc='upper center', frameon=False)
123+
ax.set_ylim(0, 1.2)
124+
ax.set_xticks((0, 1))
125+
ax.set_yticks((0, 1))
126+
ax.set_xlabel('quantity')
127+
ax.set_ylabel('price')
128+
plt.show()
129+
```
130+
131+
132+
133+
### Consumer Surplus
134+
135+
Let a quantity $q$ be given and let $p := d_0 - d_1 q$ be the
136+
corresponding price on the inverse demand curve.
137+
138+
We define **consumer surplus** $S_c(q)$ as the area under an inverse demand
139+
curve minus $p q$:
140+
141+
$$
142+
S_c(q) :=
143+
\int_0^{q} (d_0 - d_1 x) dx - p q
144+
$$
145+
146+
The next figure illustrates
147+
148+
149+
```{code-cell} ipython3
150+
:tags: [hide-input]
151+
152+
q = 1.25
153+
p = market.inverse_demand(q)
154+
ps = np.ones_like(q_grid) * p
155+
156+
fig, ax = plt.subplots()
157+
ax.plot(q_grid, demand_curve, label='demand')
158+
ax.fill_between(q_grid[q_grid <= q],
159+
demand_curve[q_grid<=q],
160+
ps[q_grid <= q],
161+
label='consumer surplus',
162+
color='#EED1CF')
163+
ax.vlines(q, 0, p, linestyle="dashed", color='black', alpha=0.7)
164+
ax.hlines(p, 0, q, linestyle="dashed", color='black', alpha=0.7)
165+
166+
ax.legend(loc='upper center', frameon=False)
167+
ax.set_ylim(0, 1.2)
168+
ax.set_xticks((q,))
169+
ax.set_xticklabels(("$q$",))
170+
ax.set_yticks((p,))
171+
ax.set_yticklabels(("$p$",))
172+
ax.set_xlabel('quantity')
173+
ax.set_ylabel('price')
174+
plt.show()
175+
```
176+
177+
178+
Consumer surplus gives a measure of total consumer welfare at quantity $q$.
179+
180+
The idea is that the inverse demand curve $d_0 - d_1 q$ shows willingness to
181+
pay at a given quantity $q$.
182+
183+
The difference between willingness to pay and the actual price is the surplus.
184+
185+
The value $S_c(q)$ is the "sum" (i.e., integral) of these surpluses when the total
186+
quantity purchased is $q$ and the purchase price is $p$.
187+
188+
Evaluating the integral in the definition of consumer surplus gives
189+
190+
$$
191+
S_c(q)
192+
= d_0 q - \frac{1}{2} d_1 q^2 - p q
193+
$$
194+
195+
196+
197+
198+
### Producer Surplus
199+
200+
Let a quantity $q$ be given and let $p := s_0 + s_1 q$ be the
201+
corresponding price on the inverse supply curve.
202+
203+
204+
We define **producer surplus** as $p q$ minus the area under an inverse supply curve
68205

69206
$$
70-
\int_0^q (d_0 - d_1 x) dx - pq = d_0 q -.5 d_1 q^2 - pq
207+
S_p(q)
208+
:= p q - \int_0^q (s_0 + s_1 x) dx
71209
$$
72210

73-
We define **producer surplus** as $p q$ minus the area under an inverse supply curve:
211+
The next figure illustrates
212+
213+
```{code-cell} ipython3
214+
:tags: [hide-input]
215+
216+
q = 0.75
217+
p = market.inverse_supply(q)
218+
ps = np.ones_like(q_grid) * p
219+
220+
fig, ax = plt.subplots()
221+
ax.plot(q_grid, supply_curve, label='supply')
222+
ax.fill_between(q_grid[q_grid <= q],
223+
supply_curve[q_grid<=q],
224+
ps[q_grid <= q],
225+
label='producer surplus',
226+
color='#E6E6F5')
227+
ax.vlines(q, 0, p, linestyle="dashed", color='black', alpha=0.7)
228+
ax.hlines(p, 0, q, linestyle="dashed", color='black', alpha=0.7)
229+
230+
ax.legend(loc='upper center', frameon=False)
231+
ax.set_ylim(0, 1.2)
232+
ax.set_xticks((q,))
233+
ax.set_xticklabels(("$q$",))
234+
ax.set_yticks((p,))
235+
ax.set_yticklabels(("$p$",))
236+
ax.set_xlabel('quantity')
237+
ax.set_ylabel('price')
238+
plt.show()
239+
```
240+
241+
Producer surplus measures total producer welfare at quantity $q$
242+
243+
The idea is similar to that of consumer surplus.
244+
245+
The inverse supply curve $s_0 + s_1 q$ shows the price at which producers are
246+
prepared to sell, given quantity $q$.
247+
248+
The difference between willingness to sell and the actual price is the surplus.
249+
250+
The value $S_p(q)$ is the integral of these surpluses.
251+
252+
Evaluating the integral in the definition of consumer surplus gives
74253

75254
$$
76-
p q - \int_0^q (s_0 + s_1 x) dx = pq - s_0 q - .5 s_1 q^2
255+
S_p(q) = pq - s_0 q - \frac{1}{2} s_1 q^2
77256
$$
78257

79-
Sometimes economists measure social welfare by a **welfare criterion** that equals consumer surplus plus producer surplus
258+
259+
### Social Welfare
260+
261+
Sometimes economists measure social welfare by a **welfare criterion** that
262+
equals consumer surplus plus producer surplus, assuming that consumers and
263+
producers pay the same price:
80264

81265
$$
82-
\int_0^q (d_0 - d_1 x) dx - \int_0^q (s_0 + s_1 x) dx \equiv \textrm{Welf}
266+
W(q)
267+
= \int_0^q (d_0 - d_1 x) dx - \int_0^q (s_0 + s_1 x) dx
83268
$$
84269

85-
or
270+
Evaluating the integrals gives
86271

87272
$$
88-
\textrm{Welf} = (d_0 - s_0) q - .5 (d_1 + s_1) q^2
273+
W(q) = (d_0 - s_0) q - \frac{1}{2} (d_1 + s_1) q^2
89274
$$
90275

91-
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.
276+
Here is a Python function that evaluates this social welfare at a given
277+
quantity $q$ and a fixed set of parameters.
92278

93-
We get
279+
```{code-cell} ipython3
280+
def W(q, market):
281+
# Unpack
282+
d_0, d_1, s_0, s_1 = market.d_0, market.d_1, market.s_0, market.s_1
283+
# Compute and return welfare
284+
return (d_0 - s_0) * q - 0.5 * (d_1 + s_1) * q**2
285+
```
286+
287+
The next figure plots welfare as a function of $q$.
288+
289+
290+
```{code-cell} ipython3
291+
:tags: [hide-input]
292+
q_vals = np.linspace(0, 1.78, 200)
293+
fig, ax = plt.subplots()
294+
ax.plot(q_vals, W(q_vals, market), label='welfare')
295+
ax.legend(frameon=False)
296+
ax.set_xlabel('quantity')
297+
plt.show()
298+
```
299+
300+
Let's now give a social planner the task of maximizing social welfare.
301+
302+
To compute a quantity that maximizes the welfare criterion, we differentiate
303+
$W$ with respect to $q$ and then set the derivative to zero.
94304

95305
$$
96-
\frac{d \textrm{Welf}}{d q} = d_0 - s_0 - (d_1 + s_1) q = 0
306+
\frac{d W(q)}{d q} = d_0 - s_0 - (d_1 + s_1) q = 0
97307
$$
98308

99-
which implies
309+
Solving for $q$ yields
100310

101311
$$
102-
q = \frac{ d_0 - s_0}{s_1 + d_1}
312+
q = \frac{ d_0 - s_0}{s_1 + d_1}
103313
$$ (eq:old1)
104314
105315
Let's remember the quantity $q$ given by equation {eq}`eq:old1` that a social planner would choose to maximize consumer plus producer surplus.
106316
107317
We'll compare it to the quantity that emerges in a competitive equilibrium
108318
equilibrium that equates supply to demand.
109319
320+
321+
110322
### Competitive Equilibrium
111323
112-
Instead of equating quantities supplied and demanded, we'll can accomplish the same thing by equating demand price to supply price:
324+
Instead of equating quantities supplied and demanded, we'll can accomplish the
325+
same thing by equating demand price to supply price:
113326
114327
$$
115-
p = d_0 - d_1 q = s_0 + s_1 q ,
328+
p = d_0 - d_1 q = s_0 + s_1 q
329+
$$
330+
331+
If we solve the equation defined by the second equality in the above line for
332+
$q$, we obtain
333+
116334
$$
335+
q = \frac{ d_0 - s_0}{s_1 + d_1}
336+
$$ (eq:equilib_q)
117337
118-
+++
119338
120-
It we solve the equation defined by the second equality in the above line for $q$, we obtain the
121-
competitive equilibrium quantity; it equals the same $q$ given by equation {eq}`eq:old1`.
339+
This is the competitive equilibrium quantity.
340+
341+
Observe that the equilibrium quantity equals the same $q$ given by equation {eq}`eq:old1`.
122342
123343
The outcome that the quantity determined by equation {eq}`eq:old1` equates
124344
supply to demand brings us a **key finding:**
125345
126-
* a competitive equilibrium quantity maximizes our welfare criterion
346+
* a competitive equilibrium quantity maximizes our welfare criterion
347+
348+
This is a version of the [first fundamental welfare theorem](https://en.wikipedia.org/wiki/Fundamental_theorems_of_welfare_economics),
127349
128350
It also brings a useful **competitive equilibrium computation strategy:**
129351
130-
* 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
352+
* after solving the welfare problem for an optimal quantity, we can read a
353+
competitive equilibrium price from either supply price or demand price at
354+
the competitive equilibrium quantity
131355
132-
### Generalizations
133356
134-
In later lectures, we'll derive generalizations of the above demand and
135-
supply curves from other objects.
357+
## Generalizations
358+
359+
In a {doc}`later lecture <supply_demand_multiple_goods>`, we'll derive
360+
generalizations of the above demand and supply curves from other objects.
136361
137362
Our generalizations will extend the preceding analysis of a market for a
138363
single good to the analysis of $n$ simultaneous markets in $n$ goods.
139364
140365
In addition
141366
142-
* we'll derive **demand curves** from a consumer problem that maximizes a **utility function** subject to a **budget constraint**.
367+
* we'll derive **demand curves** from a consumer problem that maximizes a
368+
**utility function** subject to a **budget constraint**.
369+
370+
* we'll derive **supply curves** from the problem of a producer who is price
371+
taker and maximizes his profits minus total costs that are described by a
372+
**cost function**.
373+
374+
## Exercises
143375
144-
* 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**.
376+
Suppose now that the inverse demand and supply curves are modified to take the
377+
form
378+
379+
$$
380+
p = i_d(q) := d_0 - d_1 q^{0.6}
381+
$$
382+
383+
$$
384+
p = i_s(q) := s_0 + s_1 q^{1.2}
385+
$$
145386
146-
## Code
387+
All parameters are positive, as before.
388+
389+
390+
391+
392+
```{exercise}
393+
:label: isd_ex1
394+
395+
Define a new `Market` class that holds the same parameter values as before by
396+
changes the `inverse_demand` and `inverse_supply` methods to
397+
match these new definitions.
398+
399+
Using the class, plot the inverse demand and supply curves $i_d$ and $i_s$
400+
401+
```
402+
403+
404+
405+
```{solution-start} isd_ex1
406+
:class: dropdown
407+
```
147408
148409
```{code-cell} ipython3
149-
class SingleGoodMarket:
410+
class Market:
150411
151412
def __init__(self,
152413
d_0=1.0, # demand intercept
153-
d_1=0.5, # demand slope
414+
d_1=0.6, # demand slope
154415
s_0=0.1, # supply intercept
155416
s_1=0.4): # supply slope
156417
157418
self.d_0, self.d_1 = d_0, d_1
158419
self.s_0, self.s_1 = s_0, s_1
159420
160421
def inverse_demand(self, q):
161-
return self.d_0 - self.d_1 * q
422+
return self.d_0 - self.d_1 * q**0.6
162423
163424
def inverse_supply(self, q):
164-
return self.s_0 + self.s_1 * q
425+
return self.s_0 + self.s_1 * q**1.8
426+
427+
```
165428
166-
def equilibrium_quantity(self):
167-
return (self.d_0 - self.s_0) / (self.d_1 + self.s_1)
429+
Let's create an instance.
168430
169-
def equilibrium_price(self):
170-
q = self.equilibrium_quantity()
171-
return self.s_0 + self.s_1 * q
431+
```{code-cell} ipython3
432+
market = Market()
172433
```
173434
435+
436+
Here is a plot of inverse supply and demand.
437+
174438
```{code-cell} ipython3
175-
def plot_supply_demand(market):
439+
:tags: [hide-input]
440+
441+
grid_min, grid_max, grid_size = 0, 1.5, 200
442+
q_grid = np.linspace(grid_min, grid_max, grid_size)
443+
supply_curve = market.inverse_supply(q_grid)
444+
demand_curve = market.inverse_demand(q_grid)
445+
446+
fig, ax = plt.subplots()
447+
ax.plot(q_grid, supply_curve, label='supply')
448+
ax.plot(q_grid, demand_curve, label='demand')
449+
ax.legend(loc='upper center', frameon=False)
450+
ax.set_ylim(0, 1.2)
451+
ax.set_xticks((0, 1))
452+
ax.set_yticks((0, 1))
453+
ax.set_xlabel('quantity')
454+
ax.set_ylabel('price')
455+
plt.show()
456+
```
457+
458+
459+
```{solution-end}
460+
```
461+
462+
176463
464+
```{exercise}
465+
:label: isd_ex2
466+
467+
468+
As before, consumer surplus at $q$ is the area under the demand curve minus
469+
price times quantity:
470+
471+
$$
472+
S_c(q) = \int_0^{q} i_d(x) dx - p q
473+
$$
474+
475+
Here $p$ is set to $i_d(q)$
476+
477+
Producer surplus is price times quantity minus the area under the inverse
478+
supply curve:
479+
480+
$$
481+
S_p(q)
482+
= p q - \int_0^q i_s(x) dx
483+
$$
484+
485+
Here $p$ is set to $i_s(q)$.
486+
487+
Social welfare is the sum of consumer and producer surplus under the
488+
assumption that the price is the same for buyers and sellers:
489+
490+
$$
491+
W(q)
492+
= \int_0^q i_d(x) dx - \int_0^q i_q(x) dx
493+
$$
494+
495+
Solve the integrals and write a function to compute this quantity numerically
496+
at given $q$.
497+
498+
Plot welfare as a function of $q$.
499+
500+
```
501+
502+
503+
504+
```{solution-start} isd_ex2
505+
:class: dropdown
506+
```
507+
508+
Solving the integrals gives
509+
510+
$$
511+
W(q)
512+
= d_0 q - \frac{d_1 q^{1.6}}{1.6}
513+
- \left( s_0 q + \frac{s_1 q^{2.8}}{2.8} \right)
514+
$$
515+
516+
Here's a Python function that computes this value:
517+
518+
519+
```{code-cell} ipython3
520+
def W(q, market):
177521
# Unpack
178-
d_0, d_1 = market.d_0, market.d_1
179-
s_0, s_1 = market.s_0, market.s_1
180-
q = market.equilibrium_quantity()
181-
p = market.equilibrium_price()
182-
grid_size = 200
183-
x_grid = np.linspace(0, 2 * q, grid_size)
184-
ps = np.ones_like(x_grid) * p
185-
supply_curve = market.inverse_supply(x_grid)
186-
demand_curve = market.inverse_demand(x_grid)
522+
d_0, d_1, s_0, s_1 = market.d_0, market.d_1, market.s_0, market.s_1
523+
# Compute and return welfare
524+
S_c = d_0 * q - d_1 * q**1.6 / 1.6
525+
S_p = s_0 * q + s_1 * q**2.8 / 2.8
526+
return S_c - S_p
527+
```
528+
529+
The next figure plots welfare as a function of $q$.
530+
531+
532+
```{code-cell} ipython3
533+
fig, ax = plt.subplots()
534+
ax.plot(q_vals, W(q_vals, market), label='welfare')
535+
ax.legend(frameon=False)
536+
ax.set_xlabel('quantity')
537+
plt.show()
538+
```
539+
540+
```{solution-end}
541+
```
187542
188-
fig, ax = plt.subplots()
189543
190-
ax.plot(x_grid, supply_curve, label='Supply', color='#020060')
191-
ax.plot(x_grid, demand_curve, label='Demand', color='#600001')
192544
193-
ax.fill_between(x_grid[x_grid <= q],
194-
demand_curve[x_grid<=q],
195-
ps[x_grid <= q],
196-
label='Consumer surplus',
197-
color='#EED1CF')
198-
ax.fill_between(x_grid[x_grid <= q],
199-
supply_curve[x_grid <= q],
200-
ps[x_grid <= q],
201-
label='Producer surplus',
202-
color='#E6E6F5')
545+
```{exercise}
546+
:label: isd_ex3
203547
204-
ax.vlines(q, 0, p, linestyle="dashed", color='black', alpha=0.7)
205-
ax.hlines(p, 0, q, linestyle="dashed", color='black', alpha=0.7)
206548
207-
ax.legend(loc='upper center', frameon=False)
208-
ax.margins(x=0, y=0)
209-
ax.set_ylim(0)
210-
ax.set_xlabel('Quantity')
211-
ax.set_ylabel('Price')
549+
Due to nonlinearities, the new welfare function is not easy to maximize with
550+
pencil and paper.
551+
552+
Maximize it using `scipy.optimize.minimize_scalar` instead.
212553
213-
plt.show()
554+
```
555+
556+
557+
558+
```{solution-start} isd_ex3
559+
:class: dropdown
214560
```
215561
216562
```{code-cell} ipython3
217-
market = SingleGoodMarket()
563+
from scipy.optimize import minimize_scalar
564+
565+
def objective(q):
566+
return -W(q, market)
567+
568+
result = minimize_scalar(objective, bounds=(0, 10))
569+
print(result.message)
218570
```
219571
572+
573+
220574
```{code-cell} ipython3
221-
plot_supply_demand(market)
575+
maximizing_q = result.x
576+
print(f"{maximizing_q: .5f}")
577+
```
578+
579+
```{solution-end}
580+
```
581+
582+
583+
584+
```{exercise}
585+
:label: isd_ex4
586+
587+
Now compute the equilibrium quantity by finding the price that equates supply
588+
and demand.
589+
590+
You can do this numerically by finding the root of the excess demand function
591+
592+
$$
593+
e_d(q) := i_d(q) - i_s(q)
594+
$$
595+
596+
You can use `scipy.optimize.newton` to compute the root.
597+
598+
Initialize `newton` with a starting guess somewhere close to 1.0.
599+
600+
(Similar initial conditions will give the same result.)
601+
602+
You should find that the equilibrium price agrees with the welfare maximizing
603+
price, in line with the first fundamental welfare theorem.
604+
605+
```
606+
607+
608+
609+
```{solution-start} isd_ex3
610+
:class: dropdown
611+
```
612+
613+
614+
```{code-cell} ipython3
615+
from scipy.optimize import newton
616+
617+
def excess_demand(q):
618+
return market.inverse_demand(q) - market.inverse_supply(q)
619+
620+
equilibrium_q = newton(excess_demand, 0.1)
621+
print(f"{equilibrium_q: .5f}")
622+
```
623+
624+
625+
```{solution-end}
222626
```
223627

‎lectures/supply_demand_multiple_goods.md

Lines changed: 90 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
## Overview
44

5-
We study a setting with $n$ goods and $n$ corresponding prices.
5+
In a {doc}`previous lecture <intro_supply_demand>` we studied supply, demand
6+
and welfare in a market with just one good.
7+
8+
In this lecture, we study a setting with $n$ goods and $n$ corresponding prices.
9+
10+
We shall describe two classic welfare theorems:
11+
12+
* **first welfare theorem:** for a given a distribution of wealth among consumers, a competitive equilibrium allocation of goods solves a social planning problem.
13+
14+
* **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.
615

716

817

@@ -30,30 +39,35 @@ $$
3039

3140
## From utility function to demand curve
3241

33-
Let
42+
Our study of consumers will use the following primitives
3443

3544
* $\Pi$ be an $m \times n$ matrix,
36-
* $c$ be an $n \times 1$ vector of consumptions of various goods,
3745
* $b$ be an $m \times 1$ vector of bliss points,
3846
* $e$ be an $n \times 1$ vector of endowments, and
39-
* $p$ be an $n \times 1$ vector of prices
4047

41-
We assume that $\Pi$ has linearly independent columns, which implies that $\Pi^\top \Pi$ is a positive definite matrix.
4248

43-
* it follows that $\Pi^\top \Pi$ has an inverse.
49+
We will analyze endogenous objects $c$ and $p$, where
50+
51+
* $c$ is an $n \times 1$ vector of consumptions of various goods,
52+
* $p$ is an $n \times 1$ vector of prices
53+
4454

4555
The matrix $\Pi$ describes a consumer's willingness to substitute one good for every other good.
4656

47-
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:
57+
We assume that $\Pi$ has linearly independent columns, which implies that $\Pi^\top \Pi$ is a positive definite matrix.
58+
59+
* it follows that $\Pi^\top \Pi$ has an inverse.
60+
61+
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:
4862

4963
$$
50-
\frac{\partial c } {\partial p} = (\Pi^T \Pi)^{-1}
64+
\frac{\partial c } {\partial p} = (\Pi^\top \Pi)^{-1}
5165
$$
5266

5367
A consumer faces $p$ as a price taker and chooses $c$ to maximize the utility function
5468

5569
$$
56-
-.5 (\Pi c -b) ^\top (\Pi c -b )
70+
- \frac{1}{2} (\Pi c -b) ^\top (\Pi c -b )
5771
$$ (eq:old0)
5872
5973
subject to the budget constraint
@@ -62,25 +76,28 @@ $$
6276
p^\top (c -e ) = 0
6377
$$ (eq:old2)
6478
65-
We shall specify examples in which $\Pi$ and $b$ are such that it typically happens that
79+
We shall specify examples in which $\Pi$ and $b$ are such that
6680
6781
$$
68-
\Pi c < < b
82+
\Pi c \ll b
6983
$$ (eq:bversusc)
7084
71-
so that utility function {eq}`eq:old2` tells us that the consumer has much less of each good than he wants.
85+
This means that the consumer has much less of each good than he wants.
86+
87+
The deviation in {eq}`eq:bversusc` will ultimately assure us that competitive equilibrium prices are positive.
7288
73-
Condition {eq}`eq:bversusc` will ultimately assure us that competitive equilibrium prices are positive.
7489
7590
### Demand Curve Implied by Constrained Utility Maximization
7691
7792
For now, we assume that the budget constraint is {eq}`eq:old2`.
7893
7994
So we'll be deriving what is known as a **Marshallian** demand curve.
8095
96+
Our aim is to maximize [](eq:old0) subject to [](eq:old2).
97+
8198
Form a Lagrangian
8299
83-
$$ L = -.5 (\Pi c -b) ^\top (\Pi c -b ) + \mu [p^\top (e-c)] $$
100+
$$ L = - \frac{1}{2} (\Pi c -b)^\top (\Pi c -b ) + \mu [p^\top (e-c)] $$
84101

85102
where $\mu$ is a Lagrange multiplier that is often called a **marginal utility of wealth**.
86103

@@ -107,8 +124,13 @@ $$ (eq:old4)
107124
108125
Equation {eq}`eq:old4` tells how marginal utility of wealth depends on the endowment vector $e$ and the price vector $p$.
109126
110-
**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.
127+
```{note}
128+
Equation {eq}`eq:old4` is a consequence of imposing that $p^\top (c - e) = 0$.
129+
130+
We could instead take $\mu$ as a parameter and use {eq}`eq:old3` and the budget constraint {eq}`eq:old2p` to solve for wealth.
111131
132+
Which way we proceed determines whether we are constructing a **Marshallian** or **Hicksian** demand curve.
133+
```
112134
113135
## Endowment economy
114136
@@ -134,52 +156,63 @@ This amounts to choosing a common unit (or numeraire) in which prices of all go
134156
135157
We'll set $\mu=1$.
136158
137-
**Exercise:** Verify that setting $\mu=1$ in {eq}`eq:old3` implies that formula {eq}`eq:old4` is satisfied.
159+
```{exercise}
160+
:label: sdm_ex1
138161
139-
**Exercise:** Verify that setting $\mu=2$ in {eq}`eq:old3` also implies that formula {eq}`eq:old4` is satisfied.
162+
Verify that setting $\mu=1$ in {eq}`eq:old3` implies that formula {eq}`eq:old4` is satisfied.
163+
164+
```
165+
166+
```{exercise}
167+
:label: sdm_ex2
168+
169+
Verify that setting $\mu=2$ in {eq}`eq:old3` also implies that formula
170+
{eq}`eq:old4` is satisfied.
171+
172+
```
140173
141174
142175
## Digression: Marshallian and Hicksian Demand Curves
143176
144-
**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
177+
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.
178+
179+
Other times we'll instead assume that the consumer has another source of income (positive or negative) and write his budget constraint as
145180
146181
$$
147-
p ^\top (c -e ) = W
182+
p ^\top (c -e ) = w
148183
$$ (eq:old2p)
149184
150-
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$.
185+
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$.
151186
152-
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.
187+
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.
153188
154189
Consequently, how we set $\mu$ determines whether we are constructing
155190
156191
* a **Marshallian** demand curve, as when we use {eq}`eq:old2` and solve for $\mu$ using equation {eq}`eq:old4` below, or
157-
* a **Hicksian** demand curve, as when we treat $\mu$ as a fixed parameter and solve for $W$ from {eq}`eq:old2p`.
192+
* a **Hicksian** demand curve, as when we treat $\mu$ as a fixed parameter and solve for $w$ from {eq}`eq:old2p`.
158193
159194
Marshallian and Hicksian demand curves contemplate different mental experiments:
160195
161-
* For a Marshallian demand curve, hypothetical changes in a price vector have both **substitution** and **income** effects
196+
For a Marshallian demand curve, hypothetical changes in a price vector have both **substitution** and **income** effects
162197
163-
* income effects are consequences of changes in $p^\top e$ associated with the change in the price vector
198+
* income effects are consequences of changes in $p^\top e$ associated with the change in the price vector
164199
165-
* For a Hicksian demand curve, hypothetical price vector changes have only **substitution** effects
200+
For a Hicksian demand curve, hypothetical price vector changes have only **substitution** effects
166201
167-
* changes in the price vector leave the $p^\top e + W$ unaltered because we freeze $\mu$ and solve for $W$
202+
* changes in the price vector leave the $p^\top e + w$ unaltered because we freeze $\mu$ and solve for $w$
168203
169-
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.
204+
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.
170205
171206
We'll discuss these distinct demand curves more below.
172207
173208
174209
175-
## Dynamics and Risk as Special Cases of Pure Exchange Economy
210+
## Dynamics and Risk as Special Cases
176211
177212
Special cases of our $n$-good pure exchange model can be created to represent
178213
179-
* dynamics
180-
- by putting different dates on different commodities
181-
* risk
182-
- by interpreting delivery of goods as being contingent on states of the world whose realizations are described by a **known probability distribution**
214+
* **dynamics** --- by putting different dates on different commodities
215+
* **risk** --- by interpreting delivery of goods as being contingent on states of the world whose realizations are described by a *known probability distribution*
183216
184217
Let's illustrate how.
185218
@@ -188,7 +221,7 @@ Let's illustrate how.
188221
Suppose that we want to represent a utility function
189222
190223
$$
191-
-.5 [(c_1 - b_1)^2 + \beta (c_2 - b_2)^2]
224+
- \frac{1}{2} [(c_1 - b_1)^2 + \beta (c_2 - b_2)^2]
192225
$$
193226
194227
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.
223256
224257
The relative price $\frac{p_1}{p_2}$ has units of time $2$ goods per unit of time $1$ goods.
225258
226-
Consequently, $(1+r) = R \equiv \frac{p_1}{p_2}$ is the **gross interest rate** and $r$ is the **net interest rate**.
259+
Consequently,
260+
261+
$$
262+
(1+r) := R := \frac{p_1}{p_2}
263+
$$
264+
265+
is the **gross interest rate** and $r$ is the **net interest rate**.
227266
228267
### Risk and state-contingent claims
229268
@@ -242,7 +281,7 @@ As an example, our consumer confronts **risk** meaning in particular that
242281
Before the outcome is realized, the the consumer's **expected utility** is
243282
244283
$$
245-
-.5 [\lambda (c_1 - b_1)^2 + (1-\lambda)(c_2 - b_2)^2]
284+
- \frac{1}{2} [\lambda (c_1 - b_1)^2 + (1-\lambda)(c_2 - b_2)^2]
246285
$$
247286
248287
where
@@ -312,7 +351,7 @@ to maximize total revenue minus total costs.
312351
The firm's total revenue equals $p^\top q$ and its total cost equals $C(q)$ where $C(q)$ is a total cost function
313352
314353
$$
315-
C(q) = h ^\top q + .5 q^\top J q
354+
C(q) = h ^\top q + \frac{1}{2} q^\top J q
316355
$$
317356
318357
@@ -336,7 +375,7 @@ $$
336375
where
337376
338377
$$
339-
H = .5 (J + J')
378+
H = \frac{1}{2} (J + J')
340379
$$
341380
342381
An $n \times 1$ vector of marginal revenues for the price-taking firm is $\frac{\partial p^\top q}
@@ -410,15 +449,15 @@ Thus, instead of being a price-taker, a monopolist sets prices to maximize profi
410449
So the monopolist's total profits as a function of its output $q$ is
411450
412451
$$
413-
[\mu^{-1} \Pi^\top (b - \Pi q)]^\top q - h^\top q - .5 q^\top J q
452+
[\mu^{-1} \Pi^\top (b - \Pi q)]^\top q - h^\top q - \frac{1}{2} q^\top J q
414453
$$ (eq:monopprof)
415454
416455
After finding
417456
first-order necessary conditions for maximizing monopoly profits with respect to $q$
418457
and solving them for $q$, we find that the monopolist sets
419458
420459
$$
421-
q = (H + 2 \mu^{-1} \Pi^T \Pi)^{-1} (\mu^{-1} \Pi^\top b - h)
460+
q = (H + 2 \mu^{-1} \Pi^\top \Pi)^{-1} (\mu^{-1} \Pi^\top b - h)
422461
$$ (eq:qmonop)
423462
424463
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
428467
* a competitive equilibrium
429468
430469
431-
**Exercise:** Please verify the monopolist's supply curve {eq}`eq:qmonop`.
470+
471+
```{exercise}
472+
:label: sdm_ex3
473+
474+
Please verify the monopolist's supply curve {eq}`eq:qmonop`.
475+
476+
```
432477
433478
434479
@@ -438,19 +483,20 @@ We'll soon see that a monopolist sets a **lower output** $q$ than does either a
438483
Our welfare maximization problem -- also sometimes called a social planning problem -- is to choose $c$ to maximize
439484
440485
$$
441-
-.5 \mu^{-1}(\Pi c -b) ^\top (\Pi c -b )
486+
- \frac{1}{2} \mu^{-1}(\Pi c -b) ^\top (\Pi c -b )
442487
$$
443488
444489
minus the area under the inverse supply curve, namely,
445490
446491
$$
447-
h c + .5 c^\top J c .
492+
h c + \frac{1}{2} c^\top J c
448493
$$
449494
450495
So the welfare criterion is
451496
452497
$$
453-
-.5 \mu^{-1}(\Pi c -b) ^\top (\Pi c -b ) -h c - .5 c^\top J c
498+
- \frac{1}{2} \mu^{-1}(\Pi c -b)^\top (\Pi c -b ) -h c
499+
- \frac{1}{2} c^\top J c
454500
$$
455501
456502
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
472518
* the inverse demand curve, or
473519
474520
* the inverse supply curve
475-
476-
<!-- #endregion -->
477-
478-
<!-- #region -->
479-
521+

0 commit comments

Comments
 (0)
Please sign in to comment.