Skip to content

Commit 42c5e2b

Browse files
committed
[cobweb] Update editorial suggestions
1 parent 3c5585a commit 42c5e2b

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

lectures/cobweb.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ because it shows the fundamental importance of *expectations*.
2424

2525
To give some idea of how the model operates, and why expectations matter, imagine the following scenario.
2626

27-
There is a market for soy beans, say, where prices and traded quantities
27+
There is a market for soybeans, say, where prices and traded quantities
2828
depend on the choices of buyers and sellers.
2929

3030
The buyers are represented by a demand curve --- they buy more at low prices
@@ -38,11 +38,11 @@ However, the sellers (who are farmers) need time to grow their crops.
3838
Suppose now that the price is currently high.
3939

4040
Seeing this high price, and perhaps expecting that the high price will remain
41-
for some time, the farmers plant many fields with soy beans.
41+
for some time, the farmers plant many fields with soybeans.
4242

4343
Next period the resulting high supply floods the market, causing the price to drop.
4444

45-
Seeing this low price, the farmers now shift out of soy beans, restricting
45+
Seeing this low price, the farmers now shift out of soybeans, restricting
4646
supply and causing the price to climb again.
4747

4848
You can imagine how these dynamics could cause cycles in prices and quantities
@@ -52,7 +52,7 @@ The cobweb model puts these ideas into equations so we can try to quantify
5252
them, and to study conditions under which cycles persist (or disappear).
5353

5454
In this lecture, we investigate and simulate the basic model under different
55-
assumptions regarding the way that produces form expectations.
55+
assumptions regarding the way that producers form expectations.
5656

5757
Our discussion and simulations draw on [high quality lectures](https://comp-econ.org/CEF_2013/downloads/Complex%20Econ%20Systems%20Lecture%20II.pdf) by [Cars Hommes](https://www.uva.nl/en/profile/h/o/c.h.hommes/c.h.hommes.html).
5858

@@ -70,7 +70,7 @@ import matplotlib.pyplot as plt
7070

7171
Early papers on the cobweb cycle include {cite}`cobweb_model` and {cite}`hog_cycle`.
7272

73-
The paper {cite}`hog_cycle` uses the cobweb theorem to explain the prices of hog in the US over 1920--1950
73+
The paper {cite}`hog_cycle` uses the cobweb theorem to explain the prices of hog in the US over 1920--1950.
7474

7575
The next plot replicates part of Figure 2 from that paper, which plots the price of hogs at yearly frequency.
7676

@@ -94,9 +94,9 @@ plt.show()
9494

9595
## The model
9696

97-
Let's return to our discussion of a hypothetical soy bean market, where price is determined by supply and demand.
97+
Let's return to our discussion of a hypothetical soybean market, where price is determined by supply and demand.
9898

99-
We suppose that demand for soy beans is given by
99+
We suppose that demand for soybeans is given by
100100

101101
$$
102102
D(p_t) = a - b p_t
@@ -106,15 +106,15 @@ where $a, b$ are nonnegative constants and $p_t$ is the spot (i.e, current marke
106106

107107
($D(p_t)$ is the quantity demanded in some fixed unit, such as thousands of tons.)
108108

109-
Because the crop of soy beans for time $t$ is planted at $t-1$, supply of soy beans at time $t$ depends on *expected* prices at time $t$, which we denote $p^e_{t-1}$.
109+
Because the crop of soybeans for time $t$ is planted at $t-1$, supply of soybeans at time $t$ depends on *expected* prices at time $t$, which we denote $p^t_{t-1}$.
110110

111111
We suppose that supply is nonlinear in expected prices, and takes the form
112112

113113
$$
114-
S(p^e_{t-1}) = \tanh(\lambda(p^e_{t-1} - c)) + d
114+
S(p^t_{t-1}) = \tanh(\lambda(p^t_{t-1} - c)) + d
115115
$$
116116

117-
where $\lambda$ is a positive constant and $c, d \geq 0$.
117+
where $\lambda$ is a positive constant, $c, d$ are nonnegative constants and $\tanh$ is a type of [hyperbolic function](https://en.wikipedia.org/wiki/Hyperbolic_functions).
118118

119119
Let's make a plot of supply and demand for particular choices of the parameter values.
120120

@@ -149,7 +149,7 @@ m = Market()
149149
fig, ax = plt.subplots()
150150
151151
ax.plot(p_grid, m.demand(p_grid), label="$D$")
152-
ax.plot(p_grid, m.supply(p_grid), label="S")
152+
ax.plot(p_grid, m.supply(p_grid), label="$S$")
153153
ax.set_xlabel("price")
154154
ax.set_ylabel("quantity")
155155
ax.legend()
@@ -160,13 +160,13 @@ plt.show()
160160
Market equilibrium requires that supply equals demand, or
161161

162162
$$
163-
a - b p_t = S(p^e_{t-1})
163+
a - b p_t = S(p^t_{t-1})
164164
$$
165165

166166
Rewriting in terms of $p_t$ gives
167167

168168
$$
169-
p_t = - \frac{1}{b} [S(p^e_{t-1}) - a]
169+
p_t = - \frac{1}{b} [S(p^t_{t-1}) - a]
170170
$$
171171

172172
Finally, to complete the model, we need to describe how price expectations are formed.
@@ -177,7 +177,7 @@ In particular, we suppose that
177177

178178
```{math}
179179
:label: p_et
180-
p^e_{t-1} = f(p_{t-1}, p_{t-2})
180+
p^t_{t-1} = f(p_{t-1}, p_{t-2})
181181
```
182182

183183
where $f$ is some function.
@@ -204,7 +204,7 @@ Let's start with naive expectations, which refers to the case where producers ex
204204

205205
In other words,
206206

207-
$$ p_{t-1}^e = p_{t-1} $$
207+
$$ p_{t-1}^t = p_{t-1} $$
208208

209209
Using {eq}`price_t`, we then have
210210

@@ -239,9 +239,9 @@ def g(model, current_price):
239239
return next_price
240240
```
241241

242-
Let's try to understand how prices will evolve using a 45 degree diagram, which is a tool for studying one-dimensional dynamics.
242+
Let's try to understand how prices will evolve using a 45-degree diagram, which is a tool for studying one-dimensional dynamics.
243243

244-
The function `plot45` defined below helps us draw the 45 degree diagram.
244+
The function `plot45` defined below helps us draw the 45-degree diagram.
245245

246246
```{code-cell} ipython3
247247
:tags: [hide-input]
@@ -277,7 +277,7 @@ def plot45(model, pmin, pmax, p0, num_arrows=5):
277277
278278
ax.plot(pgrid, g(model, pgrid), 'b-',
279279
lw=2, alpha=0.6, label='g')
280-
ax.plot(pgrid, pgrid, lw=1, alpha=0.7, label='45')
280+
ax.plot(pgrid, pgrid, lw=1, alpha=0.7, label='$45\degree$')
281281
282282
x = p0
283283
xticks = [pmin]
@@ -316,7 +316,7 @@ def plot45(model, pmin, pmax, p0, num_arrows=5):
316316
plt.show()
317317
```
318318

319-
Now we can set up a market and plot the 45 degree diagram.
319+
Now we can set up a market and plot the 45-degree diagram.
320320

321321
```{code-cell} ipython3
322322
m = Market()
@@ -326,21 +326,21 @@ m = Market()
326326
plot45(m, 0, 9, 2, num_arrows=3)
327327
```
328328

329-
The plot shows the function $g$ defined in {eq}`def_g` and the $45$ degree line.
329+
The plot shows the function $g$ defined in {eq}`def_g` and the $45\degree$ line.
330330

331331
Think of $ p_t $ as a value on the horizontal axis.
332332

333333
Since $p_{t+1} = g(p_t)$, we use the graph of $g$ to see $p_{t+1}$ on the vertical axis.
334334

335335
Clearly,
336336

337-
- If $ g $ lies above the 45 degree line at $p_t$, then we have $ p_{t+1} > p_t $.
338-
- If $ g $ lies below the 45 degree line at $p_t$, then we have $ p_{t+1} < p_t $.
339-
- If $ g $ hits the 45 degree line at $p_t$, then we have $ p_{t+1} = p_t $, so $ p_t $ is a steady state.
337+
- If $ g $ lies above the 45-degree line at $p_t$, then we have $ p_{t+1} > p_t $.
338+
- If $ g $ lies below the 45-degree line at $p_t$, then we have $ p_{t+1} < p_t $.
339+
- If $ g $ hits the 45-degree line at $p_t$, then we have $ p_{t+1} = p_t $, so $ p_t $ is a {ref}` steady state <scalar-dynam:steady-state>`.
340340

341341
Consider the sequence of prices starting at $p_0$, as shown in the figure.
342342

343-
We find $p_1$ on the vertical axis and then shift it to the horizontal axis using the 45 degree line (where values on the two axes are equal).
343+
We find $p_1$ on the vertical axis and then shift it to the horizontal axis using the 45-degree line (where values on the two axes are equal).
344344

345345
Then from $p_1$ we obtain $p_2$ and continue.
346346

@@ -408,15 +408,15 @@ That is,
408408

409409
```{math}
410410
:label: pe_adaptive
411-
p_{t-1}^e = \alpha p_{t-1} + (1-\alpha) p^e_{t-2}
411+
p_{t-1}^t = \alpha p_{t-1} + (1-\alpha) p^t_{t-2}
412412
\qquad (0 \leq \alpha \leq 1)
413413
```
414414

415415
Another way to write this is
416416

417417
```{math}
418418
:label: pe_adaptive_2
419-
p_{t-1}^e = p^e_{t-2} + \alpha (p_{t-1} - p_{t-2}^e)
419+
p_{t-1}^t = p^t_{t-2} + \alpha (p_{t-1} - p_{t-2}^t)
420420
```
421421

422422
This equation helps to show that expectations shift
@@ -427,7 +427,7 @@ This equation helps to show that expectations shift
427427
Using {eq}`pe_adaptive`, we obtain the dynamics
428428

429429
$$
430-
p_t = - \frac{1}{b} [ S(\alpha p_{t-1} + (1-\alpha) p^e_{t-2}) - a]
430+
p_t = - \frac{1}{b} [ S(\alpha p_{t-1} + (1-\alpha) p^t_{t-2}) - a]
431431
$$
432432

433433

@@ -464,7 +464,6 @@ def ts_price_plot_adaptive(model, p0, ts_length=10, α=[1.0, 0.9, 0.75]):
464464

465465
Let's call the function with prices starting at $p_0 = 5$.
466466

467-
TODO does this fit well in the page, even in the pdf? If not should it be stacked vertically?
468467

469468
```{code-cell} ipython3
470469
ts_price_plot_adaptive(m, 5, ts_length=30)
@@ -478,7 +477,6 @@ expectations, which stabilizes expected prices.
478477
This increased stability can be seen in the figures.
479478

480479

481-
TODO check / fix exercises
482480

483481
## Exercises
484482

@@ -547,7 +545,7 @@ That is,
547545

548546
```{math}
549547
:label: pe_blae
550-
p_{t-1}^e = \alpha p_{t-1} + (1-\alpha) p_{t-2}
548+
p_{t-1}^t = \alpha p_{t-1} + (1-\alpha) p_{t-2}
551549
```
552550

553551

0 commit comments

Comments
 (0)