Skip to content

Commit f4de55a

Browse files
committed
update according to feedback
1 parent dbaf0ba commit f4de55a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

lectures/morris_learn.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ On page 1122, {cite:t}`Morris1996` provides an argument that the limit as $T\ri
365365
selection algorithm that excludes additional equilibria that involve a Ponzi-scheme price component that Morris dismisses as fragile.
366366
```
367367

368-
We use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via:
368+
Following {prf:ref}`equilibrium_asset_price`, we use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via:
369369

370370
$$
371371
\tilde{p}(s,t) = \beta \max_{i\in\{1,2\}} \Bigl[ \mu_i(s,t) \{1 + \tilde{p}(s+1,t+1)\} + (1-\mu_i(s,t)) \tilde{p}(s,t+1) \Bigr]
@@ -471,7 +471,7 @@ Within this setting, we can reproduce two key figures reported in {cite:t}`Morri
471471

472472
```{code-cell} ipython3
473473
def normalized_price_two_agents(prior1, prior2, r, T=250):
474-
"""Return p(s,t,r) = r · \tilde p(s,t,r) for two traders."""
474+
"""Return p(s,t,r) = r \tilde p(s,t,r) for two traders."""
475475
β = 1.0 / (1.0 + r)
476476
price_array, *_ = price_learning_two_agents(prior1, prior2, β=β, T=T)
477477
return r * price_array
@@ -483,12 +483,12 @@ p00 = np.array([normalized_price_two_agents(
483483
priors[0], priors[1], r, T=300)[0,0]
484484
for r in r_grid])
485485
486-
plt.figure(figsize=(6,4))
487-
plt.plot(r_grid, p00)
488-
plt.xlabel('r')
489-
plt.ylabel(r'$p^*(0,0,r)$')
490-
plt.axhline(0.5, color='C1', linestyle='--')
491-
plt.title('Figure I: normalized price vs interest rate')
486+
fig, ax = plt.subplots()
487+
ax.plot(r_grid, p00)
488+
ax.set_xlabel(r'$r$')
489+
ax.set_ylabel(r'$p^*(0,0,r)$')
490+
ax.axhline(0.5, color='C1', linestyle='--')
491+
ax.set_title('Figure I: normalized price vs interest rate')
492492
plt.show()
493493
```
494494

@@ -510,18 +510,18 @@ t_vals = np.arange(0, 54, 2)
510510
s_vals = t_vals // 2
511511
y = np.array([p_mat[s, t] for s, t in zip(s_vals, t_vals)])
512512
513-
plt.figure(figsize=(6,4))
514-
plt.plot(t_vals, y)
515-
plt.xlabel('t')
516-
plt.ylabel(r'$p^*(t/2,t,0.05)$')
517-
plt.axhline(0.5, color='C1', linestyle='--')
518-
plt.title('Figure II: normalized price vs time (r=0.05)')
513+
fig, ax = plt.subplots()
514+
ax.plot(t_vals, y)
515+
ax.set_xlabel(r'$t$')
516+
ax.set_ylabel(r'$p^*(t/2,t,0.05)$')
517+
ax.axhline(0.5, color='C1', linestyle='--')
518+
ax.set_title('Figure II: normalized price vs time (r=0.05)')
519519
plt.show()
520520
521521
p0 = p_mat[0,0]
522-
mu0 = 0.5
522+
μ0 = 0.5
523523
print("Initial normalized premium at r=0.05 (%):",
524-
np.round(100 * (p0 / mu0 - 1.0), 2))
524+
np.round(100 * (p0 / μ0 - 1.0), 2))
525525
```
526526

527527
In the second figure, notice that:
@@ -534,7 +534,7 @@ In the second figure, notice that:
534534
The same recursion extends to any finite set of Beta priors $\{(a_i,b_i)\}_{i=1}^N$ by taking a max over $i$ each period.
535535

536536
```{code-cell} ipython3
537-
def price_learning(priors, β=.75, T=200):
537+
def price_learning(priors, β=0.75, T=200):
538538
"""
539539
N-trader version with heterogeneous Beta priors.
540540
"""
@@ -562,18 +562,18 @@ def price_learning(priors, β=.75, T=200):
562562
563563
return price_array
564564
565-
β = .75
565+
β = 0.75
566566
priors = [(1,1), (0.5,0.5), (3,2)]
567567
price_N = price_learning(priors, β=β, T=150)
568568
569569
# Compute valuations for each trader at (0,0)
570-
mu_vals = [posterior_mean(a, b, 0, 0) for a, b in priors]
571-
perp_vals = [(β / (1 - β)) * mu for mu in mu_vals]
570+
μ_vals = [posterior_mean(a, b, 0, 0) for a, b in priors]
571+
perp_vals = [(β / (1 - β)) * μ for μ in μ_vals]
572572
573573
print("Three-trader example at (s,t)=(0,0):")
574574
print(f"Price at (0,0) = {np.round(price_N[0,0], 6)}")
575575
print(f"\nTrader valuations:")
576-
for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1):
576+
for i, (μ, perp) in enumerate(zip(μ_vals, perp_vals), 1):
577577
print(f" Trader {i} = {np.round(perp, 6)}")
578578
```
579579

0 commit comments

Comments
 (0)