From b3365bef2d7145e7e6e0a2459d3bf6d841068f30 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Wed, 15 Oct 2025 23:04:21 +1100 Subject: [PATCH 01/20] update new section --- lectures/_static/quant-econ.bib | 10 + lectures/harrison_kreps.md | 527 ++++++++++++++++++++++++++++++-- 2 files changed, 518 insertions(+), 19 deletions(-) diff --git a/lectures/_static/quant-econ.bib b/lectures/_static/quant-econ.bib index 0fd46856d..7affa7193 100644 --- a/lectures/_static/quant-econ.bib +++ b/lectures/_static/quant-econ.bib @@ -1378,6 +1378,16 @@ @article{HarrKreps1978 pages = {323-336} } +@article{Morris1996, + author = {Stephen Morris}, + title = {Speculative Investor Behavior and Learning}, + journal = {The Quarterly Journal of Economics}, + year = {1996}, + volume = {111}, + number = {4}, + pages = {1111-1133} +} + @article{pal2013, title = {Fitted value function iteration with probability one contractions}, author = {P{\'a}l, Jen{\H{o}} and Stachurski, John}, diff --git a/lectures/harrison_kreps.md b/lectures/harrison_kreps.md index ee94938fe..227dc3a00 100644 --- a/lectures/harrison_kreps.md +++ b/lectures/harrison_kreps.md @@ -3,10 +3,12 @@ jupytext: text_representation: extension: .md format_name: myst + format_version: 0.13 + jupytext_version: 1.17.1 kernelspec: - display_name: Python 3 - language: python name: python3 + display_name: Python 3 (ipykernel) + language: python --- (harrison_kreps)= @@ -29,10 +31,9 @@ kernelspec: In addition to what's in Anaconda, this lecture uses following libraries: -```{code-cell} ipython ---- -tags: [hide-output] ---- +```{code-cell} ipython3 +:tags: [hide-output] + !pip install quantecon ``` @@ -51,10 +52,11 @@ The model features Let's start with some standard imports: -```{code-cell} ipython +```{code-cell} ipython3 import numpy as np import quantecon as qe import scipy.linalg as la +import matplotlib.pyplot as plt ``` ### References @@ -131,7 +133,7 @@ But in state $1$, a type $a$ investor is more pessimistic about next period's The stationary (i.e., invariant) distributions of these two matrices can be calculated as follows: -```{code-cell} python3 +```{code-cell} ipython3 qa = np.array([[1/2, 1/2], [2/3, 1/3]]) qb = np.array([[2/3, 1/3], [1/4, 3/4]]) mca = qe.MarkovChain(qa) @@ -139,7 +141,7 @@ mcb = qe.MarkovChain(qb) mca.stationary_distributions ``` -```{code-cell} python3 +```{code-cell} ipython3 mcb.stationary_distributions ``` @@ -270,7 +272,7 @@ The first two rows of the table report $p_a(s)$ and $p_b(s)$. Here's a function that can be used to compute these values -```{code-cell} python3 +```{code-cell} ipython3 def price_single_beliefs(transition, dividend_payoff, β=.75): """ Function to Solve Single Beliefs @@ -399,7 +401,7 @@ Investors of type $a$ want to sell the asset in state $1$ while investors of typ Here's code to solve for $\bar p$, $\hat p_a$ and $\hat p_b$ using the iterative method described above -```{code-cell} python3 +```{code-cell} ipython3 def price_optimistic_beliefs(transitions, dividend_payoff, β=.75, max_iter=50000, tol=1e-16): """ @@ -444,8 +446,8 @@ Instead of equation {eq}`hakr2`, the equilibrium price satisfies \check p(s) = \beta \min \left\{ - P_a(s,1) \check p(0) + P_a(s,1) ( 1 + \check p(1)) ,\; - P_b(s,1) \check p(0) + P_b(s,1) ( 1 + \check p(1)) + P_a(s,0) \check p(0) + P_a(s,1) ( 1 + \check p(1)) ,\; + P_b(s,0) \check p(0) + P_b(s,1) ( 1 + \check p(1)) \right\} ``` @@ -467,7 +469,7 @@ Constraints on short sales prevent that. Here's code to solve for $\check p$ using iteration -```{code-cell} python3 +```{code-cell} ipython3 def price_pessimistic_beliefs(transitions, dividend_payoff, β=.75, max_iter=50000, tol=1e-16): """ @@ -512,8 +514,6 @@ Scheinkman extracts insights about the effects of financial regulations on bubbl He emphasizes how limiting short sales and limiting leverage have opposite effects. -## Exercises - ```{exercise-start} :label: hk_ex1 ``` @@ -570,7 +570,7 @@ We'll use these transition matrices when we present our solution of exercise 1 b First, we will obtain equilibrium price vectors with homogeneous beliefs, including when all investors are optimistic or pessimistic. -```{code-cell} python3 +```{code-cell} ipython3 qa = np.array([[1/2, 1/2], [2/3, 1/3]]) # Type a transition matrix qb = np.array([[2/3, 1/3], [1/4, 3/4]]) # Type b transition matrix # Optimistic investor transition matrix @@ -595,7 +595,7 @@ for transition, label in zip(transitions, labels): We will use the price_optimistic_beliefs function to find the price under heterogeneous beliefs. -```{code-cell} python3 +```{code-cell} ipython3 opt_beliefs = price_optimistic_beliefs([qa, qb], dividendreturn) labels = ['p_optimistic', 'p_hat_a', 'p_hat_b'] @@ -614,4 +614,493 @@ with **permanently optimistic** investors - this is due to the marginal investor ```{solution-end} ``` -[^f1]: By assuming that both types of agents always have "deep enough pockets" to purchase all of the asset, the model takes wealth dynamics off the table. The Harrison-Kreps model generates high trading volume when the state changes either from 0 to 1 or from 1 to 0. \ No newline at end of file +## Learning and speculation + +This section connects Harrison–Kreps pricing with a learning model due to {cite:t}`Morris1996`. + +Morris shows how heterogeneous Bayesian learning about a risky asset's dividend probability creates speculative trade and price bubbles, even when all traders are rational and observe the same dividend history. + +In this model, traders have heterogeneous priors over the dividend probability. + +The risky asset pays i.i.d. dividends $d_{t+1} \in \{0,1\}$ with unknown success probability $\theta \in (0,1)$. + +There is a finite set $\mathcal{I}$ of risk-neutral traders. + +Traders buy and sell the risky asset in competitive markets each period $t = 0, 1, 2, \ldots$ after dividends are paid. + +Traders face a short-sale constraint: they cannot sell the risky asset short. + +All traders have sufficient wealth to purchase the risky asset as in the previous sections. + +All traders observe the full dividend history $(d_1, d_2, \ldots, d_t)$ and update beliefs by Bayes' rule, but they have heterogeneous priors over $\theta$. + +### Beta prior specification + +For tractability, assume trader $i$ has a Beta prior over the dividend probability + +$$ +\theta \sim \text{Beta}(a_i, b_i) +$$ + +where $a_i, b_i > 0$ are the prior parameters. + +```{note} +The definition of Beta distribution can be found in {doc}`divergence_measures`. +``` + +Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid (i.e., $s$ successes and $t-s$ failures). By Bayes' rule, the posterior density over $\theta$ is: + +$$ +\pi_i(\theta \mid s, t) = \frac{\theta^s (1-\theta)^{t-s} \pi_i(\theta)}{\int_0^1 \theta^s (1-\theta)^{t-s} \pi_i(\theta) d\theta} +$$ + +where $\pi_i(\theta)$ is trader $i$'s prior density. + +```{note} +The Beta distribution is the conjugate prior for the Binomial likelihood. + +When the prior is $\text{Beta}(a_i, b_i)$ and we observe $s$ successes in $t$ trials, the posterior is $\text{Beta}(a_i+s, b_i+t-s)$. +``` + +The posterior mean (or expected dividend probability) is: + +$$ +\mu_i(s,t) = \int_0^1 \theta \pi_i(\theta \mid s, t) d\theta += \mathbb{E}[\text{Beta}(a_i+s, b_i+t-s)] = \frac{a_i + s}{a_i + b_i + t} +$$ + +Morris refers to $\mu_i(s,t)$ as trader $i$'s **fundamental valuation** of the asset after history $(s,t)$. + +This is the probability trader $i$ assigns to receiving a dividend next period, which reflects their updated belief about $\theta$. + +### Market prices with learning + +Fundamental valuations reflect the expected value to each trader of holding the asset *forever*. + +However, in a market where the asset can be resold, traders take into account the possibility of selling at a price higher than their fundamental valuation in some future state. + +```{prf:definition} Most Optimistic Valuation +:label: most_optimistic_valuation + +After history $(s,t)$, the *most optimistic fundamental valuation* is: + +$$ +\mu^*(s,t) = \max_{i \in \mathcal{I}} \mu_i(s,t) +$$ +``` + +```{prf:definition} Equilibrium Asset Price +:label: equilibrium_asset_price + +Write $\tilde{p}(s,t,r)$ for the competitive equilibrium price of the risky asset (in current dollars) after history $(s,t)$ when the interest rate is $r$. + +The equilibrium price satisfies: + +$$ +\tilde{p}(s,t,r) = \frac{1}{1+r} \Bigl[ \mu^*(s,t) \{1 + \tilde{p}(s+1,t+1,r)\} ++ (1 - \mu^*(s,t)) \tilde{p}(s,t+1,r) \Bigr] +$$ +``` + +The equilibrium price equals the highest expected discounted return among all traders from holding the asset to the next period. + +```{prf:definition} Normalized Price +:label: normalized_price + +The normalized price is defined as: + +$$ +p(s,t,r) = r \tilde{p}(s,t,r) +$$ + +Since the current dollar price of the riskless asset is $1/r$, this represents the price of the risky asset in terms of the riskless asset. +``` + +Substituting into the equilibrium condition gives: + +$$ +p(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} +\Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) \Bigr] +$$ + +or equivalently: + +$$ +p(s,t,r) = \mu^*(s,t) + \frac{r}{1+r} +\Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) - \mu^*(s,t) \Bigr] +$$ + +Following Harrison and Kreps, a price scheme satisfying the equilibrium condition can be computed recursively. + +Set $p^0(s,t,r) = 0$ for all $(s,t,r)$, and define $p^{n+1}(s,t,r)$ by: + +$$ +p^{n+1}(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} +\Bigl[ \mu^*(s,t) p^n(s+1,t+1,r) + (1 - \mu^*(s,t)) p^n(s,t+1,r) \Bigr] +$$ + +The sequence $\{p^n(s,t,r)\}$ converges to the equilibrium price $p(s,t,r)$. + +```{prf:definition} Speculative Premium +:label: speculative_premium + +When the identity of the most optimistic trader can switch with future dividend realizations, the market price exceeds *every* trader's fundamental valuation. + +In normalized units: + +$$ +p(s,t,r) > \mu_i(s,t) \quad \text{for all } i \in \mathcal{I} +$$ + +The **speculative premium** for trader $i$ is: + +$$ +p(s,t,r) - \mu_i(s,t) > 0 +$$ +``` + + +### Two Traders + +We now focus on the case with two traders having priors $(a_1,b_1)$ and $(a_2,b_2)$. + +```{prf:definition} Rate Dominance (Beta Priors) +:label: rate_dominance_beta + +Trader 1 **rate-dominates** trader 2 if: + +$$ +a_1 \ge a_2 \quad \text{and} \quad b_1 \le b_2 +$$ +``` + +```{prf:theorem} Global Optimist (Two Traders) +:label: two_trader_optimist + +For two traders with Beta priors: + +1. If trader 1 rate-dominates trader 2, then trader 1 is a **global optimist**: $\mu_1(s,t) \ge \mu_2(s,t)$ for all histories $(s,t)$ +2. In this case, $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$. There is **no speculative premium** +``` + +When neither trader rate-dominates the other, the identity of the most optimistic trader can switch with dividend data. + +In this perpetual switching case, the price strictly exceeds both traders' fundamental valuations before learning converges: + +$$ +p(s,t,r) > \max\{\mu_1(s,t), \mu_2(s,t)\} +$$ + +This is consistent with our discussion about the expectation of future resale opportunities +creating a speculative premium. + +### Implementation + +For computational tractability, we work with a finite horizon $T$ and solve by backward induction. + +We use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via: + +$$ +\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] +$$ + +The terminal condition $\tilde{p}(s,T)$ is set equal to the perpetuity value under the most optimistic belief. + +```{code-cell} ipython3 +def posterior_mean(a, b, s, t): + """ + Compute posterior mean μ_i(s,t) for Beta(a, b) prior. + """ + return (a + s) / (a + b + t) + +def perpetuity_value(a, b, s, t, β=.75): + """ + Compute perpetuity value (β/(1-β)) * μ_i(s,t). + """ + return (β / (1 - β)) * posterior_mean(a, b, s, t) + +def price_learning_two_agents(prior1, prior2, β=.75, T=200): + """ + Compute \tilde p(s,t) for two Beta-prior traders via backward induction. + """ + a1, b1 = prior1 + a2, b2 = prior2 + price_array = np.zeros((T+1, T+1)) + + # Terminal condition: set to perpetuity value under max belief + for s in range(T+1): + perp1 = perpetuity_value(a1, b1, s, T, β) + perp2 = perpetuity_value(a2, b2, s, T, β) + price_array[s, T] = max(perp1, perp2) + + # Backward induction + for t in range(T-1, -1, -1): + for s in range(t, -1, -1): + μ1 = posterior_mean(a1, b1, s, t) + μ2 = posterior_mean(a2, b2, s, t) + + # One-step continuation values under each trader's beliefs + cont1 = μ1 * (1.0 + price_array[s+1, t+1]) \ + + (1.0 - μ1) * price_array[s, t+1] + cont2 = μ2 * (1.0 + price_array[s+1, t+1]) \ + + (1.0 - μ2) * price_array[s, t+1] + price_array[s, t] = β * max(cont1, cont2) + + def μ1_fun(s, t): + return posterior_mean(a1, b1, s, t) + def μ2_fun(s, t): + return posterior_mean(a2, b2, s, t) + + return price_array, μ1_fun, μ2_fun +``` + +#### Case A: global optimist (no premium) + +Pick priors with rate dominance, e.g., trader 1: $\text{Beta}(a_1,b_1)=(2,1)$ and trader 2: $(a_2,b_2)=(1,2)$. + +Trader 1 is the global optimist, so the normalized price equals trader 1's fundamental valuation: $p(s,t,r) = \mu_1(s,t)$. + +```{code-cell} ipython3 +β = 0.75 +price_go, μ1_go, μ2_go = price_learning_two_agents((2,1), (1,2), β=β, T=150) + +perpetuity_1 = (β / (1 - β)) * μ1_go(0, 0) +perpetuity_2 = (β / (1 - β)) * μ2_go(0, 0) + +print("Price at (0, 0) =", price_go[0,0]) +print("Valuation of trader 1 at (0, 0) =", perpetuity_1) +print("Valuation of trader 2 at (0, 0) =", perpetuity_2) +``` + +The price equals trader 1's perpetuity value. + +#### Case B: perpetual switching (positive premium) + +Now assume trader 1 has $\text{Beta}(1,1)$, trader 2 has $\text{Beta}(1/2,1/2)$. + +These produce crossing posteriors, so there is no global optimist and the price exceeds both fundamentals early on. + +```{code-cell} ipython3 +β = .75 +price_ps, μ1_ps, μ2_ps = price_learning_two_agents((1,1), (0.5,0.5), β=β, T=200) + +price_00 = price_ps[0,0] +μ1_00 = μ1_ps(0,0) +μ2_00 = μ2_ps(0,0) + +perpetuity_1 = (β / (1 - β)) * μ1_ps(0, 0) +perpetuity_2 = (β / (1 - β)) * μ2_ps(0, 0) + +print("Price at (0, 0) =", np.round(price_00, 6)) +print("Valuation of trader 1 at (0, 0) =", perpetuity_1) +print("Valuation of trader 2 at (0, 0) =", perpetuity_2) +``` + +The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as data arrive. + +Under this setting we reproduce the two key figures reported in {cite:t}`Morris1996` + +```{code-cell} ipython3 +def normalized_price_two_agents(prior1, prior2, r, T=250): + """Return p(s,t,r) = r · \tilde p(s,t,r) for two traders.""" + β = 1.0 / (1.0 + r) + price_array, *_ = price_learning_two_agents(prior1, prior2, β=β, T=T) + return r * price_array + +# Figure I: p*(0,0,r) as a function of r +r_grid = np.linspace(1e-3, 5.0, 200) +priors = ((1,1), (0.5,0.5)) +p00 = np.array([normalized_price_two_agents( + priors[0], priors[1], r, T=300)[0,0] + for r in r_grid]) + +plt.figure(figsize=(6,4)) +plt.plot(r_grid, p00, 'k-') +plt.xlabel('r') +plt.ylabel(r'$p^*(0,0,r)$') +plt.title('Figure I: Normalized Price vs Interest Rate') +plt.show() + +# Figure II: p*(t/2,t,0.05) as a function of t +r = 0.05 +T = 60 +p_mat = normalized_price_two_agents(priors[0], priors[1], r, T=T) +t_vals = np.arange(0, 54, 2) +s_vals = t_vals // 2 +y = np.array([p_mat[s, t] for s, t in zip(s_vals, t_vals)]) + +plt.figure(figsize=(6,4)) +plt.plot(t_vals, y, 'k-') +plt.xlabel('t') +plt.ylabel(r'$p^*(t/2,t,0.05)$') +plt.title('Figure II: Normalized Price vs Time (r=0.05)') +plt.show() + +p0 = p_mat[0,0] +mu0 = 0.5 +print("Initial normalized premium at r=0.05 (%):", + np.round(100 * (p0 / mu0 - 1.0), 2)) +``` + +Since no trader is a global optimist. + +In the first figure, we can see: + +- The resale option pushes the normalized price $p*(0,0,r)$ above fundamentals (0.5) for any finite $r$. + +- As $r$ increases ($\beta$ decreases), the option value fades and $p*(0,0,r) \to 0.5$. + +- At $r = 0.05$ the premium is about $8–9\%$, consistent with Morris (1996, Section IV). + +In the second figure, we can see: + +- Along the symmetric path $s = t/2$, both traders’ fundamentals equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. + + +### General N–trader extension + +The same recursion extends to any finite set of Beta priors $\{(a_i,b_i)\}_{i=1}^N$ by taking the max over $i$ each period. + +```{code-cell} ipython3 +def price_learning(priors, β=.75, T=200): + """ + N-trader version with heterogeneous Beta priors. + """ + price_array = np.zeros((T+1, T+1)) + + def perp_i(i, s, t): + a, b = priors[i] + return perpetuity_value(a, b, s, t, β) + + # Terminal condition + for s in range(T+1): + price_array[s, T] = max( + perp_i(i, s, T) for i in range(len(priors))) + + # Backward induction + for t in range(T-1, -1, -1): + for s in range(t, -1, -1): + conts = [] + for (a, b) in priors: + μ = posterior_mean(a, b, s, t) + conts.append(μ * + (1.0 + price_array[s+1, t+1]) + + (1.0 - μ) * price_array[s, t+1]) + price_array[s, t] = β * max(conts) + + return price_array + +β = .75 +priors = [(1,1), (0.5,0.5), (3,2)] +price_N = price_learning(priors, β=β, T=150) + +# Compute valuations for each trader at (0,0) +mu_vals = [posterior_mean(a, b, 0, 0) for a, b in priors] +perp_vals = [(β / (1 - β)) * mu for mu in mu_vals] + +print("Three-trader example at (s,t)=(0,0):") +print(f"Price at (0,0) = {np.round(price_N[0,0], 6)}") +print(f"\nTrader valuations:") +for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): + print(f" Trader {i} = {np.round(perp, 6)}") +``` + +From the trader valuation, we can see that the asset price is above all trader's valuation. + +Morris tells us that rate dominance exists in this case. + +Let's verify using the code below: + +```{code-cell} ipython3 +# Check for rate dominance +dominant = None +for i in range(len(priors)): + is_dom = all(priors[i][0] >= priors[j][0] and priors[i][1] <= priors[j][1] + for j in range(len(priors)) if i != j) + if is_dom: + dominant = i + break + +if dominant is not None: + print(f"\nTrader {dominant+1} is the global optimist (rate-dominant)") +else: + print(f"\nNo global optimist and speculative premium exists") +``` + +Indeed, there is global optimist and speculative premium exists. + +```{exercise-start} +:label: hk_ex3 +``` + +Morris {cite}`Morris1996` provides a sharp characterization of when speculative bubbles arise. + +The key condition is that there is no **global optimist**. + +In this exercise, you will verify this condition for the following sets of traders with Beta priors: + +1. Trader 1: $\text{Beta}(2,1)$, Trader 2: $\text{Beta}(1,2)$ +2. Trader 1: $\text{Beta}(1,1)$, Trader 2: $\text{Beta}(1/2,1/2)$ +3. Trader 1: $\text{Beta}(3,1)$, Trader 2: $\text{Beta}(2,1)$, Trader 3: $\text{Beta}(1,2)$ +4. Trader 1: $\text{Beta}(1,1)$, Trader 2: $\text{Beta}(1/2,1/2)$, Trader 3: $\text{Beta}(3/2,3/2)$ + +```{exercise-end} +``` + +```{solution-start} hk_ex3 +:class: dropdown +``` + +Here is one solution: + +```{code-cell} ipython3 +def check_rate_dominance(priors): + """ + Check if any trader rate-dominates all others. + """ + N = len(priors) + + for i in range(N): + a_i, b_i = priors[i] + is_dominant = True + + for j in range(N): + if i == j: + continue + a_j, b_j = priors[j] + + # Check rate dominance condition + if not (a_i >= a_j and b_i <= b_j): + is_dominant = False + break + + if is_dominant: + return i + + return None + +# Test cases +test_cases = [ + ([(2, 1), (1, 2)], "Global optimist exists"), + ([(1, 1), (0.5, 0.5)], "Perpetual switching"), + ([(3, 1), (2, 1), (1, 2)], "Three traders with dominant"), + ([(1, 1), (0.5, 0.5), (1.5, 1.5)], "Three traders, no dominant") +] + +for priors, description in test_cases: + dominant = check_rate_dominance(priors) + + print(f"\n{description}") + print(f"Priors: {priors}") + print("=="*8) + if dominant is not None: + print(f"Trader {dominant+1} is the global optimist (rate-dominant)") + else: + print(f"No global optimist exists") + print("=="*8 + "\n") +``` + +```{solution-end} +``` + +[^f1]: By assuming that both types of agents always have "deep enough pockets" to purchase all of the asset, the model takes wealth dynamics off the table. The Harrison-Kreps model generates high trading volume when the state changes either from 0 to 1 or from 1 to 0. From f4f187dcf033bfa63d5c1a82fb6d37dddde87722 Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Wed, 15 Oct 2025 15:27:36 -0400 Subject: [PATCH 02/20] Tom's minor edits to Harrison-Kreps lecture --- lectures/harrison_kreps.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/lectures/harrison_kreps.md b/lectures/harrison_kreps.md index 227dc3a00..bad0c3593 100644 --- a/lectures/harrison_kreps.md +++ b/lectures/harrison_kreps.md @@ -614,15 +614,33 @@ with **permanently optimistic** investors - this is due to the marginal investor ```{solution-end} ``` -## Learning and speculation +## Learning -This section connects Harrison–Kreps pricing with a learning model due to {cite:t}`Morris1996`. +This section describe how {cite:t}`Morris1996` modified the Harrison–Kreps{cite}`HarrKreps1978` model. -Morris shows how heterogeneous Bayesian learning about a risky asset's dividend probability creates speculative trade and price bubbles, even when all traders are rational and observe the same dividend history. +Harrison and Kreps assumed dogmatic traders with hard-wired beliefs. -In this model, traders have heterogeneous priors over the dividend probability. +Morris replaced them with traders who use Bayes' Law to update their beliefs about prospective dividends. -The risky asset pays i.i.d. dividends $d_{t+1} \in \{0,1\}$ with unknown success probability $\theta \in (0,1)$. +In Morris's model, all traders share the same manifold of statistical model for prospective dividends. + +All observe the same dividend histories. + +All use Bayes' Law. + +But they might have different initial prior distributions over the parameter that indexes a common manifold of statistical models. + + +By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogenous beliefs. + +Along identical histories of dividends, traders have different posterior distributions for prospective dividends. + +Those differences set the stage for possible speculation and price bubbles. + +### The setting + + +The risky asset pays i.i.d. dividends $d_{t+1} \in \{0,1\}$ with unknown probability $\theta \in (0,1)$ that the dividend equals $1$. There is a finite set $\mathcal{I}$ of risk-neutral traders. From da2e9aa743cec9cf495086766416ed8be0cc7c23 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Thu, 16 Oct 2025 17:30:39 +1100 Subject: [PATCH 03/20] update --- lectures/harrison_kreps.md | 135 ++++++++++++++++++++++++++++++++++--- 1 file changed, 125 insertions(+), 10 deletions(-) diff --git a/lectures/harrison_kreps.md b/lectures/harrison_kreps.md index 87eed853e..28718ec34 100644 --- a/lectures/harrison_kreps.md +++ b/lectures/harrison_kreps.md @@ -4,7 +4,7 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.17.1 + jupytext_version: 1.17.3 kernelspec: name: python3 display_name: Python 3 (ipykernel) @@ -57,6 +57,8 @@ import numpy as np import quantecon as qe import scipy.linalg as la import matplotlib.pyplot as plt +import math +from functools import lru_cache ``` ### References @@ -666,7 +668,9 @@ where $a_i, b_i > 0$ are the prior parameters. The definition of Beta distribution can be found in {doc}`divergence_measures`. ``` -Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid (i.e., $s$ successes and $t-s$ failures). By Bayes' rule, the posterior density over $\theta$ is: +Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid (i.e., $s$ successes and $t-s$ failures). + +By Bayes' rule, the posterior density over $\theta$ is: $$ \pi_i(\theta \mid s, t) = \frac{\theta^s (1-\theta)^{t-s} \pi_i(\theta)}{\int_0^1 \theta^s (1-\theta)^{t-s} \pi_i(\theta) d\theta} @@ -788,7 +792,7 @@ We now focus on the case with two traders having priors $(a_1,b_1)$ and $(a_2,b_ Trader 1 **rate-dominates** trader 2 if: $$ -a_1 \ge a_2 \quad \text{and} \quad b_1 \le b_2 +a_1 \geq a_2 \quad \text{and} \quad b_1 \leq b_2 $$ ``` @@ -797,7 +801,7 @@ $$ For two traders with Beta priors: -1. If trader 1 rate-dominates trader 2, then trader 1 is a **global optimist**: $\mu_1(s,t) \ge \mu_2(s,t)$ for all histories $(s,t)$ +1. If trader 1 rate-dominates trader 2, then trader 1 is a **global optimist**: $\mu_1(s,t) \geq \mu_2(s,t)$ for all histories $(s,t)$ 2. In this case, $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$. There is **no speculative premium** ``` @@ -960,11 +964,9 @@ print("Initial normalized premium at r=0.05 (%):", np.round(100 * (p0 / mu0 - 1.0), 2)) ``` -Since no trader is a global optimist. - In the first figure, we can see: -- The resale option pushes the normalized price $p*(0,0,r)$ above fundamentals (0.5) for any finite $r$. +- The resale option pushes the normalized price $p*(0,0,r)$ above fundamentals $(0.5)$ for any finite $r$. - As $r$ increases ($\beta$ decreases), the option value fades and $p*(0,0,r) \to 0.5$. @@ -1027,10 +1029,9 @@ From the trader valuation, we can see that the asset price is above all trader's Morris tells us that rate dominance exists in this case. -Let's verify using the code below: +Let's verify using the code below ```{code-cell} ipython3 -# Check for rate dominance dominant = None for i in range(len(priors)): is_dom = all(priors[i][0] >= priors[j][0] and priors[i][1] <= priors[j][1] @@ -1121,4 +1122,118 @@ for priors, description in test_cases: ```{solution-end} ``` -[^f1]: By assuming that both types of agents always have "deep enough pockets" to purchase all of the asset, the model takes wealth dynamics off the table. The Harrison-Kreps model generates high trading volume when the state changes either from 0 to 1 or from 1 to 0. \ No newline at end of file +#### Extension: fixed-point iteration + +In this case, we explore if we can compute the learning model can +be computated via pure fixed-point iteration without introducing a terminal date $T$ or referencing calendar time $t$. + +That is, we want to compute the infinite-horizon price $p(s,t,r)$ at a given starting posterior without truncating the horizon. + +Different from the previous sections, the state is just the vector of posterior parameters, which evolve deterministically with success/failure data. + +Let the state be $x = ((a_1,b_1),\ldots,(a_N,b_N))$. + +After a success, posteriors update to $x^+ = ((a_1+1,b_1),\ldots,(a_N+1,b_N))$; after a failure, to $x^- = ((a_1,b_1+1),\ldots,(a_N,b_N+1))$. + +Define + +$$ +(T f)(x) = \beta \max_{1\leq i\leq N} \Big[ \mu_i(x) \{1 + f(x^+)\} + (1-\mu_i(x)) f(x^-) \Big], +$$ + +where $\mu_i(x) = \dfrac{a_i}{a_i+b_i}$. For $\beta\in(0,1)$, $T$ is a contraction on bounded functions and has a unique fixed point $f^*$. + +To evaluate $f^*(x_0)$ at a given starting posterior $x_0$, we use truncated expansion $f^{(n)}$ with base $f^{(0)}\equiv 0$ and the recursive definition $f^{(n+1)} = T f^{(n)}$. + +A simple tail bound shows + +$$ +\|f^* - f^{(n)}\|_\infty \leq \frac{\beta^{n}}{1-\beta}, +$$ + +so choosing $n$ with $\beta^{n}/(1-\beta) \leq \varepsilon$ yields an $\varepsilon$-accurate value at $x_0$ without any terminal boundary. + +The computation below uses memoization over the posterior-parameter state to avoid redundant work. + +```{code-cell} ipython3 +def hk_required_depth(β=0.75, tol=1e-8): + """Smallest n with β^n/(1-β) <= tol.""" + num = math.log(max(tol * (1.0 - β), 1e-300)) + den = math.log(β) + n = math.ceil(num / den) + return max(0, n) + +def hk_price_fixedpoint(priors, β=0.75, tol=1e-8, normalized=False): + """ + Compute infinite-horizon HK price at starting posteriors `priors` via + truncated fixed-point iteration f^{(n)} with tail bound β^n/(1-β) <= tol. + """ + + start = tuple((float(a), float(b)) for (a, b) in priors) + N = len(start) + n = hk_required_depth(β=β, tol=tol) + + def step_success(state): + return tuple((a + 1.0, b) for (a, b) in state) + def step_failure(state): + return tuple((a, b + 1.0) for (a, b) in state) + + @lru_cache(maxsize=None) + def V(state, depth): + if depth <= 0: + return 0.0 + + # Compute continuation values once per state + s_succ = step_success(state) + s_fail = step_failure(state) + v_succ = V(s_succ, depth - 1) + v_fail = V(s_fail, depth - 1) + + # Posterior means for each trader at this state + cont_max = -np.inf + for i in range(N): + a_i, b_i = state[i] + μ_i = a_i / (a_i + b_i) + cont_i = μ_i * (1.0 + v_succ) + (1.0 - μ_i) * v_fail + if cont_i > cont_max: + cont_max = cont_i + return β * cont_max + + val = V(start, n) + tail = (β**n) / (1.0 - β) + if normalized: + r = (1.0 - β) / β + val = r * val + tail = r * tail + info = {"depth": n, "tail_bound": tail} + return val, info + +# Quick comparison: two traders +β = 0.75 +priors_2 = [(1, 1), (0.5, 0.5)] +v_fp, info_fp = hk_price_fixedpoint(priors_2, β=β, tol=1e-10) +print("Two agent crossing:\n price(0,0) =", np.round(v_fp, 8), + "depth:", info_fp["depth"], + "tail<=", info_fp["tail_bound"]) + +# N-trader example +priors_3 = [(1,1), (0.5,0.5), (3,2)] +v3_fp, info3_fp = hk_price_fixedpoint(priors_3, β=β, tol=1e-10) +print("Three agent:\n price(0,0) =", np.round(v3_fp, 8), + "depth:", info3_fp["depth"], + "tail<=", info3_fp["tail_bound"]) +``` + +We can also recover each of the two-trader examples above. + +```{code-cell} ipython3 +round(hk_price_fixedpoint([(1, 1)], β=β, tol=1e-10)[0], 3) +``` + +```{code-cell} ipython3 +round(hk_price_fixedpoint([(0.5, 0.5)], β=β, tol=1e-10)[0], 3) +``` + +This approach matches the original Harrison–Kreps scheme as it iterates the fixed-point operator on the belief state directly. + +[^f1]: By assuming that both types of agents always have "deep enough pockets" to purchase all of the asset, the model takes wealth dynamics off the table. The Harrison-Kreps model generates high trading volume when the state changes either from 0 to 1 or from 1 to 0. From acd5c6663eafcec105e073407fa5e53e1f898172 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Thu, 16 Oct 2025 22:44:58 +1100 Subject: [PATCH 04/20] remove last section --- lectures/harrison_kreps.md | 132 +++---------------------------------- 1 file changed, 9 insertions(+), 123 deletions(-) diff --git a/lectures/harrison_kreps.md b/lectures/harrison_kreps.md index 28718ec34..dd1ea306f 100644 --- a/lectures/harrison_kreps.md +++ b/lectures/harrison_kreps.md @@ -4,7 +4,7 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.17.3 + jupytext_version: 1.17.1 kernelspec: name: python3 display_name: Python 3 (ipykernel) @@ -58,7 +58,6 @@ import quantecon as qe import scipy.linalg as la import matplotlib.pyplot as plt import math -from functools import lru_cache ``` ### References @@ -618,13 +617,13 @@ with **permanently optimistic** investors - this is due to the marginal investor ## Learning -This section describe how {cite:t}`Morris1996` modified the Harrison–Kreps{cite}`HarrKreps1978` model. +This section describes how {cite:t}`Morris1996` modified the Harrison–Kreps{cite}`HarrKreps1978` model. Harrison and Kreps assumed dogmatic traders with hard-wired beliefs. Morris replaced them with traders who use Bayes' Law to update their beliefs about prospective dividends. -In Morris's model, all traders share the same manifold of statistical model for prospective dividends. +In Morris's model, all traders share the same manifold of statistical models for prospective dividends. All observe the same dividend histories. @@ -633,7 +632,7 @@ All use Bayes' Law. But they might have different initial prior distributions over the parameter that indexes a common manifold of statistical models. -By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogenous beliefs. +By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogeneous beliefs. Along identical histories of dividends, traders have different posterior distributions for prospective dividends. @@ -876,7 +875,8 @@ def price_learning_two_agents(prior1, prior2, β=.75, T=200): return price_array, μ1_fun, μ2_fun ``` -#### Case A: global optimist (no premium) +(hk_go)= +#### Case A: global optimist (no premium) Pick priors with rate dominance, e.g., trader 1: $\text{Beta}(a_1,b_1)=(2,1)$ and trader 2: $(a_2,b_2)=(1,2)$. @@ -1025,9 +1025,9 @@ for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): print(f" Trader {i} = {np.round(perp, 6)}") ``` -From the trader valuation, we can see that the asset price is above all trader's valuation. +From the trader valuation, we can see that the asset price is above all traders' valuations. -Morris tells us that rate dominance exists in this case. +Morris tells us that no rate dominance exists in this case. Let's verify using the code below @@ -1046,7 +1046,7 @@ else: print(f"\nNo global optimist and speculative premium exists") ``` -Indeed, there is global optimist and speculative premium exists. +Indeed, there is no global optimist and a speculative premium exists. ```{exercise-start} :label: hk_ex3 @@ -1122,118 +1122,4 @@ for priors, description in test_cases: ```{solution-end} ``` -#### Extension: fixed-point iteration - -In this case, we explore if we can compute the learning model can -be computated via pure fixed-point iteration without introducing a terminal date $T$ or referencing calendar time $t$. - -That is, we want to compute the infinite-horizon price $p(s,t,r)$ at a given starting posterior without truncating the horizon. - -Different from the previous sections, the state is just the vector of posterior parameters, which evolve deterministically with success/failure data. - -Let the state be $x = ((a_1,b_1),\ldots,(a_N,b_N))$. - -After a success, posteriors update to $x^+ = ((a_1+1,b_1),\ldots,(a_N+1,b_N))$; after a failure, to $x^- = ((a_1,b_1+1),\ldots,(a_N,b_N+1))$. - -Define - -$$ -(T f)(x) = \beta \max_{1\leq i\leq N} \Big[ \mu_i(x) \{1 + f(x^+)\} + (1-\mu_i(x)) f(x^-) \Big], -$$ - -where $\mu_i(x) = \dfrac{a_i}{a_i+b_i}$. For $\beta\in(0,1)$, $T$ is a contraction on bounded functions and has a unique fixed point $f^*$. - -To evaluate $f^*(x_0)$ at a given starting posterior $x_0$, we use truncated expansion $f^{(n)}$ with base $f^{(0)}\equiv 0$ and the recursive definition $f^{(n+1)} = T f^{(n)}$. - -A simple tail bound shows - -$$ -\|f^* - f^{(n)}\|_\infty \leq \frac{\beta^{n}}{1-\beta}, -$$ - -so choosing $n$ with $\beta^{n}/(1-\beta) \leq \varepsilon$ yields an $\varepsilon$-accurate value at $x_0$ without any terminal boundary. - -The computation below uses memoization over the posterior-parameter state to avoid redundant work. - -```{code-cell} ipython3 -def hk_required_depth(β=0.75, tol=1e-8): - """Smallest n with β^n/(1-β) <= tol.""" - num = math.log(max(tol * (1.0 - β), 1e-300)) - den = math.log(β) - n = math.ceil(num / den) - return max(0, n) - -def hk_price_fixedpoint(priors, β=0.75, tol=1e-8, normalized=False): - """ - Compute infinite-horizon HK price at starting posteriors `priors` via - truncated fixed-point iteration f^{(n)} with tail bound β^n/(1-β) <= tol. - """ - - start = tuple((float(a), float(b)) for (a, b) in priors) - N = len(start) - n = hk_required_depth(β=β, tol=tol) - - def step_success(state): - return tuple((a + 1.0, b) for (a, b) in state) - def step_failure(state): - return tuple((a, b + 1.0) for (a, b) in state) - - @lru_cache(maxsize=None) - def V(state, depth): - if depth <= 0: - return 0.0 - - # Compute continuation values once per state - s_succ = step_success(state) - s_fail = step_failure(state) - v_succ = V(s_succ, depth - 1) - v_fail = V(s_fail, depth - 1) - - # Posterior means for each trader at this state - cont_max = -np.inf - for i in range(N): - a_i, b_i = state[i] - μ_i = a_i / (a_i + b_i) - cont_i = μ_i * (1.0 + v_succ) + (1.0 - μ_i) * v_fail - if cont_i > cont_max: - cont_max = cont_i - return β * cont_max - - val = V(start, n) - tail = (β**n) / (1.0 - β) - if normalized: - r = (1.0 - β) / β - val = r * val - tail = r * tail - info = {"depth": n, "tail_bound": tail} - return val, info - -# Quick comparison: two traders -β = 0.75 -priors_2 = [(1, 1), (0.5, 0.5)] -v_fp, info_fp = hk_price_fixedpoint(priors_2, β=β, tol=1e-10) -print("Two agent crossing:\n price(0,0) =", np.round(v_fp, 8), - "depth:", info_fp["depth"], - "tail<=", info_fp["tail_bound"]) - -# N-trader example -priors_3 = [(1,1), (0.5,0.5), (3,2)] -v3_fp, info3_fp = hk_price_fixedpoint(priors_3, β=β, tol=1e-10) -print("Three agent:\n price(0,0) =", np.round(v3_fp, 8), - "depth:", info3_fp["depth"], - "tail<=", info3_fp["tail_bound"]) -``` - -We can also recover each of the two-trader examples above. - -```{code-cell} ipython3 -round(hk_price_fixedpoint([(1, 1)], β=β, tol=1e-10)[0], 3) -``` - -```{code-cell} ipython3 -round(hk_price_fixedpoint([(0.5, 0.5)], β=β, tol=1e-10)[0], 3) -``` - -This approach matches the original Harrison–Kreps scheme as it iterates the fixed-point operator on the belief state directly. - [^f1]: By assuming that both types of agents always have "deep enough pockets" to purchase all of the asset, the model takes wealth dynamics off the table. The Harrison-Kreps model generates high trading volume when the state changes either from 0 to 1 or from 1 to 0. From 01606a8eda9d70449c14478c498d5605efd0e8a3 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Fri, 17 Oct 2025 10:37:16 +1100 Subject: [PATCH 05/20] split the lecture --- lectures/harrison_kreps.md | 507 -------------------------------- lectures/morris_learn.md | 578 +++++++++++++++++++++++++++++++++++++ 2 files changed, 578 insertions(+), 507 deletions(-) create mode 100644 lectures/morris_learn.md diff --git a/lectures/harrison_kreps.md b/lectures/harrison_kreps.md index dd1ea306f..2d58f045d 100644 --- a/lectures/harrison_kreps.md +++ b/lectures/harrison_kreps.md @@ -615,511 +615,4 @@ with **permanently optimistic** investors - this is due to the marginal investor ```{solution-end} ``` -## Learning - -This section describes how {cite:t}`Morris1996` modified the Harrison–Kreps{cite}`HarrKreps1978` model. - -Harrison and Kreps assumed dogmatic traders with hard-wired beliefs. - -Morris replaced them with traders who use Bayes' Law to update their beliefs about prospective dividends. - -In Morris's model, all traders share the same manifold of statistical models for prospective dividends. - -All observe the same dividend histories. - -All use Bayes' Law. - -But they might have different initial prior distributions over the parameter that indexes a common manifold of statistical models. - - -By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogeneous beliefs. - -Along identical histories of dividends, traders have different posterior distributions for prospective dividends. - -Those differences set the stage for possible speculation and price bubbles. - -### The setting - - -The risky asset pays i.i.d. dividends $d_{t+1} \in \{0,1\}$ with unknown probability $\theta \in (0,1)$ that the dividend equals $1$. - -There is a finite set $\mathcal{I}$ of risk-neutral traders. - -Traders buy and sell the risky asset in competitive markets each period $t = 0, 1, 2, \ldots$ after dividends are paid. - -Traders face a short-sale constraint: they cannot sell the risky asset short. - -All traders have sufficient wealth to purchase the risky asset as in the previous sections. - -All traders observe the full dividend history $(d_1, d_2, \ldots, d_t)$ and update beliefs by Bayes' rule, but they have heterogeneous priors over $\theta$. - -### Beta prior specification - -For tractability, assume trader $i$ has a Beta prior over the dividend probability - -$$ -\theta \sim \text{Beta}(a_i, b_i) -$$ - -where $a_i, b_i > 0$ are the prior parameters. - -```{note} -The definition of Beta distribution can be found in {doc}`divergence_measures`. -``` - -Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid (i.e., $s$ successes and $t-s$ failures). - -By Bayes' rule, the posterior density over $\theta$ is: - -$$ -\pi_i(\theta \mid s, t) = \frac{\theta^s (1-\theta)^{t-s} \pi_i(\theta)}{\int_0^1 \theta^s (1-\theta)^{t-s} \pi_i(\theta) d\theta} -$$ - -where $\pi_i(\theta)$ is trader $i$'s prior density. - -```{note} -The Beta distribution is the conjugate prior for the Binomial likelihood. - -When the prior is $\text{Beta}(a_i, b_i)$ and we observe $s$ successes in $t$ trials, the posterior is $\text{Beta}(a_i+s, b_i+t-s)$. -``` - -The posterior mean (or expected dividend probability) is: - -$$ -\mu_i(s,t) = \int_0^1 \theta \pi_i(\theta \mid s, t) d\theta -= \mathbb{E}[\text{Beta}(a_i+s, b_i+t-s)] = \frac{a_i + s}{a_i + b_i + t} -$$ - -Morris refers to $\mu_i(s,t)$ as trader $i$'s **fundamental valuation** of the asset after history $(s,t)$. - -This is the probability trader $i$ assigns to receiving a dividend next period, which reflects their updated belief about $\theta$. - -### Market prices with learning - -Fundamental valuations reflect the expected value to each trader of holding the asset *forever*. - -However, in a market where the asset can be resold, traders take into account the possibility of selling at a price higher than their fundamental valuation in some future state. - -```{prf:definition} Most Optimistic Valuation -:label: most_optimistic_valuation - -After history $(s,t)$, the *most optimistic fundamental valuation* is: - -$$ -\mu^*(s,t) = \max_{i \in \mathcal{I}} \mu_i(s,t) -$$ -``` - -```{prf:definition} Equilibrium Asset Price -:label: equilibrium_asset_price - -Write $\tilde{p}(s,t,r)$ for the competitive equilibrium price of the risky asset (in current dollars) after history $(s,t)$ when the interest rate is $r$. - -The equilibrium price satisfies: - -$$ -\tilde{p}(s,t,r) = \frac{1}{1+r} \Bigl[ \mu^*(s,t) \{1 + \tilde{p}(s+1,t+1,r)\} -+ (1 - \mu^*(s,t)) \tilde{p}(s,t+1,r) \Bigr] -$$ -``` - -The equilibrium price equals the highest expected discounted return among all traders from holding the asset to the next period. - -```{prf:definition} Normalized Price -:label: normalized_price - -The normalized price is defined as: - -$$ -p(s,t,r) = r \tilde{p}(s,t,r) -$$ - -Since the current dollar price of the riskless asset is $1/r$, this represents the price of the risky asset in terms of the riskless asset. -``` - -Substituting into the equilibrium condition gives: - -$$ -p(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} -\Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) \Bigr] -$$ - -or equivalently: - -$$ -p(s,t,r) = \mu^*(s,t) + \frac{r}{1+r} -\Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) - \mu^*(s,t) \Bigr] -$$ - -Following Harrison and Kreps, a price scheme satisfying the equilibrium condition can be computed recursively. - -Set $p^0(s,t,r) = 0$ for all $(s,t,r)$, and define $p^{n+1}(s,t,r)$ by: - -$$ -p^{n+1}(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} -\Bigl[ \mu^*(s,t) p^n(s+1,t+1,r) + (1 - \mu^*(s,t)) p^n(s,t+1,r) \Bigr] -$$ - -The sequence $\{p^n(s,t,r)\}$ converges to the equilibrium price $p(s,t,r)$. - -```{prf:definition} Speculative Premium -:label: speculative_premium - -When the identity of the most optimistic trader can switch with future dividend realizations, the market price exceeds *every* trader's fundamental valuation. - -In normalized units: - -$$ -p(s,t,r) > \mu_i(s,t) \quad \text{for all } i \in \mathcal{I} -$$ - -The **speculative premium** for trader $i$ is: - -$$ -p(s,t,r) - \mu_i(s,t) > 0 -$$ -``` - - -### Two Traders - -We now focus on the case with two traders having priors $(a_1,b_1)$ and $(a_2,b_2)$. - -```{prf:definition} Rate Dominance (Beta Priors) -:label: rate_dominance_beta - -Trader 1 **rate-dominates** trader 2 if: - -$$ -a_1 \geq a_2 \quad \text{and} \quad b_1 \leq b_2 -$$ -``` - -```{prf:theorem} Global Optimist (Two Traders) -:label: two_trader_optimist - -For two traders with Beta priors: - -1. If trader 1 rate-dominates trader 2, then trader 1 is a **global optimist**: $\mu_1(s,t) \geq \mu_2(s,t)$ for all histories $(s,t)$ -2. In this case, $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$. There is **no speculative premium** -``` - -When neither trader rate-dominates the other, the identity of the most optimistic trader can switch with dividend data. - -In this perpetual switching case, the price strictly exceeds both traders' fundamental valuations before learning converges: - -$$ -p(s,t,r) > \max\{\mu_1(s,t), \mu_2(s,t)\} -$$ - -This is consistent with our discussion about the expectation of future resale opportunities -creating a speculative premium. - -### Implementation - -For computational tractability, we work with a finite horizon $T$ and solve by backward induction. - -We use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via: - -$$ -\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] -$$ - -The terminal condition $\tilde{p}(s,T)$ is set equal to the perpetuity value under the most optimistic belief. - -```{code-cell} ipython3 -def posterior_mean(a, b, s, t): - """ - Compute posterior mean μ_i(s,t) for Beta(a, b) prior. - """ - return (a + s) / (a + b + t) - -def perpetuity_value(a, b, s, t, β=.75): - """ - Compute perpetuity value (β/(1-β)) * μ_i(s,t). - """ - return (β / (1 - β)) * posterior_mean(a, b, s, t) - -def price_learning_two_agents(prior1, prior2, β=.75, T=200): - """ - Compute \tilde p(s,t) for two Beta-prior traders via backward induction. - """ - a1, b1 = prior1 - a2, b2 = prior2 - price_array = np.zeros((T+1, T+1)) - - # Terminal condition: set to perpetuity value under max belief - for s in range(T+1): - perp1 = perpetuity_value(a1, b1, s, T, β) - perp2 = perpetuity_value(a2, b2, s, T, β) - price_array[s, T] = max(perp1, perp2) - - # Backward induction - for t in range(T-1, -1, -1): - for s in range(t, -1, -1): - μ1 = posterior_mean(a1, b1, s, t) - μ2 = posterior_mean(a2, b2, s, t) - - # One-step continuation values under each trader's beliefs - cont1 = μ1 * (1.0 + price_array[s+1, t+1]) \ - + (1.0 - μ1) * price_array[s, t+1] - cont2 = μ2 * (1.0 + price_array[s+1, t+1]) \ - + (1.0 - μ2) * price_array[s, t+1] - price_array[s, t] = β * max(cont1, cont2) - - def μ1_fun(s, t): - return posterior_mean(a1, b1, s, t) - def μ2_fun(s, t): - return posterior_mean(a2, b2, s, t) - - return price_array, μ1_fun, μ2_fun -``` - -(hk_go)= -#### Case A: global optimist (no premium) - -Pick priors with rate dominance, e.g., trader 1: $\text{Beta}(a_1,b_1)=(2,1)$ and trader 2: $(a_2,b_2)=(1,2)$. - -Trader 1 is the global optimist, so the normalized price equals trader 1's fundamental valuation: $p(s,t,r) = \mu_1(s,t)$. - -```{code-cell} ipython3 -β = 0.75 -price_go, μ1_go, μ2_go = price_learning_two_agents((2,1), (1,2), β=β, T=150) - -perpetuity_1 = (β / (1 - β)) * μ1_go(0, 0) -perpetuity_2 = (β / (1 - β)) * μ2_go(0, 0) - -print("Price at (0, 0) =", price_go[0,0]) -print("Valuation of trader 1 at (0, 0) =", perpetuity_1) -print("Valuation of trader 2 at (0, 0) =", perpetuity_2) -``` - -The price equals trader 1's perpetuity value. - -#### Case B: perpetual switching (positive premium) - -Now assume trader 1 has $\text{Beta}(1,1)$, trader 2 has $\text{Beta}(1/2,1/2)$. - -These produce crossing posteriors, so there is no global optimist and the price exceeds both fundamentals early on. - -```{code-cell} ipython3 -β = .75 -price_ps, μ1_ps, μ2_ps = price_learning_two_agents((1,1), (0.5,0.5), β=β, T=200) - -price_00 = price_ps[0,0] -μ1_00 = μ1_ps(0,0) -μ2_00 = μ2_ps(0,0) - -perpetuity_1 = (β / (1 - β)) * μ1_ps(0, 0) -perpetuity_2 = (β / (1 - β)) * μ2_ps(0, 0) - -print("Price at (0, 0) =", np.round(price_00, 6)) -print("Valuation of trader 1 at (0, 0) =", perpetuity_1) -print("Valuation of trader 2 at (0, 0) =", perpetuity_2) -``` - -The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as data arrive. - -Under this setting we reproduce the two key figures reported in {cite:t}`Morris1996` - -```{code-cell} ipython3 -def normalized_price_two_agents(prior1, prior2, r, T=250): - """Return p(s,t,r) = r · \tilde p(s,t,r) for two traders.""" - β = 1.0 / (1.0 + r) - price_array, *_ = price_learning_two_agents(prior1, prior2, β=β, T=T) - return r * price_array - -# Figure I: p*(0,0,r) as a function of r -r_grid = np.linspace(1e-3, 5.0, 200) -priors = ((1,1), (0.5,0.5)) -p00 = np.array([normalized_price_two_agents( - priors[0], priors[1], r, T=300)[0,0] - for r in r_grid]) - -plt.figure(figsize=(6,4)) -plt.plot(r_grid, p00, 'k-') -plt.xlabel('r') -plt.ylabel(r'$p^*(0,0,r)$') -plt.title('Figure I: Normalized Price vs Interest Rate') -plt.show() - -# Figure II: p*(t/2,t,0.05) as a function of t -r = 0.05 -T = 60 -p_mat = normalized_price_two_agents(priors[0], priors[1], r, T=T) -t_vals = np.arange(0, 54, 2) -s_vals = t_vals // 2 -y = np.array([p_mat[s, t] for s, t in zip(s_vals, t_vals)]) - -plt.figure(figsize=(6,4)) -plt.plot(t_vals, y, 'k-') -plt.xlabel('t') -plt.ylabel(r'$p^*(t/2,t,0.05)$') -plt.title('Figure II: Normalized Price vs Time (r=0.05)') -plt.show() - -p0 = p_mat[0,0] -mu0 = 0.5 -print("Initial normalized premium at r=0.05 (%):", - np.round(100 * (p0 / mu0 - 1.0), 2)) -``` - -In the first figure, we can see: - -- The resale option pushes the normalized price $p*(0,0,r)$ above fundamentals $(0.5)$ for any finite $r$. - -- As $r$ increases ($\beta$ decreases), the option value fades and $p*(0,0,r) \to 0.5$. - -- At $r = 0.05$ the premium is about $8–9\%$, consistent with Morris (1996, Section IV). - -In the second figure, we can see: - -- Along the symmetric path $s = t/2$, both traders’ fundamentals equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. - - -### General N–trader extension - -The same recursion extends to any finite set of Beta priors $\{(a_i,b_i)\}_{i=1}^N$ by taking the max over $i$ each period. - -```{code-cell} ipython3 -def price_learning(priors, β=.75, T=200): - """ - N-trader version with heterogeneous Beta priors. - """ - price_array = np.zeros((T+1, T+1)) - - def perp_i(i, s, t): - a, b = priors[i] - return perpetuity_value(a, b, s, t, β) - - # Terminal condition - for s in range(T+1): - price_array[s, T] = max( - perp_i(i, s, T) for i in range(len(priors))) - - # Backward induction - for t in range(T-1, -1, -1): - for s in range(t, -1, -1): - conts = [] - for (a, b) in priors: - μ = posterior_mean(a, b, s, t) - conts.append(μ * - (1.0 + price_array[s+1, t+1]) - + (1.0 - μ) * price_array[s, t+1]) - price_array[s, t] = β * max(conts) - - return price_array - -β = .75 -priors = [(1,1), (0.5,0.5), (3,2)] -price_N = price_learning(priors, β=β, T=150) - -# Compute valuations for each trader at (0,0) -mu_vals = [posterior_mean(a, b, 0, 0) for a, b in priors] -perp_vals = [(β / (1 - β)) * mu for mu in mu_vals] - -print("Three-trader example at (s,t)=(0,0):") -print(f"Price at (0,0) = {np.round(price_N[0,0], 6)}") -print(f"\nTrader valuations:") -for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): - print(f" Trader {i} = {np.round(perp, 6)}") -``` - -From the trader valuation, we can see that the asset price is above all traders' valuations. - -Morris tells us that no rate dominance exists in this case. - -Let's verify using the code below - -```{code-cell} ipython3 -dominant = None -for i in range(len(priors)): - is_dom = all(priors[i][0] >= priors[j][0] and priors[i][1] <= priors[j][1] - for j in range(len(priors)) if i != j) - if is_dom: - dominant = i - break - -if dominant is not None: - print(f"\nTrader {dominant+1} is the global optimist (rate-dominant)") -else: - print(f"\nNo global optimist and speculative premium exists") -``` - -Indeed, there is no global optimist and a speculative premium exists. - -```{exercise-start} -:label: hk_ex3 -``` - -Morris {cite}`Morris1996` provides a sharp characterization of when speculative bubbles arise. - -The key condition is that there is no **global optimist**. - -In this exercise, you will verify this condition for the following sets of traders with Beta priors: - -1. Trader 1: $\text{Beta}(2,1)$, Trader 2: $\text{Beta}(1,2)$ -2. Trader 1: $\text{Beta}(1,1)$, Trader 2: $\text{Beta}(1/2,1/2)$ -3. Trader 1: $\text{Beta}(3,1)$, Trader 2: $\text{Beta}(2,1)$, Trader 3: $\text{Beta}(1,2)$ -4. Trader 1: $\text{Beta}(1,1)$, Trader 2: $\text{Beta}(1/2,1/2)$, Trader 3: $\text{Beta}(3/2,3/2)$ - -```{exercise-end} -``` - -```{solution-start} hk_ex3 -:class: dropdown -``` - -Here is one solution: - -```{code-cell} ipython3 -def check_rate_dominance(priors): - """ - Check if any trader rate-dominates all others. - """ - N = len(priors) - - for i in range(N): - a_i, b_i = priors[i] - is_dominant = True - - for j in range(N): - if i == j: - continue - a_j, b_j = priors[j] - - # Check rate dominance condition - if not (a_i >= a_j and b_i <= b_j): - is_dominant = False - break - - if is_dominant: - return i - - return None - -# Test cases -test_cases = [ - ([(2, 1), (1, 2)], "Global optimist exists"), - ([(1, 1), (0.5, 0.5)], "Perpetual switching"), - ([(3, 1), (2, 1), (1, 2)], "Three traders with dominant"), - ([(1, 1), (0.5, 0.5), (1.5, 1.5)], "Three traders, no dominant") -] - -for priors, description in test_cases: - dominant = check_rate_dominance(priors) - - print(f"\n{description}") - print(f"Priors: {priors}") - print("=="*8) - if dominant is not None: - print(f"Trader {dominant+1} is the global optimist (rate-dominant)") - else: - print(f"No global optimist exists") - print("=="*8 + "\n") -``` - -```{solution-end} -``` - [^f1]: By assuming that both types of agents always have "deep enough pockets" to purchase all of the asset, the model takes wealth dynamics off the table. The Harrison-Kreps model generates high trading volume when the state changes either from 0 to 1 or from 1 to 0. diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md new file mode 100644 index 000000000..52a200485 --- /dev/null +++ b/lectures/morris_learn.md @@ -0,0 +1,578 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst + format_version: 0.13 + jupytext_version: 1.17.1 +kernelspec: + name: python3 + display_name: Python 3 (ipykernel) + language: python +--- + +(morris_learn)= +```{raw} jupyter + +``` + +# Speculative Behavior with Bayesian Learning + +```{index} single: Models; Morris Learning +``` + +```{contents} Contents +:depth: 2 +``` + +In addition to what's in Anaconda, this lecture uses following libraries: + +```{code-cell} ipython3 +:tags: [hide-output] + +!pip install quantecon +``` + +## Overview + +This lecture describes a model of {cite:t}`Morris1996` that extends the +{cite:t}`HarrKreps1978` model of speculative asset pricing (see {doc}`harrison_kreps`). + +The Harrison-Kreps model features heterogeneous beliefs but assumes that investors have hard-wired beliefs about asset fundamentals. + +Morris replaced the fixed beliefs with Bayesian learning, where traders update their beliefs using Bayes' Law as new dividend data arrive. + +Key features of Morris's model: + +* All traders share the same statistical model (manifold) for prospective dividends +* All observe the same dividend histories +* All use Bayes' Law to update beliefs +* Traders have different *prior distributions* over parameters of the dividend process + +This heterogeneity in priors leads to heterogeneous *posterior beliefs* even though all traders observe identical data. + +These differences create opportunities for speculation and potential price bubbles. + +Let's start with some standard imports: + +```{code-cell} ipython3 +import numpy as np +import matplotlib.pyplot as plt +``` + +Prior to reading the following, you might like to review our lectures on + +* {doc}`Harrison-Kreps model ` +* {doc}`Likelihood ratio processes ` +* {doc}`Bayesian versus frequentist statistics ` + +This section describes how {cite:t}`Morris1996` modified the Harrison–Kreps{cite}`HarrKreps1978` model. + +Harrison and Kreps assumed dogmatic traders with hard-wired beliefs. + +Morris replaced them with traders who use Bayes' Law to update their beliefs about prospective dividends. + +In Morris's model, all traders share the same manifold of statistical models for prospective dividends. + +All observe the same dividend histories. + +All use Bayes' Law. + +But they might have different initial prior distributions over the parameter that indexes a common manifold of statistical models. + + +By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogeneous beliefs. + +Along identical histories of dividends, traders have different posterior distributions for prospective dividends. + +Those differences set the stage for possible speculation and price bubbles. + +## The setting + + +The risky asset pays i.i.d. dividends $d_{t+1} \in \{0,1\}$ with unknown probability $\theta \in (0,1)$ that the dividend equals $1$. + +There is a finite set $\mathcal{I}$ of risk-neutral traders. + +Traders buy and sell the risky asset in competitive markets each period $t = 0, 1, 2, \ldots$ after dividends are paid. + +Traders face a short-sale constraint: they cannot sell the risky asset short. + +All traders have sufficient wealth to purchase the risky asset as in the previous sections. + +All traders observe the full dividend history $(d_1, d_2, \ldots, d_t)$ and update beliefs by Bayes' rule, but they have heterogeneous priors over $\theta$. + +### Beta prior specification + +For tractability, assume trader $i$ has a Beta prior over the dividend probability + +$$ +\theta \sim \text{Beta}(a_i, b_i) +$$ + +where $a_i, b_i > 0$ are the prior parameters. + +```{note} +The definition of Beta distribution can be found in {doc}`divergence_measures`. +``` + +Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid (i.e., $s$ successes and $t-s$ failures). + +By Bayes' rule, the posterior density over $\theta$ is: + +$$ +\pi_i(\theta \mid s, t) = \frac{\theta^s (1-\theta)^{t-s} \pi_i(\theta)}{\int_0^1 \theta^s (1-\theta)^{t-s} \pi_i(\theta) d\theta} +$$ + +where $\pi_i(\theta)$ is trader $i$'s prior density. + +```{note} +The Beta distribution is the conjugate prior for the Binomial likelihood. + +When the prior is $\text{Beta}(a_i, b_i)$ and we observe $s$ successes in $t$ trials, the posterior is $\text{Beta}(a_i+s, b_i+t-s)$. +``` + +The posterior mean (or expected dividend probability) is: + +$$ +\mu_i(s,t) = \int_0^1 \theta \pi_i(\theta \mid s, t) d\theta += \mathbb{E}[\text{Beta}(a_i+s, b_i+t-s)] = \frac{a_i + s}{a_i + b_i + t} +$$ + +Morris refers to $\mu_i(s,t)$ as trader $i$'s **fundamental valuation** of the asset after history $(s,t)$. + +This is the probability trader $i$ assigns to receiving a dividend next period, which reflects their updated belief about $\theta$. + +## Market prices with learning + +Fundamental valuations reflect the expected value to each trader of holding the asset *forever*. + +However, in a market where the asset can be resold, traders take into account the possibility of selling at a price higher than their fundamental valuation in some future state. + +```{prf:definition} Most Optimistic Valuation +:label: most_optimistic_valuation + +After history $(s,t)$, the *most optimistic fundamental valuation* is: + +$$ +\mu^*(s,t) = \max_{i \in \mathcal{I}} \mu_i(s,t) +$$ +``` + +```{prf:definition} Equilibrium Asset Price +:label: equilibrium_asset_price + +Write $\tilde{p}(s,t,r)$ for the competitive equilibrium price of the risky asset (in current dollars) after history $(s,t)$ when the interest rate is $r$. + +The equilibrium price satisfies: + +$$ +\tilde{p}(s,t,r) = \frac{1}{1+r} \Bigl[ \mu^*(s,t) \{1 + \tilde{p}(s+1,t+1,r)\} ++ (1 - \mu^*(s,t)) \tilde{p}(s,t+1,r) \Bigr] +$$ +``` + +The equilibrium price equals the highest expected discounted return among all traders from holding the asset to the next period. + +```{prf:definition} Normalized Price +:label: normalized_price + +The normalized price is defined as: + +$$ +p(s,t,r) = r \tilde{p}(s,t,r) +$$ + +Since the current dollar price of the riskless asset is $1/r$, this represents the price of the risky asset in terms of the riskless asset. +``` + +Substituting into the equilibrium condition gives: + +$$ +p(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} +\Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) \Bigr] +$$ + +or equivalently: + +$$ +p(s,t,r) = \mu^*(s,t) + \frac{r}{1+r} +\Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) - \mu^*(s,t) \Bigr] +$$ + +Following Harrison and Kreps, a price scheme satisfying the equilibrium condition can be computed recursively. + +Set $p^0(s,t,r) = 0$ for all $(s,t,r)$, and define $p^{n+1}(s,t,r)$ by: + +$$ +p^{n+1}(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} +\Bigl[ \mu^*(s,t) p^n(s+1,t+1,r) + (1 - \mu^*(s,t)) p^n(s,t+1,r) \Bigr] +$$ + +The sequence $\{p^n(s,t,r)\}$ converges to the equilibrium price $p(s,t,r)$. + +```{prf:definition} Speculative Premium +:label: speculative_premium + +When the identity of the most optimistic trader can switch with future dividend realizations, the market price exceeds *every* trader's fundamental valuation. + +In normalized units: + +$$ +p(s,t,r) > \mu_i(s,t) \quad \text{for all } i \in \mathcal{I} +$$ + +The **speculative premium** for trader $i$ is: + +$$ +p(s,t,r) - \mu_i(s,t) > 0 +$$ +``` + + +## Two Traders + +We now focus on the case with two traders having priors $(a_1,b_1)$ and $(a_2,b_2)$. + +```{prf:definition} Rate Dominance (Beta Priors) +:label: rate_dominance_beta + +Trader 1 **rate-dominates** trader 2 if: + +$$ +a_1 \geq a_2 \quad \text{and} \quad b_1 \leq b_2 +$$ +``` + +```{prf:theorem} Global Optimist (Two Traders) +:label: two_trader_optimist + +For two traders with Beta priors: + +1. If trader 1 rate-dominates trader 2, then trader 1 is a **global optimist**: $\mu_1(s,t) \geq \mu_2(s,t)$ for all histories $(s,t)$ +2. In this case, $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$. There is **no speculative premium** +``` + +When neither trader rate-dominates the other, the identity of the most optimistic trader can switch with dividend data. + +In this perpetual switching case, the price strictly exceeds both traders' fundamental valuations before learning converges: + +$$ +p(s,t,r) > \max\{\mu_1(s,t), \mu_2(s,t)\} +$$ + +This is consistent with our discussion about the expectation of future resale opportunities +creating a speculative premium. + +### Implementation + +For computational tractability, we work with a finite horizon $T$ and solve by backward induction. + +We use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via: + +$$ +\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] +$$ + +The terminal condition $\tilde{p}(s,T)$ is set equal to the perpetuity value under the most optimistic belief. + +```{code-cell} ipython3 +def posterior_mean(a, b, s, t): + """ + Compute posterior mean μ_i(s,t) for Beta(a, b) prior. + """ + return (a + s) / (a + b + t) + +def perpetuity_value(a, b, s, t, β=.75): + """ + Compute perpetuity value (β/(1-β)) * μ_i(s,t). + """ + return (β / (1 - β)) * posterior_mean(a, b, s, t) + +def price_learning_two_agents(prior1, prior2, β=.75, T=200): + """ + Compute \tilde p(s,t) for two Beta-prior traders via backward induction. + """ + a1, b1 = prior1 + a2, b2 = prior2 + price_array = np.zeros((T+1, T+1)) + + # Terminal condition: set to perpetuity value under max belief + for s in range(T+1): + perp1 = perpetuity_value(a1, b1, s, T, β) + perp2 = perpetuity_value(a2, b2, s, T, β) + price_array[s, T] = max(perp1, perp2) + + # Backward induction + for t in range(T-1, -1, -1): + for s in range(t, -1, -1): + μ1 = posterior_mean(a1, b1, s, t) + μ2 = posterior_mean(a2, b2, s, t) + + # One-step continuation values under each trader's beliefs + cont1 = μ1 * (1.0 + price_array[s+1, t+1]) \ + + (1.0 - μ1) * price_array[s, t+1] + cont2 = μ2 * (1.0 + price_array[s+1, t+1]) \ + + (1.0 - μ2) * price_array[s, t+1] + price_array[s, t] = β * max(cont1, cont2) + + def μ1_fun(s, t): + return posterior_mean(a1, b1, s, t) + def μ2_fun(s, t): + return posterior_mean(a2, b2, s, t) + + return price_array, μ1_fun, μ2_fun +``` + +(hk_go)= +### Case A: global optimist (no premium) + +Pick priors with rate dominance, e.g., trader 1: $\text{Beta}(a_1,b_1)=(2,1)$ and trader 2: $(a_2,b_2)=(1,2)$. + +Trader 1 is the global optimist, so the normalized price equals trader 1's fundamental valuation: $p(s,t,r) = \mu_1(s,t)$. + +```{code-cell} ipython3 +β = 0.75 +price_go, μ1_go, μ2_go = price_learning_two_agents((2,1), (1,2), β=β, T=150) + +perpetuity_1 = (β / (1 - β)) * μ1_go(0, 0) +perpetuity_2 = (β / (1 - β)) * μ2_go(0, 0) + +print("Price at (0, 0) =", price_go[0,0]) +print("Valuation of trader 1 at (0, 0) =", perpetuity_1) +print("Valuation of trader 2 at (0, 0) =", perpetuity_2) +``` + +The price equals trader 1's perpetuity value. + +### Case B: perpetual switching (positive premium) + +Now assume trader 1 has $\text{Beta}(1,1)$, trader 2 has $\text{Beta}(1/2,1/2)$. + +These produce crossing posteriors, so there is no global optimist and the price exceeds both fundamentals early on. + +```{code-cell} ipython3 +β = .75 +price_ps, μ1_ps, μ2_ps = price_learning_two_agents((1,1), (0.5,0.5), β=β, T=200) + +price_00 = price_ps[0,0] +μ1_00 = μ1_ps(0,0) +μ2_00 = μ2_ps(0,0) + +perpetuity_1 = (β / (1 - β)) * μ1_ps(0, 0) +perpetuity_2 = (β / (1 - β)) * μ2_ps(0, 0) + +print("Price at (0, 0) =", np.round(price_00, 6)) +print("Valuation of trader 1 at (0, 0) =", perpetuity_1) +print("Valuation of trader 2 at (0, 0) =", perpetuity_2) +``` + +The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as data arrive. + +Under this setting we reproduce the two key figures reported in {cite:t}`Morris1996` + +```{code-cell} ipython3 +def normalized_price_two_agents(prior1, prior2, r, T=250): + """Return p(s,t,r) = r · \tilde p(s,t,r) for two traders.""" + β = 1.0 / (1.0 + r) + price_array, *_ = price_learning_two_agents(prior1, prior2, β=β, T=T) + return r * price_array + +# Figure I: p*(0,0,r) as a function of r +r_grid = np.linspace(1e-3, 5.0, 200) +priors = ((1,1), (0.5,0.5)) +p00 = np.array([normalized_price_two_agents( + priors[0], priors[1], r, T=300)[0,0] + for r in r_grid]) + +plt.figure(figsize=(6,4)) +plt.plot(r_grid, p00, 'k-') +plt.xlabel('r') +plt.ylabel(r'$p^*(0,0,r)$') +plt.title('Figure I: Normalized Price vs Interest Rate') +plt.show() + +# Figure II: p*(t/2,t,0.05) as a function of t +r = 0.05 +T = 60 +p_mat = normalized_price_two_agents(priors[0], priors[1], r, T=T) +t_vals = np.arange(0, 54, 2) +s_vals = t_vals // 2 +y = np.array([p_mat[s, t] for s, t in zip(s_vals, t_vals)]) + +plt.figure(figsize=(6,4)) +plt.plot(t_vals, y, 'k-') +plt.xlabel('t') +plt.ylabel(r'$p^*(t/2,t,0.05)$') +plt.title('Figure II: Normalized Price vs Time (r=0.05)') +plt.show() + +p0 = p_mat[0,0] +mu0 = 0.5 +print("Initial normalized premium at r=0.05 (%):", + np.round(100 * (p0 / mu0 - 1.0), 2)) +``` + +In the first figure, we can see: + +- The resale option pushes the normalized price $p*(0,0,r)$ above fundamentals $(0.5)$ for any finite $r$. + +- As $r$ increases ($\beta$ decreases), the option value fades and $p*(0,0,r) \to 0.5$. + +- At $r = 0.05$ the premium is about $8–9\%$, consistent with Morris (1996, Section IV). + +In the second figure, we can see: + +- Along the symmetric path $s = t/2$, both traders’ fundamentals equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. + + +### General N–trader extension + +The same recursion extends to any finite set of Beta priors $\{(a_i,b_i)\}_{i=1}^N$ by taking the max over $i$ each period. + +```{code-cell} ipython3 +def price_learning(priors, β=.75, T=200): + """ + N-trader version with heterogeneous Beta priors. + """ + price_array = np.zeros((T+1, T+1)) + + def perp_i(i, s, t): + a, b = priors[i] + return perpetuity_value(a, b, s, t, β) + + # Terminal condition + for s in range(T+1): + price_array[s, T] = max( + perp_i(i, s, T) for i in range(len(priors))) + + # Backward induction + for t in range(T-1, -1, -1): + for s in range(t, -1, -1): + conts = [] + for (a, b) in priors: + μ = posterior_mean(a, b, s, t) + conts.append(μ * + (1.0 + price_array[s+1, t+1]) + + (1.0 - μ) * price_array[s, t+1]) + price_array[s, t] = β * max(conts) + + return price_array + +β = .75 +priors = [(1,1), (0.5,0.5), (3,2)] +price_N = price_learning(priors, β=β, T=150) + +# Compute valuations for each trader at (0,0) +mu_vals = [posterior_mean(a, b, 0, 0) for a, b in priors] +perp_vals = [(β / (1 - β)) * mu for mu in mu_vals] + +print("Three-trader example at (s,t)=(0,0):") +print(f"Price at (0,0) = {np.round(price_N[0,0], 6)}") +print(f"\nTrader valuations:") +for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): + print(f" Trader {i} = {np.round(perp, 6)}") +``` + +From the trader valuation, we can see that the asset price is above all traders' valuations. + +Morris tells us that no rate dominance exists in this case. + +Let's verify using the code below + +```{code-cell} ipython3 +dominant = None +for i in range(len(priors)): + is_dom = all(priors[i][0] >= priors[j][0] and priors[i][1] <= priors[j][1] + for j in range(len(priors)) if i != j) + if is_dom: + dominant = i + break + +if dominant is not None: + print(f"\nTrader {dominant+1} is the global optimist (rate-dominant)") +else: + print(f"\nNo global optimist and speculative premium exists") +``` + +Indeed, there is no global optimist and a speculative premium exists. + +## Exercises + +```{exercise-start} +:label: hk_ex3 +``` + +Morris {cite}`Morris1996` provides a sharp characterization of when speculative bubbles arise. + +The key condition is that there is no **global optimist*. + +In this exercise, you will verify this condition for the following sets of traders with Beta priors: + +1. Trader 1: $\text{Beta}(2,1)$, Trader 2: $\text{Beta}(1,2)$ +2. Trader 1: $\text{Beta}(1,1)$, Trader 2: $\text{Beta}(1/2,1/2)$ +3. Trader 1: $\text{Beta}(3,1)$, Trader 2: $\text{Beta}(2,1)$, Trader 3: $\text{Beta}(1,2)$ +4. Trader 1: $\text{Beta}(1,1)$, Trader 2: $\text{Beta}(1/2,1/2)$, Trader 3: $\text{Beta}(3/2,3/2)$ + +```{exercise-end} +``` + +```{solution-start} hk_ex3 +:class: dropdown +``` + +Here is one solution: + +```{code-cell} ipython3 +def check_rate_dominance(priors): + """ + Check if any trader rate-dominates all others. + """ + N = len(priors) + + for i in range(N): + a_i, b_i = priors[i] + is_dominant = True + + for j in range(N): + if i == j: + continue + a_j, b_j = priors[j] + + # Check rate dominance condition + if not (a_i >= a_j and b_i <= b_j): + is_dominant = False + break + + if is_dominant: + return i + + return None + +# Test cases +test_cases = [ + ([(2, 1), (1, 2)], "Global optimist exists"), + ([(1, 1), (0.5, 0.5)], "Perpetual switching"), + ([(3, 1), (2, 1), (1, 2)], "Three traders with dominant"), + ([(1, 1), (0.5, 0.5), (1.5, 1.5)], "Three traders, no dominant") +] + +for priors, description in test_cases: + dominant = check_rate_dominance(priors) + + print(f"\n{description}") + print(f"Priors: {priors}") + print("=="*8) + if dominant is not None: + print(f"Trader {dominant+1} is the global optimist (rate-dominant)") + else: + print(f"No global optimist exists") + print("=="*8 + "\n") +``` + +```{solution-end} +``` From 6f75acec04dfae5882ce1a7c8eb28fc4688e7365 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Fri, 17 Oct 2025 10:38:50 +1100 Subject: [PATCH 06/20] minor update --- lectures/harrison_kreps.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/lectures/harrison_kreps.md b/lectures/harrison_kreps.md index 2d58f045d..03cc6d269 100644 --- a/lectures/harrison_kreps.md +++ b/lectures/harrison_kreps.md @@ -56,8 +56,6 @@ Let's start with some standard imports: import numpy as np import quantecon as qe import scipy.linalg as la -import matplotlib.pyplot as plt -import math ``` ### References From 394071710e71c56421712e3885f717b2512662ee Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Fri, 17 Oct 2025 10:40:29 +1100 Subject: [PATCH 07/20] minor updates --- lectures/morris_learn.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 52a200485..fac8ebbfd 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -337,7 +337,8 @@ Trader 1 is the global optimist, so the normalized price equals trader 1's funda ```{code-cell} ipython3 β = 0.75 -price_go, μ1_go, μ2_go = price_learning_two_agents((2,1), (1,2), β=β, T=150) +price_go, μ1_go, μ2_go = price_learning_two_agents( + (2,1), (1,2), β=β, T=150) perpetuity_1 = (β / (1 - β)) * μ1_go(0, 0) perpetuity_2 = (β / (1 - β)) * μ2_go(0, 0) @@ -357,7 +358,8 @@ These produce crossing posteriors, so there is no global optimist and the price ```{code-cell} ipython3 β = .75 -price_ps, μ1_ps, μ2_ps = price_learning_two_agents((1,1), (0.5,0.5), β=β, T=200) +price_ps, μ1_ps, μ2_ps = price_learning_two_agents( + (1,1), (0.5,0.5), β=β, T=200) price_00 = price_ps[0,0] μ1_00 = μ1_ps(0,0) @@ -487,7 +489,8 @@ Let's verify using the code below ```{code-cell} ipython3 dominant = None for i in range(len(priors)): - is_dom = all(priors[i][0] >= priors[j][0] and priors[i][1] <= priors[j][1] + is_dom = all( + priors[i][0] >= priors[j][0] and priors[i][1] <= priors[j][1] for j in range(len(priors)) if i != j) if is_dom: dominant = i From e95dc0e169c362ac4783f12eb07174c692288bdc Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Fri, 17 Oct 2025 10:41:34 +1100 Subject: [PATCH 08/20] update toc --- lectures/_toc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lectures/_toc.yml b/lectures/_toc.yml index 5886601da..1474e4679 100644 --- a/lectures/_toc.yml +++ b/lectures/_toc.yml @@ -112,6 +112,7 @@ parts: - file: markov_asset - file: ge_arrow - file: harrison_kreps + - file: morris_learn - caption: Data and Empirics numbered: true chapters: From 3a603aa0f91fd66f020c82325addf10ca104eb1e Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Fri, 17 Oct 2025 22:58:08 +1100 Subject: [PATCH 09/20] updates --- lectures/morris_learn.md | 114 +++++++++++++++++++++++---------------- 1 file changed, 69 insertions(+), 45 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index fac8ebbfd..42ca7f232 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -39,23 +39,26 @@ In addition to what's in Anaconda, this lecture uses following libraries: ## Overview -This lecture describes a model of {cite:t}`Morris1996` that extends the -{cite:t}`HarrKreps1978` model of speculative asset pricing (see {doc}`harrison_kreps`). +This lecture describes a model of {cite:t}`Morris1996` that extends the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. -The Harrison-Kreps model features heterogeneous beliefs but assumes that investors have hard-wired beliefs about asset fundamentals. +The model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. -Morris replaced the fixed beliefs with Bayesian learning, where traders update their beliefs using Bayes' Law as new dividend data arrive. +The Harrison-Kreps model features heterogeneous beliefs but assumes that traders have dogmatic, hard-wired beliefs about asset fundamentals. + +Morris replaced dogmatic beliefs with *Bayesian learning*: traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. Key features of Morris's model: -* All traders share the same statistical model (manifold) for prospective dividends +* All traders share the same manifold of statistical models for prospective dividends * All observe the same dividend histories * All use Bayes' Law to update beliefs -* Traders have different *prior distributions* over parameters of the dividend process +* But they have different initial *prior distributions* over the parameter that indexes the common statistical model + +By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogeneous beliefs. -This heterogeneity in priors leads to heterogeneous *posterior beliefs* even though all traders observe identical data. +Along identical histories of dividends, traders have different *posterior distributions* for prospective dividends. -These differences create opportunities for speculation and potential price bubbles. +Those differences set the stage for possible speculation and price bubbles. Let's start with some standard imports: @@ -70,41 +73,55 @@ Prior to reading the following, you might like to review our lectures on * {doc}`Likelihood ratio processes ` * {doc}`Bayesian versus frequentist statistics ` -This section describes how {cite:t}`Morris1996` modified the Harrison–Kreps{cite}`HarrKreps1978` model. -Harrison and Kreps assumed dogmatic traders with hard-wired beliefs. +## Structure of the model -Morris replaced them with traders who use Bayes' Law to update their beliefs about prospective dividends. +There is a fixed supply of shares of an asset. -In Morris's model, all traders share the same manifold of statistical models for prospective dividends. +Each share entitles its owner to a stream of *binary* i.i.d. dividends $\{d_t\}$ where -All observe the same dividend histories. +$$ +d_{t+1} \in \{0,1\} +$$ -All use Bayes' Law. +The dividend equals $1$ with unknown probability $\theta \in (0,1)$ and equals $0$ with probability $1-\theta$. -But they might have different initial prior distributions over the parameter that indexes a common manifold of statistical models. +Unlike Harrison-Kreps where traders have hard-wired beliefs about a Markov transition matrix, in Morris's model: +* The true dividend probability $\theta$ is unknown +* Traders have *prior beliefs* about $\theta$ +* Traders observe dividend realizations and update beliefs via Bayes' Law -By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogeneous beliefs. +There is a finite set $\mathcal{I}$ of *risk-neutral* traders. -Along identical histories of dividends, traders have different posterior distributions for prospective dividends. +All traders have the same discount factor $\beta \in (0,1)$, which is related to the risk-free interest rate $r$ by $\beta = 1/(1+r)$. -Those differences set the stage for possible speculation and price bubbles. +### Trading and constraints -## The setting +Traders buy and sell the risky asset in competitive markets each period $t = 0, 1, 2, \ldots$ after dividends are paid. +As in Harrison-Kreps: -The risky asset pays i.i.d. dividends $d_{t+1} \in \{0,1\}$ with unknown probability $\theta \in (0,1)$ that the dividend equals $1$. +* The stock is traded *ex dividend* +* An owner of a share at the end of time $t$ is entitled to the dividend at time $t+1$ +* An owner also has the right to sell the share at time $t+1$ -There is a finite set $\mathcal{I}$ of risk-neutral traders. +*Short sales are prohibited*. -Traders buy and sell the risky asset in competitive markets each period $t = 0, 1, 2, \ldots$ after dividends are paid. +This matters because it limits how pessimists can express their opinions: + +* They *can* express themselves by selling their shares +* They *cannot* express themselves more loudly by borrowing shares and selling them -Traders face a short-sale constraint: they cannot sell the risky asset short. +All traders have sufficient wealth to purchase the risky asset. -All traders have sufficient wealth to purchase the risky asset as in the previous sections. +## Information and beliefs -All traders observe the full dividend history $(d_1, d_2, \ldots, d_t)$ and update beliefs by Bayes' rule, but they have heterogeneous priors over $\theta$. +All traders observe the full dividend history $(d_1, d_2, \ldots, d_t)$ and update beliefs by Bayes' rule. + +However, they have *heterogeneous priors* over the unknown dividend probability $\theta$. + +This heterogeneity in priors, combined with the same observed data, produces heterogeneous posterior beliefs. ### Beta prior specification @@ -120,7 +137,8 @@ where $a_i, b_i > 0$ are the prior parameters. The definition of Beta distribution can be found in {doc}`divergence_measures`. ``` -Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid (i.e., $s$ successes and $t-s$ failures). +Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid +(i.e., $s$ successes with dividend and $t-s$ failures without dividend). By Bayes' rule, the posterior density over $\theta$ is: @@ -151,6 +169,8 @@ This is the probability trader $i$ assigns to receiving a dividend next period, Fundamental valuations reflect the expected value to each trader of holding the asset *forever*. +Equilibrium prices are determined by the most optimistic trader with the highest valuation at each history. + However, in a market where the asset can be resold, traders take into account the possibility of selling at a price higher than their fundamental valuation in some future state. ```{prf:definition} Most Optimistic Valuation @@ -226,10 +246,10 @@ $$ p(s,t,r) > \mu_i(s,t) \quad \text{for all } i \in \mathcal{I} $$ -The **speculative premium** for trader $i$ is: +The **speculative premium** is defined as: $$ -p(s,t,r) - \mu_i(s,t) > 0 +p(s,t,r) - \mu^*(s,t) > 0 $$ ``` @@ -254,7 +274,7 @@ $$ For two traders with Beta priors: 1. If trader 1 rate-dominates trader 2, then trader 1 is a **global optimist**: $\mu_1(s,t) \geq \mu_2(s,t)$ for all histories $(s,t)$ -2. In this case, $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$. There is **no speculative premium** +2. In this case where $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$, there is *no speculative premium*. ``` When neither trader rate-dominates the other, the identity of the most optimistic trader can switch with dividend data. @@ -338,7 +358,7 @@ Trader 1 is the global optimist, so the normalized price equals trader 1's funda ```{code-cell} ipython3 β = 0.75 price_go, μ1_go, μ2_go = price_learning_two_agents( - (2,1), (1,2), β=β, T=150) + (2,1), (1,2), β=β, T=200) perpetuity_1 = (β / (1 - β)) * μ1_go(0, 0) perpetuity_2 = (β / (1 - β)) * μ2_go(0, 0) @@ -357,7 +377,6 @@ Now assume trader 1 has $\text{Beta}(1,1)$, trader 2 has $\text{Beta}(1/2,1/2)$. These produce crossing posteriors, so there is no global optimist and the price exceeds both fundamentals early on. ```{code-cell} ipython3 -β = .75 price_ps, μ1_ps, μ2_ps = price_learning_two_agents( (1,1), (0.5,0.5), β=β, T=200) @@ -392,12 +411,24 @@ p00 = np.array([normalized_price_two_agents( for r in r_grid]) plt.figure(figsize=(6,4)) -plt.plot(r_grid, p00, 'k-') +plt.plot(r_grid, p00) plt.xlabel('r') plt.ylabel(r'$p^*(0,0,r)$') -plt.title('Figure I: Normalized Price vs Interest Rate') +plt.axhline(0.5, color='C1', linestyle='--') +plt.title('Figure I: normalized price vs interest rate') plt.show() +``` + +In the first figure, we can see: + +- The resale option pushes the normalized price $p^*(0,0,r)$ above fundamentals $(0.5)$ for any finite $r$. +- As $r$ increases ($\beta$ decreases), the option value fades and $p^*(0,0,r) \to 0.5$. + +- At $r = 0.05$ the premium is about $8–9\%$, consistent with Morris (1996, Section IV). + + +```{code-cell} ipython3 # Figure II: p*(t/2,t,0.05) as a function of t r = 0.05 T = 60 @@ -407,10 +438,11 @@ s_vals = t_vals // 2 y = np.array([p_mat[s, t] for s, t in zip(s_vals, t_vals)]) plt.figure(figsize=(6,4)) -plt.plot(t_vals, y, 'k-') +plt.plot(t_vals, y) plt.xlabel('t') plt.ylabel(r'$p^*(t/2,t,0.05)$') -plt.title('Figure II: Normalized Price vs Time (r=0.05)') +plt.axhline(0.5, color='C1', linestyle='--') +plt.title('Figure II: normalized price vs time (r=0.05)') plt.show() p0 = p_mat[0,0] @@ -419,14 +451,6 @@ print("Initial normalized premium at r=0.05 (%):", np.round(100 * (p0 / mu0 - 1.0), 2)) ``` -In the first figure, we can see: - -- The resale option pushes the normalized price $p*(0,0,r)$ above fundamentals $(0.5)$ for any finite $r$. - -- As $r$ increases ($\beta$ decreases), the option value fades and $p*(0,0,r) \to 0.5$. - -- At $r = 0.05$ the premium is about $8–9\%$, consistent with Morris (1996, Section IV). - In the second figure, we can see: - Along the symmetric path $s = t/2$, both traders’ fundamentals equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. @@ -480,7 +504,7 @@ for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): print(f" Trader {i} = {np.round(perp, 6)}") ``` -From the trader valuation, we can see that the asset price is above all traders' valuations. +We can see that the asset price is above all traders' valuations. Morris tells us that no rate dominance exists in this case. @@ -512,7 +536,7 @@ Indeed, there is no global optimist and a speculative premium exists. Morris {cite}`Morris1996` provides a sharp characterization of when speculative bubbles arise. -The key condition is that there is no **global optimist*. +The key condition is that there is no *global optimist*. In this exercise, you will verify this condition for the following sets of traders with Beta priors: From 3826fa0c291369304b8ef3e3fb2fa7b35a5cad95 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Fri, 17 Oct 2025 23:03:46 +1100 Subject: [PATCH 10/20] minor update --- lectures/morris_learn.md | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 42ca7f232..009e6f16b 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -29,14 +29,6 @@ kernelspec: :depth: 2 ``` -In addition to what's in Anaconda, this lecture uses following libraries: - -```{code-cell} ipython3 -:tags: [hide-output] - -!pip install quantecon -``` - ## Overview This lecture describes a model of {cite:t}`Morris1996` that extends the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. @@ -134,7 +126,7 @@ $$ where $a_i, b_i > 0$ are the prior parameters. ```{note} -The definition of Beta distribution can be found in {doc}`divergence_measures`. +The definition of the Beta distribution can be found in {doc}`divergence_measures`. ``` Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid @@ -392,9 +384,9 @@ print("Valuation of trader 1 at (0, 0) =", perpetuity_1) print("Valuation of trader 2 at (0, 0) =", perpetuity_2) ``` -The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as data arrive. +The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as data arrive. -Under this setting we reproduce the two key figures reported in {cite:t}`Morris1996` +Under this setting, we reproduce the two key figures reported in {cite:t}`Morris1996` ```{code-cell} ipython3 def normalized_price_two_agents(prior1, prior2, r, T=250): @@ -508,7 +500,7 @@ We can see that the asset price is above all traders' valuations. Morris tells us that no rate dominance exists in this case. -Let's verify using the code below +Let's verify this using the code below ```{code-cell} ipython3 dominant = None From 9c38391ff5b63d7bb08ebdcdf7307e9c21f85f25 Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Fri, 17 Oct 2025 12:38:02 -0400 Subject: [PATCH 11/20] Tom's October 17 edits of the Morris lecture --- lectures/morris_learn.md | 95 ++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 38 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 009e6f16b..3b9e319ca 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -31,22 +31,31 @@ kernelspec: ## Overview -This lecture describes a model of {cite:t}`Morris1996` that extends the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. +This lecture describes how {cite:t}`Morris1996` extends the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. The model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. -The Harrison-Kreps model features heterogeneous beliefs but assumes that traders have dogmatic, hard-wired beliefs about asset fundamentals. +The Harrison-Kreps model assumes that the traders have dogmatic, hard-wired beliefs about the asset's payout stream, i.e., its dividend stream or ''fundamentals''. -Morris replaced dogmatic beliefs with *Bayesian learning*: traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. +Morris replaced dogmatic beliefs about the dividend stream with non-dogmatic traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. -Key features of Morris's model: +```{note} +But notice below that the traders don't use data on past prices of the asset to update their beliefs about the +dividend process. +``` + +Key features of Morris's model include: * All traders share the same manifold of statistical models for prospective dividends * All observe the same dividend histories * All use Bayes' Law to update beliefs -* But they have different initial *prior distributions* over the parameter that indexes the common statistical model +* Traders have different initial *prior distributions* over a parameter that indexes the common statistical model -By endowing agents with different prior distributions over a parameter describing the distribution of prospective dividends, Morris builds in heterogeneous beliefs. +By endowing agents with different prior distributions over that parameter, Morris builds his model of heterogeneous beliefs. + +```{note} +Morris has thereby set things up so that we anticipate that after long enough histories, traders eventually agree about the tail of the asset's dividend stream. +``` Along identical histories of dividends, traders have different *posterior distributions* for prospective dividends. @@ -59,7 +68,7 @@ import numpy as np import matplotlib.pyplot as plt ``` -Prior to reading the following, you might like to review our lectures on +Prior to reading this lecture, you might want to review the following quantecon lectures: * {doc}`Harrison-Kreps model ` * {doc}`Likelihood ratio processes ` @@ -76,9 +85,9 @@ $$ d_{t+1} \in \{0,1\} $$ -The dividend equals $1$ with unknown probability $\theta \in (0,1)$ and equals $0$ with probability $1-\theta$. +The dividend at time $t$ equals $1$ with unknown probability $\theta \in (0,1)$ and equals $0$ with probability $1-\theta$. -Unlike Harrison-Kreps where traders have hard-wired beliefs about a Markov transition matrix, in Morris's model: +Unlike {cite}`HarrKreps1978` where traders have hard-wired beliefs about a Markov transition matrix, in Morris's model: * The true dividend probability $\theta$ is unknown * Traders have *prior beliefs* about $\theta$ @@ -86,7 +95,9 @@ Unlike Harrison-Kreps where traders have hard-wired beliefs about a Markov trans There is a finite set $\mathcal{I}$ of *risk-neutral* traders. -All traders have the same discount factor $\beta \in (0,1)$, which is related to the risk-free interest rate $r$ by $\beta = 1/(1+r)$. +All traders have the same discount factor $\beta \in (0,1)$. + +* you can think of $\beta$ as being related to a net risk-free interest rate $r$ by $\beta = 1/(1+r)$. ### Trading and constraints @@ -94,9 +105,9 @@ Traders buy and sell the risky asset in competitive markets each period $t = 0, As in Harrison-Kreps: -* The stock is traded *ex dividend* +* The asset is traded *ex dividend* * An owner of a share at the end of time $t$ is entitled to the dividend at time $t+1$ -* An owner also has the right to sell the share at time $t+1$ +* An owner of a share at the end of period $t$ also has the right to sell the share at time $t+1$ after having received the dividend at time $t+1$. *Short sales are prohibited*. @@ -109,9 +120,11 @@ All traders have sufficient wealth to purchase the risky asset. ## Information and beliefs -All traders observe the full dividend history $(d_1, d_2, \ldots, d_t)$ and update beliefs by Bayes' rule. +All traders observe the same dividend history $(d_1, d_2, \ldots, d_t)$. + +Based on that information flow, all update beliefs by Bayes' rule. -However, they have *heterogeneous priors* over the unknown dividend probability $\theta$. +However, traders have *heterogeneous priors* over the unknown dividend probability $\theta$. This heterogeneity in priors, combined with the same observed data, produces heterogeneous posterior beliefs. @@ -126,7 +139,7 @@ $$ where $a_i, b_i > 0$ are the prior parameters. ```{note} -The definition of the Beta distribution can be found in {doc}`divergence_measures`. +The definition of the Beta distribution can be found in this quantecon lecture {doc}`divergence_measures`. ``` Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid @@ -155,15 +168,22 @@ $$ Morris refers to $\mu_i(s,t)$ as trader $i$'s **fundamental valuation** of the asset after history $(s,t)$. -This is the probability trader $i$ assigns to receiving a dividend next period, which reflects their updated belief about $\theta$. +This is the probability trader $i$ assigns to receiving a dividend next period. + +It embeds trader $i$'s updated belief about $\theta$. ## Market prices with learning -Fundamental valuations reflect the expected value to each trader of holding the asset *forever*. +Fundamental valuations equal expected present values of dividends that our heterogenous traders +attach to the option of holding the asset *forever*. + +The equilibrium price process is determined by the condition that the asset is held at time $t$ by the trader with who attaches the highest valuation to the asset at time $t$. + +An owner of the asset has option to sell it after receiving that period's dividend. -Equilibrium prices are determined by the most optimistic trader with the highest valuation at each history. +Traders take that into account. -However, in a market where the asset can be resold, traders take into account the possibility of selling at a price higher than their fundamental valuation in some future state. +That opens the the possibility that at time $t$ a trader will be willing to pay more for the asset than the trader's fundamental valuation. ```{prf:definition} Most Optimistic Valuation :label: most_optimistic_valuation @@ -193,16 +213,16 @@ The equilibrium price equals the highest expected discounted return among all tr ```{prf:definition} Normalized Price :label: normalized_price -The normalized price is defined as: +Define the normalized price as: $$ p(s,t,r) = r \tilde{p}(s,t,r) $$ -Since the current dollar price of the riskless asset is $1/r$, this represents the price of the risky asset in terms of the riskless asset. +Since the current ''dollar'' price of the riskless asset is $1/r$, this represents the price of the risky asset in terms of the riskless asset. ``` -Substituting into the equilibrium condition gives: +Substituting the preceding formula into the equilibrium condition gives: $$ p(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} @@ -216,7 +236,7 @@ p(s,t,r) = \mu^*(s,t) + \frac{r}{1+r} \Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) - \mu^*(s,t) \Bigr] $$ -Following Harrison and Kreps, a price scheme satisfying the equilibrium condition can be computed recursively. +Following Harrison and Kreps, a price function that satisfies the equilibrium condition can be computed recursively. Set $p^0(s,t,r) = 0$ for all $(s,t,r)$, and define $p^{n+1}(s,t,r)$ by: @@ -238,7 +258,7 @@ $$ p(s,t,r) > \mu_i(s,t) \quad \text{for all } i \in \mathcal{I} $$ -The **speculative premium** is defined as: +Define the **speculative premium** as: $$ p(s,t,r) - \mu^*(s,t) > 0 @@ -248,7 +268,7 @@ $$ ## Two Traders -We now focus on the case with two traders having priors $(a_1,b_1)$ and $(a_2,b_2)$. +We now focus on an example with two traders with priors $(a_1,b_1)$ and $(a_2,b_2)$. ```{prf:definition} Rate Dominance (Beta Priors) :label: rate_dominance_beta @@ -269,20 +289,19 @@ For two traders with Beta priors: 2. In this case where $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$, there is *no speculative premium*. ``` -When neither trader rate-dominates the other, the identity of the most optimistic trader can switch with dividend data. +When neither trader rate-dominates the other, the identity of the most optimistic trader can switch as dividends accrue. -In this perpetual switching case, the price strictly exceeds both traders' fundamental valuations before learning converges: +Along a history in which perpetual switching occurs, the price of the asset strictly exceeds both traders' fundamental valuations so long as traders continue to disagree: $$ p(s,t,r) > \max\{\mu_1(s,t), \mu_2(s,t)\} $$ -This is consistent with our discussion about the expectation of future resale opportunities -creating a speculative premium. +Thus, along such a history, there is a persistent speculative premium. ### Implementation -For computational tractability, we work with a finite horizon $T$ and solve by backward induction. +For computational tractability, let's work with a finite horizon $T$ and solve by backward induction. We use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via: @@ -290,7 +309,7 @@ $$ \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] $$ -The terminal condition $\tilde{p}(s,T)$ is set equal to the perpetuity value under the most optimistic belief. +We set the terminal price $\tilde{p}(s,T)$ equal to the perpetuity value under the most optimistic belief. ```{code-cell} ipython3 def posterior_mean(a, b, s, t): @@ -384,9 +403,9 @@ print("Valuation of trader 1 at (0, 0) =", perpetuity_1) print("Valuation of trader 2 at (0, 0) =", perpetuity_2) ``` -The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as data arrive. +The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as dividends arrive sequentially. -Under this setting, we reproduce the two key figures reported in {cite:t}`Morris1996` +Within this setting, we can reproduce two key figures reported in {cite:t}`Morris1996` ```{code-cell} ipython3 def normalized_price_two_agents(prior1, prior2, r, T=250): @@ -411,7 +430,7 @@ plt.title('Figure I: normalized price vs interest rate') plt.show() ``` -In the first figure, we can see: +In the first figure, notice that: - The resale option pushes the normalized price $p^*(0,0,r)$ above fundamentals $(0.5)$ for any finite $r$. @@ -443,14 +462,14 @@ print("Initial normalized premium at r=0.05 (%):", np.round(100 * (p0 / mu0 - 1.0), 2)) ``` -In the second figure, we can see: +In the second figure, notice that : - Along the symmetric path $s = t/2$, both traders’ fundamentals equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. ### General N–trader extension -The same recursion extends to any finite set of Beta priors $\{(a_i,b_i)\}_{i=1}^N$ by taking the max over $i$ each period. +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. ```{code-cell} ipython3 def price_learning(priors, β=.75, T=200): @@ -496,7 +515,7 @@ for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): print(f" Trader {i} = {np.round(perp, 6)}") ``` -We can see that the asset price is above all traders' valuations. +Note that the asset price is above all traders' valuations. Morris tells us that no rate dominance exists in this case. @@ -520,7 +539,7 @@ else: Indeed, there is no global optimist and a speculative premium exists. -## Exercises +## Exercise ```{exercise-start} :label: hk_ex3 From 6c1a0c4ccf5b77fa9543e283c4d9304441b8d04b Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Sat, 18 Oct 2025 23:17:47 +1100 Subject: [PATCH 12/20] minor update --- lectures/morris_learn.md | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 3b9e319ca..b1a024398 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -31,13 +31,13 @@ kernelspec: ## Overview -This lecture describes how {cite:t}`Morris1996` extends the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. +This lecture describes how {cite:t}`Morris1996` extends the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. The model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. -The Harrison-Kreps model assumes that the traders have dogmatic, hard-wired beliefs about the asset's payout stream, i.e., its dividend stream or ''fundamentals''. +The Harrison-Kreps model assumes that the traders have dogmatic, hard-wired beliefs about the asset's payout stream, i.e., its dividend stream or "fundamentals". -Morris replaced dogmatic beliefs about the dividend stream with non-dogmatic traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. +Morris replaced dogmatic beliefs about the dividend stream with non-dogmatic traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. ```{note} But notice below that the traders don't use data on past prices of the asset to update their beliefs about the @@ -49,9 +49,9 @@ Key features of Morris's model include: * All traders share the same manifold of statistical models for prospective dividends * All observe the same dividend histories * All use Bayes' Law to update beliefs -* Traders have different initial *prior distributions* over a parameter that indexes the common statistical model +* Traders have different initial *prior distributions* over a parameter that indexes the common statistical model -By endowing agents with different prior distributions over that parameter, Morris builds his model of heterogeneous beliefs. +By endowing agents with different prior distributions over that parameter, Morris builds his model of heterogeneous beliefs. ```{note} Morris has thereby set things up so that we anticipate that after long enough histories, traders eventually agree about the tail of the asset's dividend stream. @@ -68,7 +68,7 @@ import numpy as np import matplotlib.pyplot as plt ``` -Prior to reading this lecture, you might want to review the following quantecon lectures: +Prior to reading this lecture, you might want to review the following quantecon lectures: * {doc}`Harrison-Kreps model ` * {doc}`Likelihood ratio processes ` @@ -97,7 +97,7 @@ There is a finite set $\mathcal{I}$ of *risk-neutral* traders. All traders have the same discount factor $\beta \in (0,1)$. -* you can think of $\beta$ as being related to a net risk-free interest rate $r$ by $\beta = 1/(1+r)$. +* You can think of $\beta$ as being related to a net risk-free interest rate $r$ by $\beta = 1/(1+r)$. ### Trading and constraints @@ -107,7 +107,7 @@ As in Harrison-Kreps: * The asset is traded *ex dividend* * An owner of a share at the end of time $t$ is entitled to the dividend at time $t+1$ -* An owner of a share at the end of period $t$ also has the right to sell the share at time $t+1$ after having received the dividend at time $t+1$. +* An owner of a share at the end of period $t$ also has the right to sell the share at time $t+1$ after having received the dividend at time $t+1$. *Short sales are prohibited*. @@ -174,16 +174,16 @@ It embeds trader $i$'s updated belief about $\theta$. ## Market prices with learning -Fundamental valuations equal expected present values of dividends that our heterogenous traders -attach to the option of holding the asset *forever*. +Fundamental valuations equal expected present values of dividends that our heterogeneous traders +attach to the option of holding the asset *forever*. -The equilibrium price process is determined by the condition that the asset is held at time $t$ by the trader with who attaches the highest valuation to the asset at time $t$. +The equilibrium price process is determined by the condition that the asset is held at time $t$ by the trader who attaches the highest valuation to the asset at time $t$. -An owner of the asset has option to sell it after receiving that period's dividend. +An owner of the asset has the option to sell it after receiving that period's dividend. Traders take that into account. -That opens the the possibility that at time $t$ a trader will be willing to pay more for the asset than the trader's fundamental valuation. +That opens the possibility that at time $t$ a trader will be willing to pay more for the asset than the trader's fundamental valuation. ```{prf:definition} Most Optimistic Valuation :label: most_optimistic_valuation @@ -213,16 +213,16 @@ The equilibrium price equals the highest expected discounted return among all tr ```{prf:definition} Normalized Price :label: normalized_price -Define the normalized price as: +Define the normalized price as: $$ p(s,t,r) = r \tilde{p}(s,t,r) $$ -Since the current ''dollar'' price of the riskless asset is $1/r$, this represents the price of the risky asset in terms of the riskless asset. +Since the current "dollar" price of the riskless asset is $1/r$, this represents the price of the risky asset in terms of the riskless asset. ``` -Substituting the preceding formula into the equilibrium condition gives: +Substituting the preceding formula into the equilibrium condition gives: $$ p(s,t,r) = \frac{r}{1+r} \mu^*(s,t) + \frac{1}{1+r} @@ -236,7 +236,7 @@ p(s,t,r) = \mu^*(s,t) + \frac{r}{1+r} \Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) - \mu^*(s,t) \Bigr] $$ -Following Harrison and Kreps, a price function that satisfies the equilibrium condition can be computed recursively. +Following Harrison and Kreps, a price function that satisfies the equilibrium condition can be computed recursively. Set $p^0(s,t,r) = 0$ for all $(s,t,r)$, and define $p^{n+1}(s,t,r)$ by: @@ -258,7 +258,7 @@ $$ p(s,t,r) > \mu_i(s,t) \quad \text{for all } i \in \mathcal{I} $$ -Define the **speculative premium** as: +Define the **speculative premium** as: $$ p(s,t,r) - \mu^*(s,t) > 0 @@ -289,15 +289,15 @@ For two traders with Beta priors: 2. In this case where $p(s,t,r) = \mu_1(s,t)$ for all $(s,t,r)$, there is *no speculative premium*. ``` -When neither trader rate-dominates the other, the identity of the most optimistic trader can switch as dividends accrue. +When neither trader rate-dominates the other, the identity of the most optimistic trader can switch as dividends accrue. -Along a history in which perpetual switching occurs, the price of the asset strictly exceeds both traders' fundamental valuations so long as traders continue to disagree: +Along a history in which perpetual switching occurs, the price of the asset strictly exceeds both traders' fundamental valuations so long as traders continue to disagree: $$ p(s,t,r) > \max\{\mu_1(s,t), \mu_2(s,t)\} $$ -Thus, along such a history, there is a persistent speculative premium. +Thus, along such a history, there is a persistent speculative premium. ### Implementation @@ -309,7 +309,7 @@ $$ \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] $$ -We set the terminal price $\tilde{p}(s,T)$ equal to the perpetuity value under the most optimistic belief. +We set the terminal price $\tilde{p}(s,T)$ equal to the perpetuity value under the most optimistic belief. ```{code-cell} ipython3 def posterior_mean(a, b, s, t): @@ -405,7 +405,7 @@ print("Valuation of trader 2 at (0, 0) =", perpetuity_2) The resulting premium reflects the option value of reselling to whichever trader becomes temporarily more optimistic as dividends arrive sequentially. -Within this setting, we can reproduce two key figures reported in {cite:t}`Morris1996` +Within this setting, we can reproduce two key figures reported in {cite:t}`Morris1996` ```{code-cell} ipython3 def normalized_price_two_agents(prior1, prior2, r, T=250): @@ -462,7 +462,7 @@ print("Initial normalized premium at r=0.05 (%):", np.round(100 * (p0 / mu0 - 1.0), 2)) ``` -In the second figure, notice that : +In the second figure, notice that: - Along the symmetric path $s = t/2$, both traders’ fundamentals equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. @@ -515,7 +515,7 @@ for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): print(f" Trader {i} = {np.round(perp, 6)}") ``` -Note that the asset price is above all traders' valuations. +Note that the asset price is above all traders' valuations. Morris tells us that no rate dominance exists in this case. From aeb1a554a9c67c5b1de7a846df954190793f3a4d Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Sun, 19 Oct 2025 11:51:43 -0600 Subject: [PATCH 13/20] Tom's edits of Morris lecture and bib file, October 19 --- lectures/_static/quant-econ.bib | 56 ++++++++++++++++ lectures/morris_learn.md | 113 +++++++++++++++++++++++++------- 2 files changed, 145 insertions(+), 24 deletions(-) diff --git a/lectures/_static/quant-econ.bib b/lectures/_static/quant-econ.bib index 7affa7193..5c5f15b80 100644 --- a/lectures/_static/quant-econ.bib +++ b/lectures/_static/quant-econ.bib @@ -3,6 +3,62 @@ Note: Extended Information (like abstracts, doi, url's etc.) can be found in quant-econ-extendedinfo.bib file in _static/ ### + +@article{harsanyi1968games, + title={Games with Incomplete Information Played by ``{B}ayesian'' Players, {I}--{III} Part {II}. {B}ayesian Equilibrium Points}, + author={Harsanyi, John C.}, + journal={Management Science}, + volume={14}, + number={5}, + pages={320--334}, + year={1968}, + publisher={INFORMS} +} + +@article{harsanyi1968games3, + title={Games with Incomplete Information Played by ``{B}ayesian'' Players, {I}--{III} Part {III}. {T}he Basic Probability Distribution of the Game}, + author={Harsanyi, John C.}, + journal={Management Science}, + volume={14}, + number={7}, + pages={486--502}, + year={1968}, + publisher={INFORMS} +} + +@article{harsanyi1967games, + title={Games with Incomplete Information Played by ``{B}ayesian'' Players, {I}--{III} Part {I}. {T}he Basic Model}, + author={Harsanyi, John C.}, + journal={Management Science}, + volume={14}, + number={3}, + pages={159--182}, + year={1967}, + publisher={INFORMS} +} + +@article{miller1977risk, + title={Risk, uncertainty, and divergence of opinion}, + author={Miller, Edward M}, + journal={The Journal of finance}, + volume={32}, + number={4}, + pages={1151--1168}, + year={1977}, + publisher={JSTOR} +} + +@article{jeffreys1946invariant, + title={An invariant form for the prior probability in estimation problems}, + author={Jeffreys, Harold}, + journal={Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences}, + volume={186}, + number={1007}, + pages={453--461}, + year={1946}, + publisher={The Royal Society London} +} + @article{blume2018case, title={A case for incomplete markets}, author={Blume, Lawrence E and Cogley, Timothy and Easley, David A and Sargent, Thomas J and Tsyrennikov, Viktor}, diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index b1a024398..4ac603b38 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -31,35 +31,35 @@ kernelspec: ## Overview -This lecture describes how {cite:t}`Morris1996` extends the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. +This lecture describes how {cite:t}`Morris1996` extended the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. -The model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. +Like Harrison and Kreps's model, Harris's model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. The Harrison-Kreps model assumes that the traders have dogmatic, hard-wired beliefs about the asset's payout stream, i.e., its dividend stream or "fundamentals". -Morris replaced dogmatic beliefs about the dividend stream with non-dogmatic traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. +Morris replaced Harrison and Kreps's traders with hard-wired beliefs about the dividend stream with traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. ```{note} -But notice below that the traders don't use data on past prices of the asset to update their beliefs about the +But Morris's traders don't use data on past prices of the asset to update their beliefs about the dividend process. ``` Key features of Morris's model include: -* All traders share the same manifold of statistical models for prospective dividends -* All observe the same dividend histories -* All use Bayes' Law to update beliefs -* Traders have different initial *prior distributions* over a parameter that indexes the common statistical model - -By endowing agents with different prior distributions over that parameter, Morris builds his model of heterogeneous beliefs. +* All traders share a manifold of statistical models for prospective dividends +* The manifold of statistical models is characterized by a single parameter +* All traders observe the same dividend histories +* All traders use Bayes' Law to update beliefs +* Traders have different initial *prior distributions* over the parameter that indexes the common statistical model +* Until traders' *posterior distributions* over that parameter eventually merge, traders disagree about the predictive density over prospective dividends and therefore about the expected present value of dividend streams, which trader regards as the *fundamental value* of the asset ```{note} -Morris has thereby set things up so that we anticipate that after long enough histories, traders eventually agree about the tail of the asset's dividend stream. +Morris has thereby set things up so that after long enough histories, traders eventually agree about the tail of the asset's dividend stream. ``` -Along identical histories of dividends, traders have different *posterior distributions* for prospective dividends. +Thus, although traders have identical *information*, i.e., histories of information, they have different *posterior distributions* for prospective dividends. -Those differences set the stage for possible speculation and price bubbles. +Just as in the hard-wired beliefs model of Harrison and Kreps, those differences set the stage for the emergence of an environment in which investors engange in *speculative behavior* in the sense that sometimes they place a value on the asset that exceeds what they regard as its fundamental value, i.e., the present value of its prospective dividend stream. Let's start with some standard imports: @@ -99,7 +99,12 @@ All traders have the same discount factor $\beta \in (0,1)$. * You can think of $\beta$ as being related to a net risk-free interest rate $r$ by $\beta = 1/(1+r)$. -### Trading and constraints +Owning the asset at the end of period $t$ entitles the owner to divdends at time $t+1, t+2, \ldots$. + +Because the dividend process is i.i.d., trader $i$ thinks that the fundamental value of the asset is the capitalized value of the dividend stream, namely, $\sum_{j=1}^\infty \beta^j \hat \theta_i += \frac{\hat \theta_i}{r}$, where $\hat \theta_i$ is the mean of the trader's posterior distribution over $\theta$. + +### Possible trades Traders buy and sell the risky asset in competitive markets each period $t = 0, 1, 2, \ldots$ after dividends are paid. @@ -122,13 +127,64 @@ All traders have sufficient wealth to purchase the risky asset. All traders observe the same dividend history $(d_1, d_2, \ldots, d_t)$. -Based on that information flow, all update beliefs by Bayes' rule. +Based on that information flow, all traders their subjective distribution over $\theta$ by applying Bayes' rule. However, traders have *heterogeneous priors* over the unknown dividend probability $\theta$. -This heterogeneity in priors, combined with the same observed data, produces heterogeneous posterior beliefs. +This heterogeneity in priors produces heterogeneous posterior beliefs. + +## Source of heterogeneous priors + +Imputing different statistical models to agents inside a model is controversial. + +Many game theorists and rational expectations applied economists think it is a bad idea. + +While they often construct models in which agents have different *information*, they prefer to assume that all agents inside the model +share the same statistical model -- i.e., the same joint probability distribution over the random processes being modeled. + +For a statistician or an economic theorist, a statistical model is joint probability distribution that is characeterized by a known parameter vector. + +When working with a *manifold* of statistical models swept out by parameters, say $\theta$ in a known set $\Theta$, economic theorists +reduce that manifold of models to a single model by imputing to all agents inside the model the same prior probability distribution over $\theta$. + +This is called the *Harsanyi Doctrine* or *Common Priors Doctrine*. + + + +{cite}`harsanyi1967games`, {cite}`harsanyi1968games`, {cite}`harsanyi1968games3` argued that if two rational agents have +the same information and the same reasoning capabilities, they should have same joint probability distribution over outcomes of interest. +He wanted to interpret disagreements as coming from different information sets, not from different statistical models. + + + + + +Notice how {cite}`HarrKreps1978` had also abandoned Harsanyi common statistical model assumption when they hard-wired dogmatic disparate beliefs. + +{cite:t}`Morris1996` evidently abandons the Harsanyi approach only partly -- he retains the assumption that agents share the same +manifold of statistical model. -### Beta prior specification +Morris's agents simply express their initial ignorance parameter differently -- they have different priors. + + +Morris defends his assumption by alluding to an application that concerns him, namely, the observations about apparent ''mispricing'' of initial public offerings presented by {cite}`miller1977risk`. + +This is a situation in which agents have access to little or no data about a project and want to be open to changing their opinions as data flow in. + +Morris motivates his diverse-priors assumption by noting that there are two *different* ways to express ''maximal ignorance'' about the parameter of a Bernoulli distribution + + * a uniform distribution on $[0, 1]$ + * a Jeffrey's prior {cite}`jeffreys1946invariant` that is invariant to reparameterization; this has the form of a Beta distribution with parameters + $.5, .5$ + +Is one of these priors more rational than the other? + +Morris thinks not. + + + + +## Beta priors For tractability, assume trader $i$ has a Beta prior over the dividend probability @@ -139,7 +195,7 @@ $$ where $a_i, b_i > 0$ are the prior parameters. ```{note} -The definition of the Beta distribution can be found in this quantecon lecture {doc}`divergence_measures`. +The Beta distribution also appears in these quantecon lectures {doc}`divergence_measures`, {doc}`likelihood_ratio_process`, {doc}`odu`. ``` Suppose trader $i$ observes a history of $t$ periods in which a total of $s$ dividends are paid @@ -154,9 +210,7 @@ $$ where $\pi_i(\theta)$ is trader $i$'s prior density. ```{note} -The Beta distribution is the conjugate prior for the Binomial likelihood. - -When the prior is $\text{Beta}(a_i, b_i)$ and we observe $s$ successes in $t$ trials, the posterior is $\text{Beta}(a_i+s, b_i+t-s)$. +The Beta distribution is the conjugate prior for the Binomial likelihood. This means that when the prior is $\text{Beta}(a_i, b_i)$ and we observe $s$ successes in $t$ trials, the posterior is $\text{Beta}(a_i+s, b_i+t-s)$. ``` The posterior mean (or expected dividend probability) is: @@ -183,7 +237,7 @@ An owner of the asset has the option to sell it after receiving that period's di Traders take that into account. -That opens the possibility that at time $t$ a trader will be willing to pay more for the asset than the trader's fundamental valuation. +That opens the possibility that a trader will be willing to pay more for the asset than that trader's fundamental valuation. ```{prf:definition} Most Optimistic Valuation :label: most_optimistic_valuation @@ -236,7 +290,7 @@ p(s,t,r) = \mu^*(s,t) + \frac{r}{1+r} \Bigl[ \mu^*(s,t) p(s+1,t+1,r) + (1 - \mu^*(s,t)) p(s,t+1,r) - \mu^*(s,t) \Bigr] $$ -Following Harrison and Kreps, a price function that satisfies the equilibrium condition can be computed recursively. +A price function that satisfies the equilibrium condition can be computed recursively. Set $p^0(s,t,r) = 0$ for all $(s,t,r)$, and define $p^{n+1}(s,t,r)$ by: @@ -268,7 +322,7 @@ $$ ## Two Traders -We now focus on an example with two traders with priors $(a_1,b_1)$ and $(a_2,b_2)$. +We now focus on an example with two traders with Beta priors with parameters $(a_1,b_1)$ and $(a_2,b_2)$. ```{prf:definition} Rate Dominance (Beta Priors) :label: rate_dominance_beta @@ -303,6 +357,11 @@ Thus, along such a history, there is a persistent speculative premium. For computational tractability, let's work with a finite horizon $T$ and solve by backward induction. +```{note} +{cite:t}`Morris1996` page 1122 provides an argument that the limit as $T\rightarrow + \infty$ of such finite-horizon economies provides a useful +selection algorithm that excludes additional equilibria that involve a Ponzi-scheme price component that Morris dismisses as fragile. +``` + We use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via: $$ @@ -539,6 +598,12 @@ else: Indeed, there is no global optimist and a speculative premium exists. +## Concluding remarks + +{cite:t}`Morris1996` uses his model to interpret a ''hot issue'' anomaly described by {cite}`miller1977risk` according to which opening market prices of initial public offerings seem higher than values prices that emerge later. + + + ## Exercise ```{exercise-start} From a7f8445c175ac7bf087e5d16f36032ec9976cb44 Mon Sep 17 00:00:00 2001 From: Humphrey Yang <39026988+HumphreyYang@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:29:59 +1100 Subject: [PATCH 14/20] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lectures/morris_learn.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 4ac603b38..6d46932db 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -33,7 +33,7 @@ kernelspec: This lecture describes how {cite:t}`Morris1996` extended the Harrison–Kreps model {cite}`HarrKreps1978` of speculative asset pricing. -Like Harrison and Kreps's model, Harris's model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. +Like Harrison and Kreps's model, Morris's model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. The Harrison-Kreps model assumes that the traders have dogmatic, hard-wired beliefs about the asset's payout stream, i.e., its dividend stream or "fundamentals". @@ -59,7 +59,7 @@ Morris has thereby set things up so that after long enough histories, traders ev Thus, although traders have identical *information*, i.e., histories of information, they have different *posterior distributions* for prospective dividends. -Just as in the hard-wired beliefs model of Harrison and Kreps, those differences set the stage for the emergence of an environment in which investors engange in *speculative behavior* in the sense that sometimes they place a value on the asset that exceeds what they regard as its fundamental value, i.e., the present value of its prospective dividend stream. +Just as in the hard-wired beliefs model of Harrison and Kreps, those differences set the stage for the emergence of an environment in which investors engage in *speculative behavior* in the sense that sometimes they place a value on the asset that exceeds what they regard as its fundamental value, i.e., the present value of its prospective dividend stream. Let's start with some standard imports: @@ -99,7 +99,7 @@ All traders have the same discount factor $\beta \in (0,1)$. * You can think of $\beta$ as being related to a net risk-free interest rate $r$ by $\beta = 1/(1+r)$. -Owning the asset at the end of period $t$ entitles the owner to divdends at time $t+1, t+2, \ldots$. +Owning the asset at the end of period $t$ entitles the owner to dividends at time $t+1, t+2, \ldots$. Because the dividend process is i.i.d., trader $i$ thinks that the fundamental value of the asset is the capitalized value of the dividend stream, namely, $\sum_{j=1}^\infty \beta^j \hat \theta_i = \frac{\hat \theta_i}{r}$, where $\hat \theta_i$ is the mean of the trader's posterior distribution over $\theta$. @@ -127,7 +127,7 @@ All traders have sufficient wealth to purchase the risky asset. All traders observe the same dividend history $(d_1, d_2, \ldots, d_t)$. -Based on that information flow, all traders their subjective distribution over $\theta$ by applying Bayes' rule. +Based on that information flow, all traders update their subjective distribution over $\theta$ by applying Bayes' rule. However, traders have *heterogeneous priors* over the unknown dividend probability $\theta$. @@ -142,7 +142,7 @@ Many game theorists and rational expectations applied economists think it is a While they often construct models in which agents have different *information*, they prefer to assume that all agents inside the model share the same statistical model -- i.e., the same joint probability distribution over the random processes being modeled. -For a statistician or an economic theorist, a statistical model is joint probability distribution that is characeterized by a known parameter vector. +For a statistician or an economic theorist, a statistical model is joint probability distribution that is characterized by a known parameter vector. When working with a *manifold* of statistical models swept out by parameters, say $\theta$ in a known set $\Theta$, economic theorists reduce that manifold of models to a single model by imputing to all agents inside the model the same prior probability distribution over $\theta$. From 143d8fc6343684e1a7b9a2b8c716c878c97dfdbb Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Mon, 20 Oct 2025 12:35:24 -0600 Subject: [PATCH 15/20] Tom's Oct 20 edits of Morris lecture --- lectures/morris_learn.md | 73 +++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 6d46932db..2ff354511 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -35,31 +35,36 @@ This lecture describes how {cite:t}`Morris1996` extended the Harrison–Kreps mo Like Harrison and Kreps's model, Morris's model determines the price of a dividend-yielding asset that is traded by risk-neutral investors who have heterogeneous beliefs. -The Harrison-Kreps model assumes that the traders have dogmatic, hard-wired beliefs about the asset's payout stream, i.e., its dividend stream or "fundamentals". +The Harrison-Kreps model assumes that the traders have dogmatic, hard-wired beliefs about the asset's dividend stream. Morris replaced Harrison and Kreps's traders with hard-wired beliefs about the dividend stream with traders who use Bayes' Law to update their beliefs about prospective dividends as new dividend data arrive. ```{note} -But Morris's traders don't use data on past prices of the asset to update their beliefs about the +Morris's traders don't use data on past prices of the asset to update their beliefs about the dividend process. ``` -Key features of Morris's model include: +Key features of the environment in Morris's model include: * All traders share a manifold of statistical models for prospective dividends -* The manifold of statistical models is characterized by a single parameter -* All traders observe the same dividend histories +* A single parameter indexes the manifold of statistical models +* All traders observe the same dividend history * All traders use Bayes' Law to update beliefs -* Traders have different initial *prior distributions* over the parameter that indexes the common statistical model -* Until traders' *posterior distributions* over that parameter eventually merge, traders disagree about the predictive density over prospective dividends and therefore about the expected present value of dividend streams, which trader regards as the *fundamental value* of the asset +* Traders have different initial *prior distributions* over the parameter +* Traders' *posterior distributions* over the parameter eventually merge +* Before their posterior distributions merge, traders disagree about the predictive density over prospective dividends + * therefore they disagree about the value of the asset + +Just as in the hard-wired beliefs model of Harrison and Kreps, those differences of opinion induce investors to engage in *speculative behavior* in the following sense: + + * sometimes they value on the asset more than what they regard as its fundamental value, i.e., the present value of its prospective dividend stream -```{note} -Morris has thereby set things up so that after long enough histories, traders eventually agree about the tail of the asset's dividend stream. -``` -Thus, although traders have identical *information*, i.e., histories of information, they have different *posterior distributions* for prospective dividends. +Prior to reading this lecture, you might want to review the following quantecon lectures: -Just as in the hard-wired beliefs model of Harrison and Kreps, those differences set the stage for the emergence of an environment in which investors engage in *speculative behavior* in the sense that sometimes they place a value on the asset that exceeds what they regard as its fundamental value, i.e., the present value of its prospective dividend stream. +* {doc}`Harrison-Kreps model ` +* {doc}`Likelihood ratio processes ` +* {doc}`Bayesian versus frequentist statistics ` Let's start with some standard imports: @@ -68,11 +73,6 @@ import numpy as np import matplotlib.pyplot as plt ``` -Prior to reading this lecture, you might want to review the following quantecon lectures: - -* {doc}`Harrison-Kreps model ` -* {doc}`Likelihood ratio processes ` -* {doc}`Bayesian versus frequentist statistics ` ## Structure of the model @@ -119,17 +119,17 @@ As in Harrison-Kreps: This matters because it limits how pessimists can express their opinions: * They *can* express themselves by selling their shares -* They *cannot* express themselves more loudly by borrowing shares and selling them +* They *cannot* express themselves more emphatically by borrowing shares and immediately selling them All traders have sufficient wealth to purchase the risky asset. ## Information and beliefs -All traders observe the same dividend history $(d_1, d_2, \ldots, d_t)$. +At time $t \geq 1$, all traders observe $(d_1, d_2, \ldots, d_t)$. -Based on that information flow, all traders update their subjective distribution over $\theta$ by applying Bayes' rule. +All traders update their subjective distribution over $\theta$ by applying Bayes' rule. -However, traders have *heterogeneous priors* over the unknown dividend probability $\theta$. +Traders have *heterogeneous priors* over the unknown dividend probability $\theta$. This heterogeneity in priors produces heterogeneous posterior beliefs. @@ -139,39 +139,42 @@ Imputing different statistical models to agents inside a model is controversial. Many game theorists and rational expectations applied economists think it is a bad idea. -While they often construct models in which agents have different *information*, they prefer to assume that all agents inside the model -share the same statistical model -- i.e., the same joint probability distribution over the random processes being modeled. +While these economists often construct models in which agents have different *information*, they prefer to assume that all of the agents inside their model always share the same statistical model -- i.e., the same joint probability distribution over the random processes being modeled. For a statistician or an economic theorist, a statistical model is joint probability distribution that is characterized by a known parameter vector. When working with a *manifold* of statistical models swept out by parameters, say $\theta$ in a known set $\Theta$, economic theorists -reduce that manifold of models to a single model by imputing to all agents inside the model the same prior probability distribution over $\theta$. +reduce the manifold of models to a single model by imputing to all agents inside the model the same prior probability distribution over $\theta$. -This is called the *Harsanyi Doctrine* or *Common Priors Doctrine*. +Proceeding in this way amounts to adhering to what is called the *Harsanyi Doctrine* or *Common Priors Doctrine*. {cite}`harsanyi1967games`, {cite}`harsanyi1968games`, {cite}`harsanyi1968games3` argued that if two rational agents have -the same information and the same reasoning capabilities, they should have same joint probability distribution over outcomes of interest. -He wanted to interpret disagreements as coming from different information sets, not from different statistical models. - +the same information and the same reasoning capabilities, they should have same joint probability distribution over outcomes of interest. +Harsanyi interpreted disagreements as arising from different information sets, not from different statistical models. +Notice how {cite}`HarrKreps1978` departed from the Harsanyi common statistical model assumption when they hard-wired dogmatic disparate beliefs. -Notice how {cite}`HarrKreps1978` had also abandoned Harsanyi common statistical model assumption when they hard-wired dogmatic disparate beliefs. +{cite:t}`Morris1996` evidently abandons the Harsanyi doctrine more blightly than Harrison and Kreps had. -{cite:t}`Morris1996` evidently abandons the Harsanyi approach only partly -- he retains the assumption that agents share the same -manifold of statistical model. + * he does assume that agents share the same manifold of statistical models, but $\ldots$ + * he assumes that they have different intial prior distributions over the parameter that indexed the manifold of statistical models Morris's agents simply express their initial ignorance parameter differently -- they have different priors. -Morris defends his assumption by alluding to an application that concerns him, namely, the observations about apparent ''mispricing'' of initial public offerings presented by {cite}`miller1977risk`. +Morris defends his assumption by alluding to an application that concerns him, namely, apparent ''mispricing'' of initial public offerings presented by {cite}`miller1977risk`. + +Miller described a situation in which agents have access to little or no data about a project. + +Morris wanted his traders to be open to changing their opinions as information about the parameter arrives. -This is a situation in which agents have access to little or no data about a project and want to be open to changing their opinions as data flow in. +Morris noted that knowledgeable statisticians have been known to disagree about an appropriate prior. -Morris motivates his diverse-priors assumption by noting that there are two *different* ways to express ''maximal ignorance'' about the parameter of a Bernoulli distribution +For example, he noted that there are two *different* ways to express ''maximal ignorance'' about the parameter of a Bernoulli distribution * a uniform distribution on $[0, 1]$ * a Jeffrey's prior {cite}`jeffreys1946invariant` that is invariant to reparameterization; this has the form of a Beta distribution with parameters @@ -358,7 +361,7 @@ Thus, along such a history, there is a persistent speculative premium. For computational tractability, let's work with a finite horizon $T$ and solve by backward induction. ```{note} -{cite:t}`Morris1996` page 1122 provides an argument that the limit as $T\rightarrow + \infty$ of such finite-horizon economies provides a useful +On page 1122, {cite:t}`Morris1996` provides an argument that the limit as $T\rightarrow + \infty$ of such finite-horizon economies provides a useful selection algorithm that excludes additional equilibria that involve a Ponzi-scheme price component that Morris dismisses as fragile. ``` From dbaf0ba669b5b13aaebf383b0aafb1ce0d0ccfb4 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 21 Oct 2025 15:42:54 +1100 Subject: [PATCH 16/20] enable proof_minimal_theme --- lectures/_config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index c60ac8dc0..4b97f1551 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -120,6 +120,9 @@ sphinx: schelling: https://intro.quantecon.org/schelling.html scalar_dynam: https://intro.quantecon.org/scalar_dynam.html complex_and_trig: https://intro.quantecon.org/complex_and_trig.html + # sphinx-proof + proof_minimal_theme: true + # sphinx-tojupyter tojupyter_static_file_path: ["source/_static", "_static"] tojupyter_target_html: true tojupyter_urlpath: "https://python.quantecon.org/" From f4de55a8807111e0304b16d03ecd83646c85490a Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Tue, 21 Oct 2025 16:10:18 +1100 Subject: [PATCH 17/20] update according to feedback --- lectures/morris_learn.md | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 2ff354511..7762a0235 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -365,7 +365,7 @@ On page 1122, {cite:t}`Morris1996` provides an argument that the limit as $T\ri selection algorithm that excludes additional equilibria that involve a Ponzi-scheme price component that Morris dismisses as fragile. ``` -We use the discount factor parameterization $\beta = 1/(1+r)$ and compute dollar prices $\tilde{p}(s,t)$ via: +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: $$ \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 ```{code-cell} ipython3 def normalized_price_two_agents(prior1, prior2, r, T=250): - """Return p(s,t,r) = r · \tilde p(s,t,r) for two traders.""" + """Return p(s,t,r) = r \tilde p(s,t,r) for two traders.""" β = 1.0 / (1.0 + r) price_array, *_ = price_learning_two_agents(prior1, prior2, β=β, T=T) return r * price_array @@ -483,12 +483,12 @@ p00 = np.array([normalized_price_two_agents( priors[0], priors[1], r, T=300)[0,0] for r in r_grid]) -plt.figure(figsize=(6,4)) -plt.plot(r_grid, p00) -plt.xlabel('r') -plt.ylabel(r'$p^*(0,0,r)$') -plt.axhline(0.5, color='C1', linestyle='--') -plt.title('Figure I: normalized price vs interest rate') +fig, ax = plt.subplots() +ax.plot(r_grid, p00) +ax.set_xlabel(r'$r$') +ax.set_ylabel(r'$p^*(0,0,r)$') +ax.axhline(0.5, color='C1', linestyle='--') +ax.set_title('Figure I: normalized price vs interest rate') plt.show() ``` @@ -510,18 +510,18 @@ t_vals = np.arange(0, 54, 2) s_vals = t_vals // 2 y = np.array([p_mat[s, t] for s, t in zip(s_vals, t_vals)]) -plt.figure(figsize=(6,4)) -plt.plot(t_vals, y) -plt.xlabel('t') -plt.ylabel(r'$p^*(t/2,t,0.05)$') -plt.axhline(0.5, color='C1', linestyle='--') -plt.title('Figure II: normalized price vs time (r=0.05)') +fig, ax = plt.subplots() +ax.plot(t_vals, y) +ax.set_xlabel(r'$t$') +ax.set_ylabel(r'$p^*(t/2,t,0.05)$') +ax.axhline(0.5, color='C1', linestyle='--') +ax.set_title('Figure II: normalized price vs time (r=0.05)') plt.show() p0 = p_mat[0,0] -mu0 = 0.5 +μ0 = 0.5 print("Initial normalized premium at r=0.05 (%):", - np.round(100 * (p0 / mu0 - 1.0), 2)) + np.round(100 * (p0 / μ0 - 1.0), 2)) ``` In the second figure, notice that: @@ -534,7 +534,7 @@ In the second figure, notice that: 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. ```{code-cell} ipython3 -def price_learning(priors, β=.75, T=200): +def price_learning(priors, β=0.75, T=200): """ N-trader version with heterogeneous Beta priors. """ @@ -562,18 +562,18 @@ def price_learning(priors, β=.75, T=200): return price_array -β = .75 +β = 0.75 priors = [(1,1), (0.5,0.5), (3,2)] price_N = price_learning(priors, β=β, T=150) # Compute valuations for each trader at (0,0) -mu_vals = [posterior_mean(a, b, 0, 0) for a, b in priors] -perp_vals = [(β / (1 - β)) * mu for mu in mu_vals] +μ_vals = [posterior_mean(a, b, 0, 0) for a, b in priors] +perp_vals = [(β / (1 - β)) * μ for μ in μ_vals] print("Three-trader example at (s,t)=(0,0):") print(f"Price at (0,0) = {np.round(price_N[0,0], 6)}") print(f"\nTrader valuations:") -for i, (mu, perp) in enumerate(zip(mu_vals, perp_vals), 1): +for i, (μ, perp) in enumerate(zip(μ_vals, perp_vals), 1): print(f" Trader {i} = {np.round(perp, 6)}") ``` From 83ea55fe4e77058fa51e54d594052292a90d7a94 Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Wed, 22 Oct 2025 00:45:58 +1100 Subject: [PATCH 18/20] update wiki link --- lectures/morris_learn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 7762a0235..aa41b4cdc 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -46,7 +46,7 @@ dividend process. Key features of the environment in Morris's model include: -* All traders share a manifold of statistical models for prospective dividends +* All traders share a [manifold](https://en.wikipedia.org/wiki/Manifold) of statistical models for prospective dividends * A single parameter indexes the manifold of statistical models * All traders observe the same dividend history * All traders use Bayes' Law to update beliefs From cb45e818013b5c572039c1b94dbea5c09d62f6f0 Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Tue, 21 Oct 2025 10:06:43 -0600 Subject: [PATCH 19/20] Tom's Oct 21 edits of the Morris lecture --- lectures/morris_learn.md | 50 ++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index aa41b4cdc..641859289 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -46,8 +46,8 @@ dividend process. Key features of the environment in Morris's model include: -* All traders share a [manifold](https://en.wikipedia.org/wiki/Manifold) of statistical models for prospective dividends -* A single parameter indexes the manifold of statistical models +* All traders share a set of statistical models for prospective dividends +* A single parameter indexes the set of statistical models * All traders observe the same dividend history * All traders use Bayes' Law to update beliefs * Traders have different initial *prior distributions* over the parameter @@ -57,7 +57,7 @@ Key features of the environment in Morris's model include: Just as in the hard-wired beliefs model of Harrison and Kreps, those differences of opinion induce investors to engage in *speculative behavior* in the following sense: - * sometimes they value on the asset more than what they regard as its fundamental value, i.e., the present value of its prospective dividend stream + * sometimes they are willing to pay more for the asset what they think is its ''fundamental'' value, i.e., the expected discounted value of its prospective dividend stream Prior to reading this lecture, you might want to review the following quantecon lectures: @@ -139,48 +139,52 @@ Imputing different statistical models to agents inside a model is controversial. Many game theorists and rational expectations applied economists think it is a bad idea. -While these economists often construct models in which agents have different *information*, they prefer to assume that all of the agents inside their model always share the same statistical model -- i.e., the same joint probability distribution over the random processes being modeled. +While these economists often construct models in which agents have different *information*, they prefer to assume that all of the agents inside their model always share the same statistical model -- i.e., the same joint probability distribution over the random process being modeled. -For a statistician or an economic theorist, a statistical model is joint probability distribution that is characterized by a known parameter vector. +For a statistician or an economic theorist, a statistical model is a joint probability distribution that is characterized by a known parameter vector. -When working with a *manifold* of statistical models swept out by parameters, say $\theta$ in a known set $\Theta$, economic theorists -reduce the manifold of models to a single model by imputing to all agents inside the model the same prior probability distribution over $\theta$. +When working with a *set* of statistical models swept out by parameters, say $\theta$ in a known set $\Theta$, economic theorists +reduce the set of models to a single model by imputing to all agents inside the model the same prior probability distribution over $\theta$. -Proceeding in this way amounts to adhering to what is called the *Harsanyi Doctrine* or *Common Priors Doctrine*. + +```{note} +A set of statistical models that has a particular geometric structure is called a [manifold](https://en.wikipedia.org/wiki/Manifold) of statistical models. Morris endows traders with a shared manifold of statistical models. +``` + +Proceeding in this way adheres to the *Harsanyi Common Priors Doctrine*. {cite}`harsanyi1967games`, {cite}`harsanyi1968games`, {cite}`harsanyi1968games3` argued that if two rational agents have -the same information and the same reasoning capabilities, they should have same joint probability distribution over outcomes of interest. +the same information and the same reasoning capabilities, they will have the same joint probability distribution over outcomes of interest. -Harsanyi interpreted disagreements as arising from different information sets, not from different statistical models. +Harsanyi interpreted disagreements about prospective outcomes as arising from differences in agents' information sets, not differences in their statistical models. -Notice how {cite}`HarrKreps1978` departed from the Harsanyi common statistical model assumption when they hard-wired dogmatic disparate beliefs. +Evidently, {cite}`HarrKreps1978` departed from the Harsanyi common statistical model assumption when they hard-wired dogmatic disparate beliefs. -{cite:t}`Morris1996` evidently abandons the Harsanyi doctrine more blightly than Harrison and Kreps had. +{cite:t}`Morris1996` abandons the Harsanyi doctrine less completely than Harrison and Kreps had. - * he does assume that agents share the same manifold of statistical models, but $\ldots$ - * he assumes that they have different intial prior distributions over the parameter that indexed the manifold of statistical models + * Morris does assume that agents share the same set of statistical models, but $\ldots$ + * Morris assumes that they have different initial prior distributions over the parameter that indexes the models -Morris's agents simply express their initial ignorance parameter differently -- they have different priors. +Morris's agents express their initial ignorance about the parameter differently -- they have different priors. -Morris defends his assumption by alluding to an application that concerns him, namely, apparent ''mispricing'' of initial public offerings presented by {cite}`miller1977risk`. +Morris defends his assumption by alluding to the apparent ''mispricing'' of initial public offerings presented by {cite}`miller1977risk`. -Miller described a situation in which agents have access to little or no data about a project. +Miller described a situation in which agents have access to little or no data about a new enterprise. Morris wanted his traders to be open to changing their opinions as information about the parameter arrives. -Morris noted that knowledgeable statisticians have been known to disagree about an appropriate prior. +Knowledgeable statisticians have been known to disagree about an appropriate prior. -For example, he noted that there are two *different* ways to express ''maximal ignorance'' about the parameter of a Bernoulli distribution +For example, Morris described *different* respectable ways to express ''maximal ignorance'' about the parameter of a Bernoulli distribution * a uniform distribution on $[0, 1]$ - * a Jeffrey's prior {cite}`jeffreys1946invariant` that is invariant to reparameterization; this has the form of a Beta distribution with parameters - $.5, .5$ + * a Jeffreys prior {cite}`jeffreys1946invariant` that is invariant to reparameterization; in the present situation, the Jeffreys prior takes the form of a Beta distribution with parameters $.5, .5$ -Is one of these priors more rational than the other? +Is one of these priors more ''rational'' than the other? Morris thinks not. @@ -526,7 +530,7 @@ print("Initial normalized premium at r=0.05 (%):", In the second figure, notice that: -- Along the symmetric path $s = t/2$, both traders’ fundamentals equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. +- Along the symmetric path $s = t/2$, both traders’ fundamental valuations equal $0.5$ at every $t$, yet the price starts above $0.5$ and declines toward $0.5$ as learning reduces disagreement and the resale option loses value. ### General N–trader extension From e3d171fbac8918dd4e9203c054f3653c09566dda Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Wed, 22 Oct 2025 11:59:51 +1100 Subject: [PATCH 20/20] minor updates --- lectures/morris_learn.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lectures/morris_learn.md b/lectures/morris_learn.md index 641859289..b41d81da4 100644 --- a/lectures/morris_learn.md +++ b/lectures/morris_learn.md @@ -57,7 +57,7 @@ Key features of the environment in Morris's model include: Just as in the hard-wired beliefs model of Harrison and Kreps, those differences of opinion induce investors to engage in *speculative behavior* in the following sense: - * sometimes they are willing to pay more for the asset what they think is its ''fundamental'' value, i.e., the expected discounted value of its prospective dividend stream + * sometimes they are willing to pay more for the asset than what they think is its "fundamental" value, i.e., the expected discounted value of its prospective dividend stream Prior to reading this lecture, you might want to review the following quantecon lectures: @@ -474,6 +474,12 @@ The resulting premium reflects the option value of reselling to whichever trader Within this setting, we can reproduce two key figures reported in {cite:t}`Morris1996` ```{code-cell} ipython3 +--- +mystnb: + figure: + caption: Normalized price against interest rate + name: fig-normalized-price-interest +--- def normalized_price_two_agents(prior1, prior2, r, T=250): """Return p(s,t,r) = r \tilde p(s,t,r) for two traders.""" β = 1.0 / (1.0 + r) @@ -488,11 +494,10 @@ p00 = np.array([normalized_price_two_agents( for r in r_grid]) fig, ax = plt.subplots() -ax.plot(r_grid, p00) +ax.plot(r_grid, p00, lw=2) ax.set_xlabel(r'$r$') ax.set_ylabel(r'$p^*(0,0,r)$') ax.axhline(0.5, color='C1', linestyle='--') -ax.set_title('Figure I: normalized price vs interest rate') plt.show() ``` @@ -506,24 +511,29 @@ In the first figure, notice that: ```{code-cell} ipython3 +--- +mystnb: + figure: + caption: Normalized price against time + name: fig-normalized-price-time +--- # Figure II: p*(t/2,t,0.05) as a function of t r = 0.05 T = 60 p_mat = normalized_price_two_agents(priors[0], priors[1], r, T=T) -t_vals = np.arange(0, 54, 2) +t_vals = np.arange(0, 54, 2) s_vals = t_vals // 2 y = np.array([p_mat[s, t] for s, t in zip(s_vals, t_vals)]) fig, ax = plt.subplots() -ax.plot(t_vals, y) +ax.plot(t_vals, y, lw=2) ax.set_xlabel(r'$t$') ax.set_ylabel(r'$p^*(t/2,t,0.05)$') ax.axhline(0.5, color='C1', linestyle='--') -ax.set_title('Figure II: normalized price vs time (r=0.05)') plt.show() p0 = p_mat[0,0] -μ0 = 0.5 +μ0 = 0.5 print("Initial normalized premium at r=0.05 (%):", np.round(100 * (p0 / μ0 - 1.0), 2)) ```