Skip to content

Commit df80367

Browse files
committed
further_edits
1 parent d246add commit df80367

File tree

1 file changed

+140
-126
lines changed

1 file changed

+140
-126
lines changed

lectures/supply_demand_heterogeneity.md

Lines changed: 140 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,40 @@ kernelspec:
1111
name: python3
1212
---
1313

14+
(supply_demand_heterogeneity)=
1415
# Market Equilibrium with Heterogeneity
1516

17+
```{contents} Contents
18+
:depth: 2
19+
```
20+
21+
## Overview
22+
23+
In the {doc}`previous lecture
24+
<supply_demand_multiple_goods>`, we studied competitive equilibria in an economy with many goods.
25+
26+
While the results of the study were informative, we used a strong simplifying assumption: all of the agents in the economy are identical.
27+
28+
In the real world, households, firms and other economic agents differ from one another along many dimensions.
29+
30+
In this lecture, we introduce heterogeneity across consumers by allowing their preferences and endownments to differ.
31+
32+
We will examine competitive equilibrium in this setting.
1633

17-
## An Endowment Economy
34+
We will also show how a "representative consumer" can be constructed.
1835

19-
Let's study a **pure exchange** economy without production.
36+
Here are some imports:
37+
38+
```{code-cell} ipython3
39+
import numpy as np
40+
import pandas as pd
41+
import matplotlib.pyplot as plt
42+
from scipy.linalg import inv
43+
```
44+
45+
## An simple example
46+
47+
Let's study a simple example of **pure exchange** economy without production.
2048

2149
There are two consumers who differ in their endowment vectors $e_i$ and their bliss-point vectors $b_i$ for $i=1,2$.
2250

@@ -80,66 +108,11 @@ $$
80108
```{exercise-end}
81109
```
82110
83-
## Designing some Python Code
84-
85-
86-
Below we shall construct a Python class with the following attributes:
87-
88-
* **Preferences** in the form of
89-
90-
* an $n \times n$ positive definite matrix $\Pi$
91-
* an $n \times 1$ vector of bliss points $b$
92-
93-
* **Endowments** in the form of
94-
95-
* an $n \times 1$ vector $e$
96-
* a scalar "wealth" $W$ with default value $0$
97-
98-
* **Production Costs** pinned down by
99-
100-
* an $n \times 1$ nonnegative vector $h$
101-
* an $n \times n$ positive definite matrix $J$
102-
103-
The class will include a test to make sure that $b > > \Pi e $ and raise an exception if it is violated
104-
(at some threshold level we'd have to specify).
105-
106-
* **A Person** in the form of a pair that consists of
107-
108-
* **Preferences** and **Endowments**
109-
110-
* **A Pure Exchange Economy** will consist of
111-
112-
* a collection of $m$ **persons**
113-
114-
* $m=1$ for our single-agent economy
115-
* $m=2$ for our illustrations of a pure exchange economy
116-
117-
* an equilibrium price vector $p$ (normalized somehow)
118-
* an equilibrium allocation $c^1, c^2, \ldots, c^m$ -- a collection of $m$ vectors of dimension $n \times 1$
119-
120-
* **A Production Economy** will consist of
121-
122-
* a single **person** that we'll interpret as a representative consumer
123-
* a single set of **production costs**
124-
* a multiplier $\mu$ that weights "consumers" versus "producers" in a planner's welfare function, as described above in the main text
125-
* an $n \times 1$ vector $p$ of competitive equilibrium prices
126-
* an $n \times 1$ vector $c$ of competitive equilibrium quantities
127-
* **consumer surplus**
128-
* **producer surplus**
129-
130-
Now let's proceed to code.
131-
132-
```{code-cell} ipython3
133-
# import some packages
134-
import numpy as np
135-
import pandas as pd
136-
import matplotlib.pyplot as plt
137-
from scipy.linalg import inv
138-
```
111+
## Pure exchange economy
139112
140-
### Pure Exchange Economy
113+
Let's further explore a pure exchange economy with $n$ goods and $m$ people.
141114
142-
Let's first explore a pure exchange economy with $n$ goods and $m$ people.
115+
### Competitive equilibrium
143116
144117
We'll compute a competitive equilibrium.
145118
@@ -163,79 +136,40 @@ c_{i}=\Pi^{-1}b_{i}-(\Pi^{\top}\Pi)^{-1}\mu_{i}p
163136
$$
164137

165138

139+
### Designing some Python code
166140

167-
## Deducing a Representative Consumer
168-
169-
In the class of multiple consumer economies that we are studying here, it turns out that there
170-
exists a single **representative consumer** whose preferences and endowments can be deduced from lists of preferences and endowments for the separate individual consumers.
171-
172-
Consider a multiple consumer economy with initial distribution of wealth $W_i$ satisfying $\sum_i W_{i}=0$
173-
174-
We allow an initial redistribution of wealth.
175141

176-
We have the following objects
177-
178-
179-
- The demand curve:
180-
181-
$$
182-
c_{i}=\Pi^{-1}b_{i}-(\Pi^{\top}\Pi)^{-1}\mu_{i}p
183-
$$
184-
185-
- The marginal utility of wealth:
186-
187-
$$
188-
\mu_{i}=\frac{-W_{i}+p^{\top}\left(\Pi^{-1}b_{i}-e_{i}\right)}{p^{\top}(\Pi^{\top}\Pi)^{-1}p}
189-
$$
190-
191-
- Market clearing:
192-
193-
$$
194-
\sum c_{i}=\sum e_{i}
195-
$$
196-
197-
Denote aggregate consumption $\sum_i c_{i}=c$ and $\sum_i \mu_i = \mu$.
198-
199-
Market clearing requires
142+
Below we shall construct a Python class with the following attributes:
200143

201-
$$
202-
\Pi^{-1}\left(\sum_{i}b_{i}\right)-(\Pi^{\top}\Pi)^{-1}p\left(\sum_{i}\mu_{i}\right)=\sum_{i}e_{i}
203-
$$
204-
which, after a few steps, leads to
144+
* **Preferences** in the form of
205145

206-
$$
207-
p=\mu^{-1}\left(\Pi^{\top}b-\Pi^{\top}\Pi e\right)
208-
$$
146+
* an $n \times n$ positive definite matrix $\Pi$
147+
* an $n \times 1$ vector of bliss points $b$
209148

210-
where
149+
* **Endowments** in the form of
211150

212-
$$
213-
\mu = \sum_i\mu_{i}=\frac{0 + p^{\top}\left(\Pi^{-1}b-e\right)}{p^{\top}(\Pi^{\top}\Pi)^{-1}p}.
214-
$$
151+
* an $n \times 1$ vector $e$
152+
* a scalar "wealth" $W$ with default value $0$
215153

216-
Now consider the representative consumer economy specified above.
217154

218-
Denote the marginal utility of wealth of the representative consumer by $\tilde{\mu}$.
155+
The class will include a test to make sure that $b > > \Pi e $ and raise an exception if it is violated
156+
(at some threshold level we'd have to specify).
219157

220-
The demand function is
158+
* **A Person** in the form of a pair that consists of
221159

222-
$$
223-
c=\Pi^{-1}b-(\Pi^{\top}\Pi)^{-1}\tilde{\mu} p
224-
$$
160+
* **Preferences** and **Endowments**
225161

226-
Substituting this into the budget constraint gives
162+
* **A Pure Exchange Economy** will consist of
227163

228-
$$
229-
\tilde{\mu}=\frac{p^{\top}\left(\Pi^{-1}b-e\right)}{p^{\top}(\Pi^{\top}\Pi)^{-1}p}
230-
$$
164+
* a collection of $m$ **persons**
231165

232-
In an equilibrium $c=e$, so
166+
* $m=1$ for our single-agent economy
167+
* $m=2$ for our illustrations of a pure exchange economy
233168

234-
$$
235-
p=\tilde{\mu}^{-1}(\Pi^{\top}b-\Pi^{\top}\Pi e)
236-
$$
169+
* an equilibrium price vector $p$ (normalized somehow)
170+
* an equilibrium allocation $c^1, c^2, \ldots, c^m$ -- a collection of $m$ vectors of dimension $n \times 1$
237171

238-
Thus, we have verified that, up to choice of a numeraire in which to express absolute prices, the price vector in our representative consumer economy is the same as that in an underlying economy with multiple consumers.
172+
Now let's proceed to code.
239173

240174
```{code-cell} ipython3
241175
class ExchangeEconomy:
@@ -244,7 +178,7 @@ class ExchangeEconomy:
244178
bs,
245179
es,
246180
Ws=None,
247-
thres=4):
181+
thres=1.5):
248182
"""
249183
Set up the environment for an exchange economy
250184
@@ -253,12 +187,13 @@ class ExchangeEconomy:
253187
bs (list): all consumers' bliss points
254188
es (list): all consumers' endowments
255189
Ws (list): all consumers' wealth
190+
thres (float): a threshold set to test b >> Pi e violated
256191
"""
257192
n, m = Pi.shape[0], len(bs)
258193
259194
# check non-satiation
260195
for b, e in zip(bs, es):
261-
if np.min(b / np.max(Pi @ e)) <= 1.5:
196+
if np.min(b / np.max(Pi @ e)) <= thres:
262197
raise Exception('set bliss points further away')
263198
264199
if Ws == None:
@@ -305,11 +240,17 @@ class ExchangeEconomy:
305240
return p, c_s, mu_s
306241
```
307242

308-
### Example: Two-Person Economy **without** Production
309-
* Study how competitive equilibrium $p, c^1, c^2$ respond to different
243+
## Implementation
244+
245+
Next we use the class ``ExchangeEconomy`` defined above to study
246+
247+
* a two-person economy without production,
248+
* a dynamic economy, and
249+
* an economy with risk and arrow securities.
310250

311-
* $b^i$'s
312-
* $e^i$'s
251+
### Two-person economy without production
252+
253+
Here we tudy how competitive equilibrium $p, c^1, c^2$ respond to different $b^i$ and $e^i$, $i \in \{1, 2\}.
313254

314255
```{code-cell} ipython3
315256
Pi = np.array([[1, 0],
@@ -384,7 +325,7 @@ print('Competitive equilibrium price vector:', p)
384325
print('Competitive equilibrium allocation:', c_s)
385326
```
386327

387-
### A **Dynamic Economy**
328+
### A dynamic economy
388329

389330
Now let's use the tricks described above to study a dynamic economy, one with two periods.
390331

@@ -405,7 +346,7 @@ print('Competitive equilibrium price vector:', p)
405346
print('Competitive equilibrium allocation:', c_s)
406347
```
407348

408-
### Example: **Arrow Securities**
349+
### Risk economy with Arrow securities
409350

410351
We use the tricks described above to interpret $c_1, c_2$ as "Arrow securities" that are state-contingent claims to consumption goods.
411352

@@ -427,3 +368,76 @@ p, c_s, mu_s = EE_AS.competitive_equilibrium()
427368
print('Competitive equilibrium price vector:', p)
428369
print('Competitive equilibrium allocation:', c_s)
429370
```
371+
372+
## Deducing a Representative Consumer
373+
374+
In the class of multiple consumer economies that we are studying here, it turns out that there
375+
exists a single **representative consumer** whose preferences and endowments can be deduced from lists of preferences and endowments for the separate individual consumers.
376+
377+
Consider a multiple consumer economy with initial distribution of wealth $W_i$ satisfying $\sum_i W_{i}=0$
378+
379+
We allow an initial redistribution of wealth.
380+
381+
We have the following objects
382+
383+
384+
- The demand curve:
385+
386+
$$
387+
c_{i}=\Pi^{-1}b_{i}-(\Pi^{\top}\Pi)^{-1}\mu_{i}p
388+
$$
389+
390+
- The marginal utility of wealth:
391+
392+
$$
393+
\mu_{i}=\frac{-W_{i}+p^{\top}\left(\Pi^{-1}b_{i}-e_{i}\right)}{p^{\top}(\Pi^{\top}\Pi)^{-1}p}
394+
$$
395+
396+
- Market clearing:
397+
398+
$$
399+
\sum c_{i}=\sum e_{i}
400+
$$
401+
402+
Denote aggregate consumption $\sum_i c_{i}=c$ and $\sum_i \mu_i = \mu$.
403+
404+
Market clearing requires
405+
406+
$$
407+
\Pi^{-1}\left(\sum_{i}b_{i}\right)-(\Pi^{\top}\Pi)^{-1}p\left(\sum_{i}\mu_{i}\right)=\sum_{i}e_{i}
408+
$$
409+
which, after a few steps, leads to
410+
411+
$$
412+
p=\mu^{-1}\left(\Pi^{\top}b-\Pi^{\top}\Pi e\right)
413+
$$
414+
415+
where
416+
417+
$$
418+
\mu = \sum_i\mu_{i}=\frac{0 + p^{\top}\left(\Pi^{-1}b-e\right)}{p^{\top}(\Pi^{\top}\Pi)^{-1}p}.
419+
$$
420+
421+
Now consider the representative consumer economy specified above.
422+
423+
Denote the marginal utility of wealth of the representative consumer by $\tilde{\mu}$.
424+
425+
The demand function is
426+
427+
$$
428+
c=\Pi^{-1}b-(\Pi^{\top}\Pi)^{-1}\tilde{\mu} p
429+
$$
430+
431+
Substituting this into the budget constraint gives
432+
433+
$$
434+
\tilde{\mu}=\frac{p^{\top}\left(\Pi^{-1}b-e\right)}{p^{\top}(\Pi^{\top}\Pi)^{-1}p}
435+
$$
436+
437+
In an equilibrium $c=e$, so
438+
439+
$$
440+
p=\tilde{\mu}^{-1}(\Pi^{\top}b-\Pi^{\top}\Pi e)
441+
$$
442+
443+
Thus, we have verified that, up to choice of a numeraire in which to express absolute prices, the price vector in our representative consumer economy is the same as that in an underlying economy with multiple consumers.

0 commit comments

Comments
 (0)