From 2ed2a361b592c275257647bb5b0723f5fd5c435c Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Tue, 15 Sep 2026 14:40:41 -0400 Subject: [PATCH 1/3] [ge_arrow] Correct math, restructure, add exercises and concluding remarks - Fix Example 4 transition matrix, finite-horizon wealth claim, Inada condition, and law of iterated values derivation - Rewrite RecurCompetitive without globals; compute geometric sums by the backward recursion S_t = I + M S_{t+1} (law of iterated values) - Add asset_price method and price a Lucas tree in Example 2; show that natural debt limits are prices of claims to endowment streams - Demonstrate why finite-horizon economies need no borrowing limits - Add concluding remarks reviewing what the overview promised - Add three exercises with solutions and cross-links to related lectures Co-Authored-By: Claude Opus 5 --- lectures/ge_arrow.md | 1689 ++++++++++++++++++++---------------------- 1 file changed, 813 insertions(+), 876 deletions(-) diff --git a/lectures/ge_arrow.md b/lectures/ge_arrow.md index 3886d6ad8..290ea8aec 100644 --- a/lectures/ge_arrow.md +++ b/lectures/ge_arrow.md @@ -1,1387 +1,1324 @@ --- jupytext: - formats: ipynb,md:myst text_representation: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.1 + jupytext_version: 1.16.7 kernelspec: display_name: Python 3 (ipykernel) language: python name: python3 --- -# Competitive Equilibria with Arrow Securities - -## Introduction - -This lecture presents Python code for experimenting with competitive equilibria of an infinite-horizon pure exchange economy with - -* Heterogeneous agents - -* Endowments of a single consumption that are person-specific functions of a common Markov state +(ge_arrow)= +```{raw} jupyter + +``` -* Complete markets in one-period Arrow state-contingent securities +# Competitive Equilibria with Arrow Securities -* Discounted expected utility preferences of a kind often used in macroeconomics and finance +```{index} single: Arrow Securities; competitive equilibrium +``` -* Common expected utility preferences across agents +```{contents} Contents +:depth: 2 +``` -* Common beliefs among agents +## Overview -* A constant relative risk aversion (CRRA) one-period utility function that implies the existence of a representative consumer whose consumption process can be plugged into a formula for the pricing kernel for one-step Arrow securities and thereby determine equilibrium prices before determining an equilibrium distribution of wealth +This lecture presents Python code for experimenting with competitive equilibria of an infinite-horizon pure exchange economy with -* Differences in their endowments make individuals want to reallocate consumption goods across time and Markov states +* heterogeneous agents, +* endowments of a single consumption good that are person-specific functions of a common Markov state, +* complete markets in one-period Arrow state-contingent securities, +* discounted expected utility preferences of a kind often used in macroeconomics and finance, +* identical preferences across agents, with a common discount factor and a constant relative risk aversion (CRRA) one-period utility function, and +* common beliefs among agents. -We impose restrictions that allow us to **Bellmanize** competitive equilibrium prices and quantities +Differences in their endowments make individuals want to reallocate consumption goods across time and Markov states. -We use Bellman equations to describe +Identical CRRA preferences imply that equilibrium consumption shares are constant, so we can compute equilibrium prices from the aggregate endowment *before* we compute the equilibrium distribution of wealth. -* asset prices +We impose restrictions that allow us to **Bellmanize** competitive equilibrium prices and quantities. -* continuation wealth levels for each person +We use Bellman equations to describe -* state-by-state natural debt limits for each person +* asset prices, +* continuation wealth levels for each person, and +* state-by-state natural debt limits for each person. +In the course of presenting the model we shall encounter these important ideas: -In the course of presenting the model we shall encounter these important ideas +* a **resolvent operator** widely used in this class of models, +* the absence of **borrowing limits** in finite-horizon economies, +* state-by-state **borrowing limits** required in infinite-horizon economies, +* a counterpart of the **law of iterated expectations** known as a **law of iterated values**, and +* a **state variable degeneracy** that prevails within a competitive equilibrium and that opens the way to various appearances of resolvent operators. -* a **resolvent operator** widely used in this class of models +The lecture implements a Python version of the model presented in section 9.3.3 of {cite}`Ljungqvist2012`. -* absence of **borrowing limits** in finite horizon economies +Readers will find it helpful to know the finite-state Markov asset pricing formulas of {doc}`markov_asset` and the Markov chain concepts of {doc}`finite_markov`. -* state-by-state **borrowing limits** required in infinite horizon economies +Let's start with some imports. -* a counterpart of the **law of iterated expectations** known as a **law of iterated values** +```{code-cell} ipython3 +import numpy as np +import matplotlib.pyplot as plt -* a **state-variable degeneracy** that prevails within a competitive equilibrium and that opens the way to various appearances of resolvent operators +np.set_printoptions(suppress=True) +``` ## The setting -In effect, this lecture implements a Python version of the model presented in section 9.3.3 of Ljungqvist and Sargent {cite}`Ljungqvist2012`. - ### Preferences and endowments -In each period $t\geq 0$, a stochastic -event $s_t \in {\bf S}$ is realized. - -Let the history of events up until time $t$ -be denoted $s^t = [s_0, s_{1}, \ldots, s_{t-1}, s_t]$. - -(Sometimes we inadvertently reverse the recording order and denote a history as $s^t = [s_t, s_{t-1}, \ldots, s_1, s_0]$.) +In each period $t \geq 0$, a stochastic event $s_t \in \mathbf{S}$ is realized. -The unconditional -probability of observing a particular sequence of events $s^t$ is -given by a probability measure $\pi_t(s^t)$. +Let the history of events up until time $t$ be denoted $s^t = [s_0, s_1, \ldots, s_{t-1}, s_t]$. -For $t > \tau$, we write the probability -of observing $s^t$ conditional on the realization of $s^\tau$as $\pi_t(s^t\vert s^\tau)$. +The unconditional probability of observing a particular sequence of events $s^t$ is given by a probability measure $\pi_t(s^t)$. -We assume that trading occurs after -observing $s_0$, -which we capture by setting $\pi_0(s_0)=1$ for the initially -given value of $s_0$. +For $t > \tau$, we write the probability of observing $s^t$ conditional on the realization of $s^\tau$ as $\pi_t(s^t \mid s^\tau)$. -In this lecture we shall follow much macroeconomics and econometrics and assume that -$\pi_t(s^t)$ is induced by a Markov process. +We assume that trading occurs after observing $s_0$, which we capture by setting $\pi_0(s_0) = 1$ for the initially given value of $s_0$. +In this lecture we follow much of macroeconomics and econometrics and assume that $\pi_t(s^t)$ is induced by a Markov process. -There are $K$ consumers named $k=1, \ldots , K$. +There are $K$ consumers named $k = 1, \ldots, K$. -Consumer $k$ -owns a stochastic endowment of one good -$y_t^k(s^t)$ that depends on the -history $s^t$. +Consumer $k$ owns a stochastic endowment of one good $y_t^k(s^t)$ that depends on the history $s^t$. The history $s^t$ is publicly observable. +Consumer $k$ purchases a history-dependent consumption plan $c^k = \{c_t^k(s^t)\}_{t=0}^\infty$. -Consumer $k$ -purchases a history-dependent consumption plan $c^k = - \{c_t^k(s^t)\}_{t=0}^\infty$ +All consumers order consumption plans by -Consumer $k$ orders consumption plans by - -$$ U_k(c^k) = - \sum_{t=0}^\infty \sum_{s^t} \beta^t u_k[c_t^k(s^t)] - \pi_t(s^t), - $$ +$$ +U(c^k) = \sum_{t=0}^\infty \sum_{s^t} \beta^t u[c_t^k(s^t)] \pi_t(s^t), +$$ where $0 < \beta < 1$. -The right side is equal to $ E_0 \sum_{t=0}^\infty \beta^t -u_k(c_t^k) $, where $E_0$ is the mathematical expectation operator, -conditioned on $s_0$. +The right side equals $E_0 \sum_{t=0}^\infty \beta^t u(c_t^k)$, where $E_0$ is the mathematical expectation operator conditioned on $s_0$. -Here $u_k(c)$ is an increasing, twice -continuously differentiable, strictly concave function of -consumption $c\geq 0$ of one good. +Here $u(c)$ is an increasing, twice continuously differentiable, strictly concave function of consumption $c \geq 0$ of one good. -The utility function of person $k$ satisfies -the Inada condition +The utility function satisfies the Inada condition -$$ \lim_{c \downarrow 0} u'_k(c) = +\infty.$$ - -This condition implies that each -agent chooses strictly positive consumption for every -date-history pair $(t, s^t)$. +$$ +\lim_{c \downarrow 0} u'(c) = +\infty . +$$ -Those interior solutions enable us to confine our -analysis to Euler equations that hold with equality and also guarantee that -**natural debt limits** don't bind in economies like ours with -sequential trading of Arrow securities. +This condition implies that each agent chooses strictly positive consumption for every date-history pair $(t, s^t)$ whenever the present value of its endowment is positive. -We adopt the assumption, routinely -employed in much of macroeconomics, -that consumers share probabilities $\pi_t(s^t)$ for all $t$ and $s^t$. +Those interior solutions allow us to confine our analysis to Euler equations that hold with equality, and they guarantee that **natural debt limits** don't bind in economies like ours with sequential trading of Arrow securities. +We adopt the assumption, routinely employed in much of macroeconomics, that consumers share probabilities $\pi_t(s^t)$ for all $t$ and $s^t$. A **feasible allocation** satisfies $$ -\sum_i c_t^k(s^t) \leq \sum_i y_t^k(s^t) +\sum_{k=1}^K c_t^k(s^t) \leq \sum_{k=1}^K y_t^k(s^t) $$ for all $t$ and for all $s^t$. -## Recursive Formulation - -Following descriptions in section 9.3.3 of Ljungqvist and Sargent {cite}`Ljungqvist2012` chapter 9, we set up a competitive equilibrium of a pure exchange economy with complete markets in one-period Arrow securities. - - +Until we reach the section on computing an equilibrium, $u$ need only satisfy the properties listed above. -When endowments $y^k(s)$ are all functions of a common Markov state $s$, -the pricing kernel takes the form $Q(s'|s)$, where $Q(s'| s)$ is the price of one unit of consumption -in state $s'$ at date $t+1$ when the Markov state at date $t$ is $s$. +From then on we specialize to CRRA utility. -These enable us to provide a -recursive formulation of a consumer's optimization problem. +## Markov asset prices +Before setting up the equilibrium, we summarize formulas for computing asset prices in a Markov setting. -Consumer $k$'s state at time $t$ is its financial wealth $a^k_t$ and Markov state $s_t$. +These formulas are developed at greater length in {doc}`markov_asset`. -Let $v^k(a,s)$ be the optimal value of consumer $k$'s problem -starting from state $(a, s)$. +The setup assumes the following infrastructure: - * $v^k(a,s)$ is the maximum expected discounted utility that consumer $k$ with current financial wealth $a$ can attain in Markov state $s$. - -The optimal value function satisfies the Bellman equation +* Markov states $s \in \mathbf{S} = \{\bar{s}_1, \ldots, \bar{s}_n\}$ governed by an $n$-state Markov chain with transition probability $$ -v^k(a, s) = \max_{c, \hat a(s')} \left\{ u_k(c) + \beta \sum_{s'} v^k[\hat a(s'),s'] \pi (s' | s) \right\} +P_{ij} = \Pr \left\{s_{t+1} = \bar{s}_j \mid s_t = \bar{s}_i \right\} ; $$ -where maximization is subject to the budget constraint +* a collection $h = 1, \ldots, H$ of assets, where asset $h$ pays $d^h(s)$ in state $s$, so that $d^h$ is an $n \times 1$ vector; and +* an $n \times n$ pricing kernel $Q$ for one-period Arrow securities, where $Q_{ij}$ is the price at time $t$ in state $s_t = \bar s_i$ of one unit of consumption delivered at time $t+1$ if $s_{t+1} = \bar s_j$. -$$ -c + \sum_{s'} \hat a(s') Q(s' | s) - \leq y^k(s) + a - $$ +The price in state $\bar s_i$ of a one-period risk-free bond that pays one unit of consumption in every state is $\sum_j Q_{ij}$. -and also the constraints +The gross rate of return on that bond is therefore $$ -\begin{aligned} -c & \geq 0, \\ - - \hat a(s') & \leq \bar A^k(s'), \hskip.5cm \forall s' \in {\bf S} -\end{aligned} +R_i = \Bigl(\sum_j Q_{ij}\Bigr)^{-1} . $$ -with the second constraint evidently being a set of state-by-state debt limits. +### An exogenous pricing kernel -Note that the value function and decision rule that solve the Bellman equation implicitly depend -on the pricing kernel $Q(\cdot \vert \cdot)$ because it appears in the agent's budget constraint. +For now we take the pricing kernel $Q$ as exogenous, that is, determined outside the model. -Use the first-order conditions for the -problem on the right of the Bellman equation and a -Benveniste-Scheinkman formula and rearrange to get +Two examples are -$$ -Q(s_{t+1} | s_t ) = {\beta u'_k(c_{t+1}^k) \pi(s_{t+1} | s_t) - \over u'_k(c_t^k) }, - $$ +* $Q = \beta P$, where $\beta \in (0, 1)$, and +* $Q_{ij} = m_{ij} P_{ij}$, where $m_{ij} > 0$ is the value of a **stochastic discount factor** when the Markov state moves from $\bar s_i$ to $\bar s_j$. -where it is understood that $c_t^k = c^k(s_t)$ -and $c_{t+1}^k = c^k(s_{t+1})$. +The second example multiplies $P$ element by element, not as a matrix product. +We now describe the prices of two types of assets. +The first is a **cum-dividend** stock that entitles its owner to the time $t$ dividend and to the option to sell the asset at time $t+1$. -A **recursive competitive equilibrium** is -an initial distribution of wealth $\vec a_0$, a set of borrowing limits $\{\bar A^k(s)\}_{k=1}^K$, -a pricing kernel $Q(s' | s)$, sets of value functions $\{v^k(a,s)\}_{k=1}^K$, and -decision rules $\{c^k(s), \hat a^k(s)\}_{k=1}^K$ such -that +Its price satisfies $p^h(\bar s_i) = d^h(\bar s_i) + \sum_j Q_{ij} p^h(\bar s_j)$, so the vector $p^h$ satisfies $p^h = d^h + Q p^h$. -* The state-by-state borrowing constraints satisfy the recursion +Provided every eigenvalue of $Q$ has modulus less than one, this implies $$ -\bar A^k(s) = y^k(s) + \sum_{s'} Q(s'|s) \bar A^k(s') +p^h = (I - Q)^{-1} d^h . $$ -* For all $k$, given - $a^k_0$, $\bar A^k(s)$, and the pricing kernel, the value functions and decision rules -solve the consumers' problems; +The second is an **ex-dividend** stock purchased at the end of time $t$, which entitles its owner to the time $t+1$ dividend and to the option to sell the stock at time $t+1$. -* For all realizations of $\{s_t\}_{t=0}^\infty$, the consumption and asset -portfolios $\{\{c^k_t,$ -$\{\hat a^k_{t+1}(s')\}_{s'}\}_k\}_t$ satisfy $\sum_k c^k_t = \sum_k y^k(s_t)$ and -$\sum_k \hat a_{t+1}^k(s') = 0$ -for all $t$ and $s'$. +Its price is -* The initial financial wealth vector $\vec a_0$ satisfies $\sum_{k=1}^K a_0^k = 0 $. +$$ +p^h = (I - Q)^{-1} Q d^h . +$$ +```{note} +The matrix geometric sum $(I - Q)^{-1} = I + Q + Q^2 + \cdots$ is an example of a **resolvent operator**. -The third condition asserts that there are zero net aggregate claims in all Markov states. +It converges when the spectral radius of $Q$ is less than one. +``` -The fourth condition asserts that the economy is closed and starts from a situation in which there -are zero net aggregate claims. +Below we describe an equilibrium model with trading of one-period Arrow securities in which the pricing kernel is endogenous. +In constructing that model, we'll repeatedly encounter formulas that remind us of these asset pricing formulas. +### Multi-step transition probabilities and pricing kernels -## State Variable Degeneracy +The $(i,j)$ component of the $j$-step-ahead transition matrix $P^j$ is -Please see Ljungqvist and Sargent {cite}`Ljungqvist2012` for a description of -timing protocol for trades consistent with an Arrow-Debreu vision in which +$$ +\Pr(s_{t+j} = \bar s_{j'} \mid s_t = \bar s_i) = (P^j)_{i j'} . +$$ - * at time $0$ there are complete markets in a complete menu of history $s^t$-contingent claims on consumption at all dates that all trades occur at time zero - * all trades occur once and for all at time $0$ +To keep the notation light below, we write $P_j(s_{t+j} \mid s_t)$ for these $j$-step transition probabilities, so that $P_j$ is represented by the matrix $P^j$. +In the same way, the price at time $t$ in state $s_t$ of one unit of consumption delivered at time $t+j$ in state $s_{t+j}$ is $Q_j(s_{t+j} \mid s_t)$, represented by the matrix $Q^j$. -If an allocation and pricing kernel $Q$ in a recursive competitive equilibrium are to be -consistent -with the equilibrium allocation and price system that prevail in a corresponding complete markets economy with such history-contingent commodities and - all trades occurring at time $0$, -we must impose that $a_0^k = 0$ for $k = 1, \ldots , K$. +We'll use these objects to state a useful property of asset pricing theory. -That is -what assures that at time $0$ the present value of each agent's consumption equals the present value of his endowment stream, -the single budget constraint in arrangement with all trades occurring at time $0$. +### Laws of iterated expectations and iterated values +A **law of iterated values** has a mathematical structure that parallels a **law of iterated expectations**. +We can describe its structure readily in the Markov setting of this lecture. -Starting the system with $a_0^k =0$ for all $i$ has a striking implication that we call **state variable degeneracy**. +Recall the following recursion satisfied by $j$-step-ahead transition probabilities for our finite-state Markov chain: +$$ +P_j(s_{t+j} \mid s_t) = \sum_{s_{t+1}} P_{j-1}(s_{t+j} \mid s_{t+1}) P(s_{t+1} \mid s_t) . +$$ -Here is what we mean by **state variable degeneracy**: +We can use this recursion to verify the law of iterated expectations applied to the conditional expectation of a random variable $d(s_{t+j})$ conditioned on $s_t$: -Although two state variables $a,s$ appear in the value function $v^k(a,s)$, within a recursive competitive equilibrium starting from $a_0^k = 0 \ \forall i$ at initial Markov state $s_0$, two outcomes prevail: +$$ +\begin{aligned} +E \bigl[ E [ d(s_{t+j}) \mid s_{t+1} ] \bigm| s_t \bigr] + & = \sum_{s_{t+1}} \left[ \sum_{s_{t+j}} d(s_{t+j}) P_{j-1}(s_{t+j} \mid s_{t+1}) \right] P(s_{t+1} \mid s_t) \\ + & = \sum_{s_{t+j}} d(s_{t+j}) \left[ \sum_{s_{t+1}} P_{j-1}(s_{t+j} \mid s_{t+1}) P(s_{t+1} \mid s_t) \right] \\ + & = \sum_{s_{t+j}} d(s_{t+j}) P_j(s_{t+j} \mid s_t) \\ + & = E [ d(s_{t+j}) \mid s_t ] . +\end{aligned} +$$ +The pricing kernel for $j$-step-ahead Arrow securities satisfies the recursion -* $a_0^k = 0 $ for all $i$ whenever the Markov state $s_t$ returns to $s_0$. +$$ +Q_j(s_{t+j} \mid s_t) = \sum_{s_{t+1}} Q_{j-1}(s_{t+j} \mid s_{t+1}) Q(s_{t+1} \mid s_t) . +$$ -* Financial wealth $a$ is an exact function of the Markov state $s$. +The time $t$ **value** in Markov state $s_t$ of a time $t+j$ payout $d(s_{t+j})$ is -The first finding asserts that each household recurrently visits the zero financial wealth state with which it began life. +$$ +W [ d(s_{t+j}) \mid s_t ] = \sum_{s_{t+j}} d(s_{t+j}) Q_j(s_{t+j} \mid s_t) . +$$ +The **law of iterated values** states that -The second finding asserts that within a competitive equilibrium the exogenous Markov state is all we require to track an individual. +$$ +W \bigl[ W [ d(s_{t+j}) \mid s_{t+1} ] \bigm| s_t \bigr] = W [ d(s_{t+j}) \mid s_t ] . +$$ -Financial wealth turns out to be redundant because it is an exact function of the Markov state for each individual. +We verify it with a string of equalities that are counterparts to those we used to verify the law of iterated expectations: +$$ +\begin{aligned} +W \bigl[ W [ d(s_{t+j}) \mid s_{t+1} ] \bigm| s_t \bigr] + & = \sum_{s_{t+1}} \left[ \sum_{s_{t+j}} d(s_{t+j}) Q_{j-1}(s_{t+j} \mid s_{t+1}) \right] Q(s_{t+1} \mid s_t) \\ + & = \sum_{s_{t+j}} d(s_{t+j}) \left[ \sum_{s_{t+1}} Q_{j-1}(s_{t+j} \mid s_{t+1}) Q(s_{t+1} \mid s_t) \right] \\ + & = \sum_{s_{t+j}} d(s_{t+j}) Q_j(s_{t+j} \mid s_t) \\ + & = W [ d(s_{t+j}) \mid s_t ] . +\end{aligned} +$$ -This outcome depends critically on there being complete markets in Arrow securities. +## Recursive formulation -For example, it does not prevail in the incomplete markets setting of this lecture {doc}`The Aiyagari Model ` +Following section 9.3.3 of {cite}`Ljungqvist2012`, we now set up a competitive equilibrium of a pure exchange economy with complete markets in one-period Arrow securities. -## Markov Asset Prices +When endowments $y^k(s)$ are all functions of a common Markov state $s$, the pricing kernel takes the form $Q(s' \mid s)$, the price of one unit of consumption in state $s'$ at date $t+1$ when the Markov state at date $t$ is $s$. +This lets us formulate a consumer's optimization problem recursively. -Let's start with a brief summary of formulas for computing asset prices in -a Markov setting. +Consumer $k$'s state at time $t$ is its financial wealth $a_t^k$ and the Markov state $s_t$. +Let $v^k(a, s)$ be the optimal value of consumer $k$'s problem starting from state $(a, s)$. -The setup assumes the following infrastructure +Thus $v^k(a, s)$ is the maximum expected discounted utility that consumer $k$ with current financial wealth $a$ can attain in Markov state $s$. -* Markov states: $s \in S = \left[\bar{s}_1, \ldots, \bar{s}_n \right]$ governed by an $n$-state Markov chain with transition probability +The optimal value function satisfies the Bellman equation $$ -P_{ij} = \Pr \left\{s_{t+1} = \bar{s}_j \mid s_t = \bar{s}_i \right\} +v^k(a, s) = \max_{c, \hat a(s')} \left\{ u(c) + \beta \sum_{s'} v^k[\hat a(s'), s'] \pi(s' \mid s) \right\}, $$ -* A collection $h=1,\ldots, H$ of $n \times 1$ vectors of $H$ assets that pay off $d^h\left(s\right)$ in state $s$ - - - -* An $n \times n$ matrix pricing kernel $Q$ for one-period Arrow securities, where $ Q_{ij}$ = price at time $t$ in state $s_t = -\bar s_i$ of one unit of consumption when $s_{t+1} = \bar s_j$ at time $t+1$: - +where the maximization is subject to the budget constraint $$ -Q_{ij} = {\textrm{Price}} \left\{s_{t+1} = \bar{s}_j \mid s_t = \bar{s}_i \right\} +c + \sum_{s'} \hat a(s') Q(s' \mid s) \leq y^k(s) + a $$ -* The price of risk-free one-period bond in state $i$ is $R_i^{-1} = \sum_{j}Q_{i,j}$ - -* The gross rate of return on a one-period risk-free bond Markov state $\bar s_i$ is $R_i = (\sum_j Q_{i,j})^{-1}$ - -### Exogenous Pricing Kernel - -At this point, we'll take the pricing kernel $Q$ as exogenous, i.e., determined outside the model - -Two examples would be - -* $ Q = \beta P $ where $\beta \in (0,1) $ +and the constraints -* $Q = S P $ where $S$ is an $n \times n$ matrix of *stochastic discount factors* +$$ +\begin{aligned} +c & \geq 0, \\ +-\hat a(s') & \leq \bar A^k(s'), \quad \forall s' \in \mathbf{S} . +\end{aligned} +$$ +The second set of constraints is a collection of state-by-state debt limits. -We'll write down implications of Markov asset pricing in a nutshell for two types of assets +The value function and decision rule that solve the Bellman equation depend on the pricing kernel $Q(\cdot \mid \cdot)$ because it appears in the budget constraint. - * the price in Markov state $s$ at time $t$ of a **cum dividend** stock that entitles the owner at the beginning of time $t$ to the time $t$ dividend and the option to sell the asset at time $t+1$. The price evidently satisfies $p^h(\bar s_i) = d^h(\bar s_i) + \sum_j Q_{ij} p^h(\bar s_j) $, which implies that the vector $p^h$ satisfies $p^h = d^h + Q p^h$ which implies the formula +The first-order conditions for the problem on the right of the Bellman equation, together with a Benveniste–Scheinkman formula, imply $$ -p^h = (I - Q)^{-1} d^h +Q(s_{t+1} \mid s_t) = \frac{\beta u'(c_{t+1}^k) \pi(s_{t+1} \mid s_t)}{u'(c_t^k)}, $$ +where it is understood that $c_t^k = c^k(s_t)$ and $c_{t+1}^k = c^k(s_{t+1})$. +### Recursive competitive equilibrium +A **recursive competitive equilibrium** is an initial distribution of wealth $\vec a_0$, a set of borrowing limits $\{\bar A^k(s)\}_{k=1}^K$, a pricing kernel $Q(s' \mid s)$, sets of value functions $\{v^k(a, s)\}_{k=1}^K$, and decision rules $\{c^k(s), \hat a^k(s)\}_{k=1}^K$ such that -* the price in Markov state $s$ at time $t$ of an **ex dividend** stock that entitles the owner at the end of time $t$ to the time $t+1$ dividend and the option to sell the stock at time $t+1$. The price is +1. the state-by-state borrowing limits satisfy the recursion $$ -p^h = (I - Q)^{-1} Q d^h +\bar A^k(s) = y^k(s) + \sum_{s'} Q(s' \mid s) \bar A^k(s') ; $$ -```{note} -The matrix geometric sum $(I - Q)^{-1} = I + Q + Q^2 + \cdots $ -is an example of a **resolvent operator**. -``` +2. for all $k$, given $a_0^k$, $\bar A^k(s)$, and the pricing kernel, the value functions and decision rules solve the consumers' problems; -Below, we describe an equilibrium model with trading of one-period Arrow securities in which the pricing kernel is endogenous. +3. for all realizations of $\{s_t\}_{t=0}^\infty$, the consumption and asset portfolios $\{\{c_t^k, \{\hat a_{t+1}^k(s')\}_{s'}\}_k\}_t$ satisfy $\sum_k c_t^k = \sum_k y^k(s_t)$ and $\sum_k \hat a_{t+1}^k(s') = 0$ for all $t$ and $s'$; and -In constructing our model, we'll repeatedly encounter formulas that remind us of our asset pricing formulas. +4. the initial financial wealth vector $\vec a_0$ satisfies $\sum_{k=1}^K a_0^k = 0$. -### Multi-Step-Forward Transition Probabilities and Pricing Kernels +The third condition asserts that goods markets clear and that there are zero net aggregate claims in all Markov states. -The $(i,j)$ component of the $\ell$-step ahead transition probability $P^\ell$ is +The fourth condition asserts that the economy is closed and starts from a situation in which there are zero net aggregate claims. -$$ -Prob(s_{t+\ell} = \bar s_j | s_t = \bar s_i) = P^{\ell}_{i,j} -$$ +## State variable degeneracy -The $(i,j)$ component of the $\ell$-step ahead pricing kernel $Q^\ell$ is +{cite}`Ljungqvist2012` and {doc}`cass_koopmans_2` describe a different timing protocol, in which there is a complete menu of history-contingent claims on consumption at all dates and all trades occur once and for all at time $0$. +For the allocation and pricing kernel of a recursive competitive equilibrium to coincide with those of that time $0$ arrangement, we must impose $a_0^k = 0$ for $k = 1, \ldots, K$. -$$ -Q^{(\ell)}(s_{t+\ell} = \bar s_j | s_t = \bar s_i) = Q^{\ell}_{i,j} -$$ +That initial condition ensures that at time $0$ the present value of each consumer's consumption equals the present value of its endowment stream, which is the single budget constraint of the time $0$ arrangement. +Starting the system with $a_0^k = 0$ for all $k$ has a striking implication that we call **state variable degeneracy**. -We'll use these objects to state a useful property in asset pricing theory. +Although two state variables $a$ and $s$ appear in the value function $v^k(a, s)$, within a recursive competitive equilibrium that starts from $a_0^k = 0$ for all $k$ at initial Markov state $s_0$, two outcomes prevail: -### Laws of Iterated Expectations and Iterated Values +* financial wealth $a_t^k$ is an exact function of the Markov state $s_t$, which we compute below, and +* $a_t^k = 0$ for all $k$ whenever the Markov state $s_t$ returns to $s_0$. -A **law of iterated values** has a mathematical structure that parallels a -**law of iterated expectations** +The first finding asserts that within a competitive equilibrium the exogenous Markov state is all we require to track an individual, because financial wealth is redundant. -We can describe its structure readily in the Markov setting of this lecture +The second finding asserts that each household returns to the zero financial wealth with which it began life whenever the Markov state returns to its initial value. -Recall the following recursion satisfied by $j$ step ahead transition probabilites -for our finite state Markov chain: +That happens infinitely often if $s_0$ is a recurrent state of the Markov chain, but it need not happen at all if $s_0$ is transient; see {doc}`finite_markov`. -$$ -P_j(s_{t+j}| s_t) = \sum_{s_{t+1}} P_{j-1}(s_{t+j}| s_{t+1}) P(s_{t+1} | s_t) -$$ +This outcome depends critically on there being complete markets in Arrow securities. -We can use this recursion to verify the law of iterated expectations applied -to computing the conditional expectation of a random variable $d(s_{t+j})$ conditioned -on $s_t$ via the following string of equalities +For example, it does not prevail in the incomplete markets setting of {doc}`aiyagari`, where a household's wealth depends on its whole history of shocks. -$$ -\begin{aligned} -E \left[ E d(s_{t+j}) | s_{t+1} \right] | s_t - & = \sum_{s_{t+1}} \left[ \sum_{s_{t+j}} d(s_{t+j}) P_{j-1}(s_{t+j}| s_{t+1} ) \right] P(s_{t+1} | s_t) \\ - & = \sum_{s_{t+j}} d(s_{t+j}) \left[ \sum_{s_{t+1}} P_{j-1} ( s_{t+j} |s_{t+1}) P(s_{t+1}| s_t) \right] \\ - & = \sum_{s_{t+j}} d(s_{t+j}) P_j (s_{t+j} | s_t ) \\ - & = E d(s_{t+j})| s_t - \end{aligned} -$$ - -The pricing kernel for $j$ step ahead Arrow securities satisfies the recursion - -$$ -Q_j(s_{t+j}| s_t) = \sum_{s_{t+1}} Q_{j-1}(s_{t+j}| s_{t+1}) Q(s_{t+1} | s_t) -$$ +## Computing a competitive equilibrium +Now we are ready to do some fun calculations. -The time $t$ **value** in Markov state $s_t$ of a time $t+j$ payout $d(s_{t+j})$ -is +We find it useful to think in terms of analytical **inputs** into and **outputs** from our general equilibrium theorizing. +### Inputs and outputs -$$ -V(d(s_{t+j})|s_t) = \sum_{s_{t+j}} d(s_{t+j}) Q_j(s_{t+j}| s_t) -$$ +The inputs are -The **law of iterated values** states +* Markov states $s \in \mathbf{S} = \{\bar{s}_1, \ldots, \bar{s}_n\}$ governed by an $n$-state Markov chain with transition matrix $P$; +* $K$ vectors of individual endowments $y^k$, each of dimension $n \times 1$ with components $y^k(\bar s_i)$; +* the $n \times 1$ vector of aggregate endowments $y(s) \equiv \sum_{k=1}^K y^k(s)$; and +* preferences given by the common utility functional $E_0 \sum_{t=0}^\infty \beta^t u(c_t^k)$ with discount factor $\beta \in (0, 1)$ and CRRA one-period utility function $$ -V \left[ V (d(s_{t+j}) | s_{t+1}) \right] | s_t = V(d(s_{t+j}))| s_t +u(c) = \frac{c^{1-\gamma}}{1-\gamma}, +\qquad +u'(c) = c^{-\gamma} . $$ -We verify it by pursuing the following a string of inequalities that are counterparts to those we used -to verify the law of iterated expectations: +Feasibility requires $$ -\begin{aligned} -V \left[ V ( d(s_{t+j}) | s_{t+1} ) \right] | s_t - & = \sum_{s_{t+1}} \left[ \sum_{s_{t+j}} d(s_{t+j}) Q_{j-1}(s_{t+j}| s_{t+1} ) \right] Q(s_{t+1} | s_t) \\ - & = \sum_{s_{t+j}} d(s_{t+j}) \left[ \sum_{s_{t+1}} Q_{j-1} ( s_{t+j} |s_{t+1}) Q(s_{t+1}| s_t) \right] \\ - & = \sum_{s_{t+j}} d(s_{t+j}) Q_j (s_{t+j} | s_t ) \\ - & = E V(d(s_{t+j}))| s_t - \end{aligned} +c(s) = \sum_{k=1}^K c^k(s) \leq y(s) . $$ -## General Equilibrium +The outputs are -Now we are ready to do some fun calculations. +* an $n \times n$ pricing kernel $Q$ for one-period Arrow securities; +* the aggregate allocation, which in a pure exchange economy is $c(s) = y(s)$; +* a $K \times 1$ distribution of wealth $\alpha$ with $\alpha_k \geq 0$ and $\sum_{k=1}^K \alpha_k = 1$; and +* $K$ vectors of individual consumptions $c^k$, each of dimension $n \times 1$. -We find it interesting to think in terms of analytical **inputs** into and **outputs** from our general equilibrium theorizing. +### The pricing kernel -### Inputs - -* Markov states: $s \in S = \left[\bar{s}_1, \ldots, \bar{s}_n \right]$ governed by an $n$-state Markov chain with transition probability +For any agent $k \in \{1, \ldots, K\}$, at the equilibrium allocation, the one-period Arrow securities pricing kernel satisfies $$ -P_{ij} = \Pr \left\{s_{t+1} = \bar{s}_j \mid s_t = \bar{s}_i \right\} +Q_{ij} = \beta \left(\frac{c^k(\bar{s}_j)}{c^k(\bar{s}_i)}\right)^{-\gamma} P_{ij} . $$ -* A collection of $K \times 1$ vectors of individual $k$ endowments: $y^k\left(s\right), k=1,\ldots, K$ - -* An $n \times 1$ vector of aggregate endowment: $y\left(s\right) \equiv \sum_{k=1}^K y^k\left(s\right)$ - -* A collection of $K \times 1$ vectors of individual $k$ consumptions: $c^k\left(s\right), k=1,\ldots, K$ +This follows from agent $k$'s first-order necessary conditions. -* A collection of restrictions on feasible consumption allocations for $s \in S$: +Because all agents face the same pricing kernel, the Euler equations of any two agents $k$ and $m$ imply $$ -c\left(s\right)= \sum_{k=1}^K c^k\left(s\right) -\leq y\left(s\right) +\left(\frac{c^k(\bar{s}_j)}{c^k(\bar{s}_i)}\right)^{-\gamma} += +\left(\frac{c^m(\bar{s}_j)}{c^m(\bar{s}_i)}\right)^{-\gamma} +\quad \text{whenever } P_{ij} > 0 . $$ -* Preferences: a common utility functional across agents $ E_0 \sum_{t=0}^\infty \beta^t u(c^k_t) $ with CRRA one-period utility function $u\left(c\right)$ and discount factor $\beta \in (0,1)$ +So the ratio $c^k(s)/c^m(s)$ is the same in any two states connected by a positive transition probability, and hence in every state reachable from $s_0$. -The one-period utility function is +Consumption shares are therefore constant, and feasibility gives $$ -u \left(c\right) = \frac{c^{1-\gamma}}{1-\gamma} +c^k(s) = \alpha_k c(s) = \alpha_k y(s) $$ -so that - -$$ -u^\prime \left(c\right) = c^{-\gamma} -$$ +for a **distribution of wealth** $\alpha$ that satisfies $\alpha_k \geq 0$ and $\sum_{k=1}^K \alpha_k = 1$. -### Outputs +```{note} +Identical CRRA preferences also satisfy the conditions for **Gorman aggregation**, since Engel curves are linear with a common slope, so a representative consumer exists. -* An $n \times n$ matrix pricing kernel $Q$ for one-period Arrow securities, where $ Q_{ij}$ = price at time $t$ in state $s_t = \bar s_i$ of one unit of consumption when $s_{t+1} = \bar s_j$ at time $t+1$ +The constancy of consumption shares, however, follows directly from the Euler equations above. +``` -* pure exchange so that $c\left(s\right) = y\left(s\right)$ +This means that we can compute the pricing kernel from -* a $K \times 1$ vector distribution of wealth vector $\alpha$, $\alpha_k \geq 0, \sum_{k=1}^K \alpha_k =1$ +$$ +Q_{ij} = \beta \left(\frac{y_j}{y_i}\right)^{-\gamma} P_{ij} . +$$ (eq:Qformula) -* A collection of $n \times 1$ vectors of individual $k$ consumptions: $c^k\left(s\right), k=1,\ldots, K$ +This is the pricing kernel of the Lucas tree economy studied in {doc}`markov_asset`, in which a representative consumer eats the aggregate endowment. -### $Q$ is the Pricing Kernel +The pricing kernel $Q$ does not depend on the vector $\alpha$. +**Key finding:** We can compute competitive equilibrium **prices** prior to computing a **distribution of wealth**. -For any agent $k \in \left[1, \ldots, K\right]$, at the equilibrium allocation, -the one-period Arrow securities pricing kernel satisfies +The wealth distribution $\alpha$ is not arbitrary. -$$ -Q_{ij} = \beta \left(\frac{c^k\left(\bar{s}_j\right)}{c^k\left(\bar{s}_i\right)}\right)^{-\gamma} P_{ij} -$$ +It is pinned down by the initial condition $a_0^k = 0$, as we show below. -where $Q$ is an $n \times n$ matrix +Formula {eq}`eq:Qformula` has a useful matrix form. +Let $D = \mathrm{diag}\bigl(u'(y_1), \ldots, u'(y_n)\bigr)$. -This follows from agent $k$'s first-order necessary conditions. +Then $Q = \beta D^{-1} P D$, so $Q$ is similar to $\beta P$. -But with the CRRA preferences that we have assumed, individual consumptions vary proportionately -with aggregate consumption and therefore with the aggregate endowment. +Its eigenvalues are $\beta$ times those of $P$, and because $P$ is a stochastic matrix, the spectral radius of $Q$ equals $\beta < 1$. - * This is a consequence of our preference specification implying that **Engle curves** are affine in wealth and therefore satisfy conditions for **Gorman aggregation** +This guarantees that the resolvent $(I - Q)^{-1}$ used below exists. -Thus, +The factorization is an instance of the **transition independence** structure exploited in {doc}`ross_recovery`, a connection we pursue in {ref}`ge_arrow_ex2`. -$$ -c^k \left(s\right) = \alpha_k c\left(s\right) = \alpha_k y\left(s\right) -$$ +### Natural debt limits -for an arbitrary **distribution of wealth** in the form of an $K \times 1$ vector $\alpha$ -that satisfies +Having computed an equilibrium pricing kernel $Q$, we can compute several **values** that are required to pose or represent the solution of an individual household's optimization problem. -$$ \alpha_k \in \left(0, 1\right), \quad \sum_{k=1}^K \alpha_k = 1 $$ +For each individual $k$, let $\bar A^k$ be the $n \times 1$ vector with components $\bar A^k(\bar s_i)$. -This means that we can compute the pricing kernel from +The recursion in the definition of equilibrium implies $$ -Q_{ij} = \beta \left(\frac{y_j}{y_i}\right)^{-\gamma} P_{ij} -$$ (eq:Qformula) - +\bar A^k = \left[I - Q\right]^{-1} y^k . +$$ (eq:debtlimit) -Note that $Q_{ij}$ is independent of vector $\alpha$. +In a competitive equilibrium of an **infinite-horizon** economy with sequential trading of one-period Arrow securities, $\bar A^k(s)$ is a state-by-state limit on the quantity of one-period Arrow securities paying off in state $s$ at time $t+1$ that individual $k$ can issue at time $t$. +These are often called **natural debt limits**. +They equal the maximum amount that individual $k$ can repay in state $s$ even if it consumes nothing forevermore. -**Key finding:** We can compute competitive equilibrium **prices** prior to computing a **distribution of wealth**. +```{note} +If utility satisfies an Inada condition at zero consumption, or if consumption is simply required to be nonnegative, then a **finite-horizon** economy with sequential trading of one-period Arrow securities needs no natural debt limits. -### Values +See the section on a finite-horizon economy below. +``` +### Continuation wealth and optimal portfolios -Having computed an equilibrium pricing kernel $Q$, we can compute several **values** that are required -to pose or represent the solution of an individual household's optimum problem. +Continuation wealth plays an important role in Bellmanizing a competitive equilibrium with sequential trading of a complete set of one-period Arrow securities. +For each individual $k$, let $\psi^k$ be the $n \times 1$ vector with components $\psi^k(\bar s_i)$, the financial wealth that consumer $k$ holds when the Markov state is $\bar s_i$. -We denote an $K \times 1$ vector of state-dependent values of agents' endowments in Markov state $s$ as +Continuation wealth satisfies $$ -A\left(s\right)=\left[\begin{array}{c} -A^{1}\left(s\right)\\ - \vdots\\ -A^{K}\left(s\right) -\end{array}\right], \quad s \in \left[\bar{s}_1, \ldots, \bar{s}_n\right] -$$ +\psi^k = \left[I - Q\right]^{-1} \left[\alpha_k y - y^k\right] . +$$ (eq:continwealth) -and an $n \times 1$ vector of continuation endowment values for each individual $k$ as +To see why, note that with consumption $c^k = \alpha_k y$ and a portfolio $\hat a^k(s') = \psi^k(s')$, the budget constraint holds with equality in every state exactly when $\psi^k = \alpha_k y - y^k + Q \psi^k$. -$$ -A^{k}=\left[\begin{array}{c} -A^{k}\left(\bar{s}_{1}\right)\\ -\vdots\\ -A^{k}\left(\bar{s}_{n}\right) -\end{array}\right], \quad k \in \left[1, \ldots, K\right] -$$ +Summing over $k$ shows that $\sum_{k=1}^K \psi^k = 0_{n \times 1}$, so Arrow security markets clear. -$A^k$ of consumer $k$ satisfies +A nifty feature of the model is that an optimal portfolio of a type $k$ agent equals the continuation wealth that we just computed. + +Thus, agent $k$'s purchases of Arrow securities that pay off next period depend only on next period's Markov state and equal $$ -A^k = \left[I - Q\right]^{-1} \left[ y^k\right] -$$ +\hat a^k(s) = \psi^k(s), \quad s \in \{\bar s_1, \ldots, \bar s_n\} . +$$ (eqn:optport) -where +### The equilibrium wealth distribution + +With the initial state being a particular state $s_0 \in \{\bar{s}_1, \ldots, \bar{s}_n\}$, we must have $$ -y^{k}=\left[\begin{array}{c} -y^{k}\left(\bar{s}_{1}\right)\\ -\vdots\\ -y^{k}\left(\bar{s}_{n}\right) -\end{array}\right] \equiv \begin{bmatrix} y^k_1 \cr \vdots \cr y^k_n \end{bmatrix} +\psi^k(s_0) = 0, \quad k = 1, \ldots, K, $$ +so that every agent starts debt-free and holding no financial assets. -In a competitive equilibrium of an **infinite horizon** economy with sequential trading of one-period Arrow securities, $A^k(s)$ serves as a state-by-state vector of **debt limits** on the quantities of one-period Arrow securities -paying off in state $s$ at time $t+1$ that individual $k$ can issue at time $t$. - +This means that the equilibrium distribution of wealth satisfies -These are often called **natural debt limits**. +$$ +\alpha_k = \frac{V_z y^k}{V_z y}, +$$ (eqn:alphakform) -Evidently, they equal the maximum amount that it is feasible for individual $k$ to repay -even if he consumes zero goods forevermore. +where $V \equiv \left[I - Q\right]^{-1}$ and $V_z$ is the row of $V$ corresponding to the initial state $s_0$. -**Remark:** If we have an Inada condition at zero consumption or just impose that consumption -be nonnegative, then in a **finite horizon** economy with sequential trading of one-period Arrow securities there is no need to impose natural debt limits. See the section on a Finite Horizon Economy below. +Since $\sum_{k=1}^K V_z y^k = V_z y$, we have $\sum_{k=1}^K \alpha_k = 1$. +Comparing {eq}`eqn:alphakform` with {eq}`eq:debtlimit` gives a revealing interpretation, +$$ +\alpha_k = \frac{\bar A^k(s_0)}{\sum_{m=1}^K \bar A^m(s_0)} . +$$ -### Continuation Wealth +Each consumer's share of aggregate consumption equals its share of the value, in the initial state, of the aggregate endowment. -Continuation wealth plays an important role in Bellmanizing a competitive equilibrium with sequential -trading of a complete set of one-period Arrow securities. +Because $\alpha$ depends on $s_0$ through $V_z$, the same economy started in different Markov states delivers different wealth distributions. +### Value functions -We denote an $K \times 1$ vector of state-dependent continuation wealths in Markov state $s$ as +We can also compute optimal value functions in a competitive equilibrium with trades in a complete set of one-period state-contingent Arrow securities. -$$ -\psi\left(s\right)=\left[\begin{array}{c} -\psi^{1}\left(s\right)\\ -\vdots\\ -\psi^{K}\left(s\right) -\end{array}\right], \quad s \in \left[\bar{s}_1, \ldots, \bar{s}_n\right] -$$ +Call the optimal value function of consumer $k$ the $n \times 1$ vector $J^k$. -and an $n \times 1$ vector of continuation wealths for each individual $k$ as +For the infinite-horizon economy now under study, $$ -\psi^{k}=\left[\begin{array}{c} -\psi^{k}\left(\bar{s}_{1}\right)\\ -\vdots\\ -\psi^{k}\left(\bar{s}_{n}\right) -\end{array}\right], \quad k \in \left[1, \ldots, K\right] +J^k = (I - \beta P)^{-1} u(\alpha_k y), $$ -Continuation wealth $\psi^k$ of consumer $k$ satisfies +where $u(\alpha_k y)$ is the $n \times 1$ vector with components $u(\alpha_k y_i)$. -$$ -\psi^k = \left[I - Q\right]^{-1} \left[\alpha_k y - y^k\right] -$$ (eq:continwealth) +### Summary of the algorithm -where +Here is the logical flow of an algorithm to compute a competitive equilibrium: -$$ -y^{k}=\left[\begin{array}{c} -y^{k}\left(\bar{s}_{1}\right)\\ -\vdots\\ -y^{k}\left(\bar{s}_{n}\right) -\end{array}\right],\quad y=\left[\begin{array}{c} -y\left(\bar{s}_{1}\right)\\ -\vdots\\ -y\left(\bar{s}_{n}\right) -\end{array}\right] -$$ +1. compute $Q$ from the aggregate endowment using formula {eq}`eq:Qformula`; +2. compute the distribution of wealth $\alpha$ from formula {eq}`eqn:alphakform`; +3. using $\alpha$, assign each consumer $k$ the share $\alpha_k$ of the aggregate endowment in each state; +4. compute continuation wealths from the $\alpha$-dependent formula {eq}`eq:continwealth`; +5. set agent $k$'s portfolio equal to its continuation wealth state by state, as in {eq}`eqn:optport`; and +6. compute value functions $J^k$. -Note that $\sum_{k=1}^K \psi^k = {0}_{n \times 1}$. +## Finite horizon -**Remark:** At the initial state $s_0 \in \begin{bmatrix} \bar s_1, \ldots, \bar s_n \end{bmatrix}$, -the continuation wealth $\psi^k(s_0) = 0$ for all agents $k = 1, \ldots, K$. This indicates that -the economy begins with all agents being debt-free and financial-asset-free at time $0$, state $s_0$. +We now describe a finite-horizon version of the economy that operates for $T+1$ periods $t \in \mathbf{T} = \{0, 1, \ldots, T\}$. +We'll want time-dependent counterparts of the objects described above, with one important exception: we won't need **borrowing limits**. -**Remark:** Note that all agents' continuation wealths recurrently return to zero when the Markov state returns to whatever value $s_0$ it had at time $0$. +* Borrowing limits aren't required in a finite-horizon economy in which the one-period utility function $u(c)$ satisfies an Inada condition that sends the marginal utility of consumption to infinity as consumption approaches zero. +* Nonnegativity of consumption at all $t \in \mathbf{T}$ automatically limits borrowing, because no one can end period $T$ in debt. -### Optimal Portfolios +For each individual $k$ and date $t$, let $\psi_t^k$ be the $n \times 1$ vector of continuation wealths. -A nifty feature of the model is that an optimal portfolio of a type $k$ agent equals the continuation wealth that we just computed. +At the terminal date there is no future to finance, so $\psi_T^k = \alpha_k y - y^k$. -Thus, agent $k$'s state-by-state purchases of Arrow securities next period depend only on next period's -Markov state and equal +Working backward with the budget constraint $\psi_t^k = \alpha_k y - y^k + Q \psi_{t+1}^k$ gives $$ -a_k(s) = \psi^k(s), \quad s \in \left[\bar s_1, \ldots, \bar s_n \right] -$$ (eqn:optport) - -### Equilibrium Wealth Distribution $\alpha$ +\psi_t^k = \left[I + Q + Q^2 + \cdots + Q^{T-t}\right] \left[\alpha_k y - y^k\right], +\quad t = 0, 1, \ldots, T . +$$ (eq:vv) +As before, $\sum_{k=1}^K \psi_t^k = 0_{n \times 1}$ for all $t \in \mathbf{T}$. -With the initial state being a particular state $s_0 \in \left[\bar{s}_1, \ldots, \bar{s}_n\right]$, -we must have +With the initial state being a particular state $s_0$, we must have $$ -\psi^k\left(s_0\right) = 0, \quad k=1, \ldots, K +\psi_0^k(s_0) = 0, \quad k = 1, \ldots, K, $$ which means the equilibrium distribution of wealth satisfies $$ -\alpha_k = \frac{V_z y^k}{V_z y} -$$ (eqn:alphakform) - +\alpha_k = \frac{V_z y^k}{V_z y}, +$$ (eq:w) +where now -where $V \equiv \left[I - Q\right]^{-1}$ and $z$ is the row index corresponding to the initial state $s_0$. +$$ +V = \left[I + Q + Q^2 + \cdots + Q^T\right] +$$ (eq:ww) -Since $\sum_{k=1}^K V_z y^k = V_z y$, $\sum_{k=1}^K \alpha_k = 1$. +and $V_z$ is the row of $V$ corresponding to the initial state $s_0$. +```{note} +In the finite-horizon economy, continuation wealth depends on calendar time as well as on the Markov state. -In summary, here is the logical flow of an algorithm to compute a competitive equilibrium: +The initial condition sets $\psi_0^k(s_0) = 0$, but when the Markov state returns to $s_0$ at a later date $t$, fewer periods remain, the geometric sum in {eq}`eq:vv` is truncated sooner, and in general $\psi_t^k(s_0) \neq 0$. -* compute $Q$ from the aggregate allocation and formula {eq}`eq:Qformula` +The strong form of state variable degeneracy, in which wealth is a function of the Markov state alone, is special to the infinite horizon. -* compute the distribution of wealth $\alpha$ from the formula {eq}`eqn:alphakform` +{ref}`ge_arrow_ex3` explores this. +``` -* Using $\alpha$ assign each consumer $k$ the share $\alpha_k$ of the aggregate endowment at each state +To compute a competitive equilibrium with Arrow securities in the finite-horizon Markov economy, -* return to the $\alpha$-dependent formula {eq}`eq:continwealth` and compute continuation wealths +1. compute $Q$ from the aggregate endowment using formula {eq}`eq:Qformula`; +2. compute the distribution of wealth $\alpha$ from formulas {eq}`eq:w` and {eq}`eq:ww`; +3. using $\alpha$, assign each consumer $k$ the share $\alpha_k$ of the aggregate endowment in each state; +4. compute continuation wealths from formula {eq}`eq:vv`; and +5. set agent $k$'s portfolio equal to its continuation wealth state by state. -* via formula {eq}`eqn:optport` equate agent $k$'s portfolio to its continuation wealth state by state +The value function of consumer $k$ at time $t$ is -We can also add formulas for optimal value functions in a competitive equilibrium with trades -in a complete set of one-period state-contingent Arrow securities. +$$ +J_t^k = \left[I + \beta P + \cdots + (\beta P)^{T-t}\right] u(\alpha_k y) . +$$ -Call the optimal value functions $J^k$ for consumer $k$. +## Python code -For the infinite horizon economy now under study, the formula is +We now create a Python class to compute the objects that comprise a competitive equilibrium with sequential trading of one-period Arrow securities. -$$ J^k = (I - \beta P)^{-1} u(\alpha_k y) , \quad u(c) = \frac{c^{1-\gamma}}{1-\gamma} $$ +The class handles both infinite-horizon economies and finite-horizon economies indexed by horizon $T$. -where it is understood that $ u(\alpha_k y)$ is a vector. +Every geometric sum in the lecture has the form $I + M + \cdots$, with $M = Q$ for prices and wealth and $M = \beta P$ for values, so a single helper method computes them all. +In the finite-horizon case the helper works backward with the recursion $S_t = I + M S_{t+1}$, starting from $S_T = I$. -## Finite Horizon +With $M = Q$, this recursion is the law of iterated values at work: the time $t$ value of payouts from $t$ through $T$ is the payout at $t$ plus the time $t$ value of the time $t+1$ value of the remaining payouts. -We now describe a finite-horizon version of the economy that operates for $T+1$ periods -$t \in {\bf T} = \{ 0, 1, \ldots, T\}$. +With $M = \beta P$, it is the law of iterated expectations applied to discounted utility. -Consequently, we'll want $T+1$ counterparts to objects described above, with one important exception: -we won't need **borrowing limits**. +The class also has a method that prices an asset with dividend vector $d$ by applying these sums, which delivers the cum-dividend price $p = d + Q d + Q^2 d + \cdots$ and the ex-dividend price $p - d$. - * borrowing limits aren't required for a finite horizon economy in which a -one-period utility function $u(c)$ satisfies an Inada condition that sets the marginal utility of consumption at zero consumption to zero. - * Nonnegativity of consumption choices at all $t \in {\bf T}$ automatically -limits borrowing. +In the finite-horizon case, arrays that depend on time are ordered from $t = 0$ to $t = T$, so that `ψ[t]` is $\psi_t$ and `J[t]` is $J_t$. +In the infinite-horizon case they have a single leading element. -### Continuation Wealths +```{code-cell} ipython3 +class RecurCompetitive: + """ + A competitive equilibrium with complete markets in one-period + Arrow securities. + + Parameters + ---------- + s : array of length n + Markov states + P : n x n array + Markov transition matrix + ys : n x K array + endowments, with column k holding agent k's endowment + γ : float + coefficient of relative risk aversion + β : float + discount factor + T : int or None + time horizon, None for an infinite horizon + """ + def __init__(self, s, P, ys, γ=0.5, β=0.98, T=None): -We denote a $K \times 1$ vector of state-dependent continuation wealths in Markov state $s$ at time $t$ as + self.s, self.P, self.ys = s, P, ys + self.γ, self.β, self.T = γ, β, T + self.n, self.K = ys.shape + self.y = ys.sum(axis=1) # aggregate endowment -$$ -\psi_t\left(s\right)=\left[\begin{array}{c} -\psi^{1}\left(s\right)\\ -\vdots\\ -\psi^{K}\left(s\right) -\end{array}\right], \quad s \in \left[\bar{s}_1, \ldots, \bar{s}_n\right] -$$ + self.Q = self.pricing_kernel() + self.PRF = self.Q.sum(axis=1) # price of a risk-free bond + self.R = 1 / self.PRF # gross risk-free rate -and an $n \times 1$ vector of continuation wealths for each individual $k$ as + # V[t] = I + Q + ... + Q^(T-t), or [(I - Q)^(-1)] if T is None + self.V = self.geometric_sums(self.Q) -$$ -\psi_t^{k}=\left[\begin{array}{c} -\psi_t^{k}\left(\bar{s}_{1}\right)\\ -\vdots\\ -\psi_t^{k}\left(\bar{s}_{n}\right) -\end{array}\right], \quad k \in \left[1, \ldots, K\right] -$$ + # time-0 values of endowments, the natural debt limits + self.A = self.asset_price(ys) + def u(self, c): + "CRRA utility" + return c ** (1 - self.γ) / (1 - self.γ) + def u_prime(self, c): + "Marginal utility" + return c ** (-self.γ) -Continuation wealths $\psi^k$ of consumer $k$ satisfy + def pricing_kernel(self): + "Pricing kernel Q from equation (eq:Qformula)" + mu = self.u_prime(self.y) + return self.β * self.P * mu[None, :] / mu[:, None] + + def geometric_sums(self, M): + """ + Return [(I - M)^(-1)] if T is None; otherwise return the sequence + S[0], ..., S[T] with S[t] = I + M + ... + M^(T-t). + """ + n, T = self.n, self.T + if T is None: + return np.linalg.inv(np.eye(n) - M)[None, :, :] + S = np.empty((T+1, n, n)) + S[T] = np.eye(n) + for t in range(T-1, -1, -1): + S[t] = np.eye(n) + M @ S[t+1] # law of iterated values + return S + + def asset_price(self, d, ex_dividend=False): + """ + Time-0 price of an asset with dividend vector d (n or n x K): + cum-dividend p = d + Q d + Q^2 d + ..., or ex-dividend p - d. + """ + p = self.V[0] @ d + return p - d if ex_dividend else p -$$ -\begin{aligned} -\psi_T^k & = \left[\alpha_k y - y^k\right] \cr -\psi_{T-1}^k & = \left[I + Q \right] \left[\alpha_k y - y^k\right] \cr -\vdots \quad & \quad \quad \quad \vdots \cr -\psi_0^k & = \left[I + Q + Q^2 + \cdots + Q^T \right] \left[\alpha_k y - y^k\right] -\end{aligned} -$$ (eq:vv) + def wealth_distribution(self, s0_idx): + "Wealth distribution α when the initial state has index s0_idx" + self.s0_idx = s0_idx + V_z = self.V[0, s0_idx, :] + self.α = V_z @ self.ys / (V_z @ self.y) + return self.α -where + def continuation_wealths(self): + "Continuation wealths ψ, with ψ[t, i, k] = ψ_t^k(s_i)" + excess = np.outer(self.y, self.α) - self.ys # α_k y - y^k + self.ψ = self.V @ excess + return self.ψ + + def value_functions(self): + "Value functions J, with J[t, i, k] = J_t^k(s_i)" + flow = self.u(np.outer(self.y, self.α)) # u(α_k y) + self.J = self.geometric_sums(self.β * self.P) @ flow + return self.J +``` -$$ -y^{k}=\left[\begin{array}{c} -y^{k}\left(\bar{s}_{1}\right)\\ -\vdots\\ -y^{k}\left(\bar{s}_{n}\right) -\end{array}\right],\quad y=\left[\begin{array}{c} -y\left(\bar{s}_{1}\right)\\ -\vdots\\ -y\left(\bar{s}_{n}\right) -\end{array}\right] -$$ +## Examples -Note that $\sum_{k=1}^K \psi_t^k = {0}_{n \times 1}$ for all $t \in {\bf T}$. +We'll use our code to construct equilibrium objects in several example economies. -**Remark:** At the initial state $s_0 \in \begin{bmatrix} \bar s_1, \ldots, \bar s_n \end{bmatrix}$, - for all agents $k = 1, \ldots, K$, continuation wealth $\psi_0^k(s_0) = 0$. This indicates that -the economy begins with all agents being debt-free and financial-asset-free at time $0$, state $s_0$. +Our first several examples are infinite-horizon economies. +Our final example is a finite-horizon economy. -**Remark:** Note that all agents' continuation wealths return to zero when the Markov state returns to whatever value $s_0$ it had at time $0$. This will recur if the Markov chain makes the initial state $s_0$ recurrent. +Unless we say otherwise, examples use the default parameter values $\gamma = 0.5$ and $\beta = 0.98$. +### Example 1: a constant aggregate endowment +Two agents have perfectly negatively correlated endowments, so the aggregate endowment is constant. +```{code-cell} ipython3 +s = np.array([0, 1]) +P = np.array([[.5, .5], + [.5, .5]]) -With the initial state being a particular state $s_0 \in \left[\bar{s}_1, \ldots, \bar{s}_n\right]$, we must have +ys = np.empty((2, 2)) +ys[:, 0] = 1 - s # agent 1 +ys[:, 1] = s # agent 2 -$$ -\psi_0^k\left(s_0\right) = 0, \quad k=1, \ldots, K -$$ +ex1 = RecurCompetitive(s, P, ys) +``` -which means the equilibrium distribution of wealth satisfies +```{code-cell} ipython3 +print("aggregate endowment y =", ex1.y) +print("pricing kernel Q = \n", ex1.Q) +print("risk-free rate R =", ex1.R) +print("natural debt limits A = \n", ex1.A) +``` -$$ -\alpha_k = \frac{V_z y^k}{V_z y} -$$ (eq:w) +Because the aggregate endowment is constant, marginal utility is constant, so $Q = \beta P$ and the risk-free rate is $\beta^{-1}$ in both states. +```{code-cell} ipython3 +# initial state is state 1 +print(f'α = {ex1.wealth_distribution(s0_idx=0)}') +print(f'ψ = \n{ex1.continuation_wealths()}') +print(f'J = \n{ex1.value_functions()}') +print(f'share of natural debt limits in s0: {ex1.A[0] / ex1.A[0].sum()}') +``` +When the economy starts in state 1, agent 1 receives slightly more than half of aggregate consumption. -where now in our finite-horizon economy +Its endowment arrives in the initial period, and consumption received sooner is discounted less. -$$ - V = \left[I + Q + Q^2 + \cdots + Q^T \right] -$$ (eq:ww) +As the last line confirms, each agent's consumption share equals its share of the natural debt limits in the initial state. -and $z$ is the row index corresponding to the initial state $s_0$. +In state 2, where agent 1 has no endowment, agent 1 holds financial wealth of one unit, which finances its consumption, and agent 2 owes exactly that amount. -Since $\sum_{k=1}^K V_z y^k = V_z y$, $\sum_{k=1}^K \alpha_k = 1$. +```{code-cell} ipython3 +# initial state is state 2 +print(f'α = {ex1.wealth_distribution(s0_idx=1)}') +print(f'ψ = \n{ex1.continuation_wealths()}') +print(f'J = \n{ex1.value_functions()}') +``` +Starting in state 2 simply swaps the roles of the two agents. -In summary, here is the logical flow of an algorithm to compute a competitive equilibrium with Arrow securities -in our finite-horizon Markov economy: +### Example 2: a fluctuating aggregate endowment -* compute $Q$ from the aggregate allocation and formula {eq}`eq:Qformula` +Now agent 1 has a constant endowment while agent 2's endowment fluctuates, so the aggregate endowment fluctuates. -* compute the distribution of wealth $\alpha$ from formulas {eq}`eq:w` and {eq}`eq:ww` +```{code-cell} ipython3 +s = np.array([1, 2]) +P = np.array([[.5, .5], + [.5, .5]]) -* using $\alpha$, assign each consumer $k$ the share $\alpha_k$ of the aggregate endowment at each state +ys = np.empty((2, 2)) +ys[:, 0] = 1.5 # agent 1 +ys[:, 1] = s # agent 2 -* return to the $\alpha$-dependent formula {eq}`eq:vv` for continuation wealths and compute continuation wealths +ex2 = RecurCompetitive(s, P, ys) -* equate agent $k$'s portfolio to its continuation wealth state by state +print("aggregate endowment y =", ex2.y) +print("pricing kernel Q = \n", ex2.Q) +print("risk-free rate R =", ex2.R) +print("natural debt limits A = \n", ex2.A) +``` +The pricing kernels in examples 1 and 2 differ because the aggregate endowment is constant in example 1 but differs across states in example 2. -While for the infinite horizon economy, the formula for value functions is +We can check two off-diagonal entries of $Q$ directly against formula {eq}`eq:Qformula`. -$$ J^k = (I - \beta P)^{-1} u(\alpha_k y) , \quad u(c) = \frac{c^{1-\gamma}}{1-\gamma} $$ +```{code-cell} ipython3 +print(ex2.β * ex2.u_prime(3.5) / ex2.u_prime(2.5) * ex2.P[0, 1], ex2.Q[0, 1]) +print(ex2.β * ex2.u_prime(2.5) / ex2.u_prime(3.5) * ex2.P[1, 0], ex2.Q[1, 0]) +``` -for the finite horizon economy the formula is +A claim to consumption in the high-endowment state is cheap, because marginal utility is low there. -$$ J_0^k = (I + \beta P + \cdots + \beta^T P^T) u(\alpha_k y) , $$ +The risk-free rate is high in the low-endowment state, where consumption is expected to rise, and low in the high-endowment state, where consumption is expected to fall. -where it is understood that $ u(\alpha_k y)$ is a vector. +Now let's price some risky assets with the formulas $p^h = (I - Q)^{-1} d^h$ and $p^h = (I - Q)^{-1} Q d^h$ from the section on Markov asset prices. +We price a Lucas tree, which pays the aggregate endowment as its dividend, and claims to each agent's endowment stream. +```{code-cell} ipython3 +p_tree = ex2.asset_price(ex2.y) +p_tree_ex = ex2.asset_price(ex2.y, ex_dividend=True) + +print("cum-dividend tree price p =", p_tree) +print("ex-dividend tree price p =", p_tree_ex) +print("price-dividend ratio (ex) =", p_tree_ex / ex2.y) +print("Bellman residual |p - d - Qp| =", + np.abs(p_tree - ex2.y - ex2.Q @ p_tree).max()) +print("claims to endowments = \n", ex2.asset_price(ex2.ys)) +``` -## Python Code +The cum-dividend price satisfies the one-step Bellman equation $p = d + Q p$ to machine precision. -We are ready to dive into some Python code. +The ex-dividend price-dividend ratio is higher in the low-endowment state, where the current dividend is low relative to expected future dividends. +The last array reproduces the natural debt limits computed above: agent $k$'s natural debt limit in state $s$ is the cum-dividend price of a claim to agent $k$'s own endowment stream. -As usual, we start with Python imports. +That is why an agent can always repay a debt no larger than $\bar A^k(s)$: it could sell the claim to its endowment and consume nothing forever. ```{code-cell} ipython3 -import numpy as np -import matplotlib.pyplot as plt +# initial state is state 1 +print(f'α = {ex2.wealth_distribution(s0_idx=0)}') +print(f'ψ = \n{ex2.continuation_wealths()}') +print(f'J = \n{ex2.value_functions()}') ``` ```{code-cell} ipython3 -np.set_printoptions(suppress=True) +# initial state is state 2 +print(f'α = {ex2.wealth_distribution(s0_idx=1)}') +print(f'ψ = \n{ex2.continuation_wealths()}') +print(f'J = \n{ex2.value_functions()}') ``` -First, we create a Python class to compute the objects that comprise a competitive equilibrium -with sequential trading of one-period Arrow securities. - -In addition to infinite-horizon economies, the code is set up to handle finite-horizon economies indexed by horizon $T$. +### Example 3: an absorbing state -We'll study examples of finite horizon economies after we first look at some infinite-horizon economies. +In this example state 2 is absorbing, so state 1 is transient. ```{code-cell} ipython3 -class RecurCompetitive: - """ - A class that represents a recursive competitive economy - with one-period Arrow securities. - """ - - def __init__(self, - s, # state vector - P, # transition matrix - ys, # endowments ys = [y1, y2, .., yI] - γ=0.5, # risk aversion - β=0.98, # discount rate - T=None): # time horizon, none if infinite - - # preference parameters - self.γ = γ - self.β = β - - # variables dependent on state - self.s = s - self.P = P - self.ys = ys - self.y = np.sum(ys, 1) - - # dimensions - self.n, self.K = ys.shape - - # compute pricing kernel - self.Q = self.pricing_kernel() - - # compute price of risk-free one-period bond - self.PRF = self.price_risk_free_bond() - - # compute risk-free rate - self.R = self.risk_free_rate() - - # V = [I - Q]^{-1} (infinite case) - if T is None: - self.T = None - self.V = np.empty((1, n, n)) - self.V[0] = np.linalg.inv(np.eye(n) - self.Q) - # V = [I + Q + Q^2 + ... + Q^T] (finite case) - else: - self.T = T - self.V = np.empty((T+1, n, n)) - self.V[0] = np.eye(n) - - Qt = np.eye(n) - for t in range(1, T+1): - Qt = Qt.dot(self.Q) - self.V[t] = self.V[t-1] + Qt - - # natural debt limit - self.A = self.V[-1] @ ys - - def u(self, c): - "The CRRA utility" - - return c ** (1 - self.γ) / (1 - self.γ) +s = np.array([1, 2]) - def u_prime(self, c): - "The first derivative of CRRA utility" +λ = 0.9 +P = np.array([[1-λ, λ], + [0, 1]]) - return c ** (-self.γ) +ys = np.empty((2, 2)) +ys[:, 0] = [1, 0] # agent 1 +ys[:, 1] = [0, 1] # agent 2 - def pricing_kernel(self): - "Compute the pricing kernel matrix Q" +ex3 = RecurCompetitive(s, P, ys) - c = self.y +print("pricing kernel Q = \n", ex3.Q) +print("natural debt limits A = \n", ex3.A) +``` - n = self.n - Q = np.empty((n, n)) - for i in range(n): - for j in range(n): - ratio = self.u_prime(c[j]) / self.u_prime(c[i]) - Q[i, j] = self.β * ratio * P[i, j] +The natural debt limit for agent 1 in state 2 is $0$. - self.Q = Q +Once the economy enters the absorbing state, agent 1 never receives another unit of endowment, so it cannot credibly promise to repay anything. - return Q +```{code-cell} ipython3 +# initial state is state 1 +print(f'α = {ex3.wealth_distribution(s0_idx=0)}') +print(f'ψ = \n{ex3.continuation_wealths()}') +print(f'J = \n{ex3.value_functions()}') +``` - def wealth_distribution(self, s0_idx): - "Solve for wealth distribution α" +Starting in state 1, agent 1 receives only a small share of aggregate consumption, because its endowment arrives only while the economy remains in the transient state. - # set initial state - self.s0_idx = s0_idx +Because state 1 is transient, the economy eventually leaves it for good, and agents' wealths do not recurrently return to zero. - # simplify notations - n = self.n - Q = self.Q - y, ys = self.y, self.ys +```{code-cell} ipython3 +# initial state is state 2 +print(f'α = {ex3.wealth_distribution(s0_idx=1)}') +print(f'ψ = \n{ex3.continuation_wealths()}') +print(f'J = \n{ex3.value_functions()}') +``` - # row of V corresponding to s0 - Vs0 = self.V[-1, s0_idx, :] - α = Vs0 @ self.ys / (Vs0 @ self.y) +Starting in the absorbing state, agent 1 owns nothing of value, so $\alpha_1 = 0$ and agent 1 consumes nothing forever. - self.α = α +This corner is consistent with the discussion of the Inada condition above, which guarantees interior consumption only for agents whose endowments have positive value. - return α +For the specification of the Markov chain in example 3, let's see how the equilibrium wealth distribution varies with the transition probability $\lambda$. - def continuation_wealths(self): - "Given α, compute the continuation wealths ψ" +```{code-cell} ipython3 +λ_seq = np.linspace(0, 0.99, 100) - diff = np.empty((n, K)) - for k in range(K): - diff[:, k] = self.α[k] * self.y - self.ys[:, k] +# prepare containers +αs0_seq = np.empty((len(λ_seq), 2)) +αs1_seq = np.empty((len(λ_seq), 2)) - ψ = self.V @ diff - self.ψ = ψ +for i, λ in enumerate(λ_seq): + P_λ = np.array([[1-λ, λ], + [0, 1]]) + ex3_λ = RecurCompetitive(s, P_λ, ys) - return ψ + # initial state s0 = 1 + αs0_seq[i, :] = ex3_λ.wealth_distribution(s0_idx=0) - def price_risk_free_bond(self): - "Give Q, compute price of one-period risk free bond" + # initial state s0 = 2 + αs1_seq[i, :] = ex3_λ.wealth_distribution(s0_idx=1) +``` - PRF = np.sum(self.Q, axis=1) - self.PRF = PRF +```{code-cell} ipython3 +fig, axs = plt.subplots(1, 2, figsize=(12, 4)) - return PRF +for i, αs_seq in enumerate([αs0_seq, αs1_seq]): + for j in range(2): + axs[i].plot(λ_seq, αs_seq[:, j], label=f'$\\alpha_{j+1}$') + axs[i].set_xlabel(r'$\lambda$') + axs[i].set_title(f'initial state $s_0 = {s[i]}$') + axs[i].legend() - def risk_free_rate(self): - "Given Q, compute one-period gross risk-free interest rate R" +plt.show() +``` - R = np.sum(self.Q, axis=1) - R = np.reciprocal(R) - self.R = R +When the economy starts in state 1, a higher probability $\lambda$ of leaving that state for good shortens the expected duration of agent 1's endowment and lowers its wealth share. - return R +When the economy starts in the absorbing state 2, $\lambda$ is irrelevant and agent 2 owns everything. - def value_functionss(self): - "Given α, compute the optimal value functions J in equilibrium" +### Example 4: prosperity, a moderate state, and recession - n, T = self.n, self.T - β = self.β - P = self.P +Our last infinite-horizon example has three Markov states, which we interpret as prosperity, a moderate state, and recession. - # compute (I - βP)^(-1) in infinite case - if T is None: - P_seq = np.empty((1, n, n)) - P_seq[0] = np.linalg.inv(np.eye(n) - β * P) - # and (I + βP + ... + β^T P^T) in finite case - else: - P_seq = np.empty((T+1, n, n)) - P_seq[0] = np.eye(n) +```{code-cell} ipython3 +s = np.array([1, 2, 3]) - Pt = np.eye(n) - for t in range(1, T+1): - Pt = Pt.dot(P) - P_seq[t] = P_seq[t-1] + Pt * β ** t +λ = .9 +μ = .9 +δ = .05 - # compute the matrix [u(α_1 y), ..., u(α_K, y)] - flow = np.empty((n, K)) - for k in range(K): - flow[:, k] = self.u(self.α[k] * self.y) +# prosperous, moderate, and recession states +P = np.array([[1-λ, λ, 0], + [(1-μ)/2, μ, (1-μ)/2], + [(1-δ)/2, (1-δ)/2, δ]]) - J = P_seq @ flow +ys = np.empty((3, 2)) +ys[:, 0] = [.25, .75, .2] # agent 1 +ys[:, 1] = [1.25, .25, .2] # agent 2 - self.J = J +ex4 = RecurCompetitive(s, P, ys) - return J +print("rows of P sum to", P.sum(axis=1)) +print("aggregate endowment y =", ex4.y) +print("pricing kernel Q = \n", ex4.Q) +print("risk-free rate R =", ex4.R) +print("natural debt limits A = \n", ex4.A) ``` -## Examples +The moderate state is highly persistent, and the economy moves out of recession quickly. -We'll use our code to construct equilibrium objects in several example economies. - -Our first several examples will be infinite horizon economies. +The gross risk-free rate is below one in prosperity, where aggregate consumption is expected to fall, and well above one in recession, where it is expected to recover. -Our final example will be a finite horizon economy. +```{code-cell} ipython3 +for i in range(3): + print(f"initial state is state {i+1}") + print(f'α = {ex4.wealth_distribution(s0_idx=i)}') + print(f'ψ = \n{ex4.continuation_wealths()}') + print(f'J = \n{ex4.value_functions()}\n') +``` -### Example 1 +Agent 1, whose endowment is concentrated in the persistent moderate state, receives about two thirds of aggregate consumption whichever state the economy starts in. -Please read the preceding class for default parameter values and the following Python code for the fundamentals of the economy. +### A finite-horizon example -Here goes. +We now revisit the economy defined in example 1, but set the time horizon to $T = 10$. ```{code-cell} ipython3 -# dimensions -K, n = 2, 2 - -# states s = np.array([0, 1]) +P = np.array([[.5, .5], + [.5, .5]]) -# transition -P = np.array([[.5, .5], [.5, .5]]) +ys = np.empty((2, 2)) +ys[:, 0] = 1 - s # agent 1 +ys[:, 1] = s # agent 2 -# endowments -ys = np.empty((n, K)) -ys[:, 0] = 1 - s # y1 -ys[:, 1] = s # y2 +ex1_finite = RecurCompetitive(s, P, ys, T=10) ``` ```{code-cell} ipython3 -ex1 = RecurCompetitive(s, P, ys) +# I + Q + Q^2 + ... + Q^T +ex1_finite.V[0] ``` -```{code-cell} ipython3 -# endowments -ex1.ys -``` +In the finite-horizon case, `ψ` and `J` are returned as sequences ordered from $t = 0$ to $t = T$. ```{code-cell} ipython3 -# pricing kernal -ex1.Q +# initial state is state 1 +print(f'α = {ex1_finite.wealth_distribution(s0_idx=0)}') +print(f'ψ = \n{ex1_finite.continuation_wealths()}\n') +print(f'J = \n{ex1_finite.value_functions()}') ``` ```{code-cell} ipython3 -# Risk free rate R -ex1.R +# initial state is state 2 +print(f'α = {ex1_finite.wealth_distribution(s0_idx=1)}') +print(f'ψ = \n{ex1_finite.continuation_wealths()}\n') +print(f'J = \n{ex1_finite.value_functions()}') ``` -```{code-cell} ipython3 -# natural debt limit, A = [A1, A2, ..., AI] -ex1.A -``` +The wealth distribution is further from equal than in example 1, because with a short horizon the endowment received in the initial period is a larger fraction of the total value of an agent's endowment. -```{code-cell} ipython3 -# when the initial state is state 1 -print(f'α = {ex1.wealth_distribution(s0_idx=0)}') -print(f'ψ = \n{ex1.continuation_wealths()}') -print(f'J = \n{ex1.value_functionss()}') -``` +Let's check why this economy needs no borrowing limits. -```{code-cell} ipython3 -# when the initial state is state 2 -print(f'α = {ex1.wealth_distribution(s0_idx=1)}') -print(f'ψ = \n{ex1.continuation_wealths()}') -print(f'J = \n{ex1.value_functionss()}') -``` +At date $t$, the most that agent $k$ could ever repay from its own endowment is the value of its remaining endowment stream, $[I + Q + \cdots + Q^{T-t}]\, y^k$. -### Example 2 +Unlike in the infinite-horizon economy, these bounds need not be imposed. -```{code-cell} ipython3 -# dimensions -K, n = 2, 2 +At date $T$ no securities are traded, so an agent cannot roll debt over, and nonnegative consumption at $T$ limits what it can owe to $y^k(s_T)$. -# states -s = np.array([1, 2]) +Working backward, nonnegative consumption at each earlier date implies the bound for that date. -# transition -P = np.array([[.5, .5], [.5, .5]]) +The distance between an agent's bound and its debt, $\psi_t^k + [I + Q + \cdots + Q^{T-t}]\, y^k$, equals $[I + Q + \cdots + Q^{T-t}]\, \alpha_k y$, the value of the agent's remaining consumption. -# endowments -ys = np.empty((n, K)) -ys[:, 0] = 1.5 # y1 -ys[:, 1] = s # y2 -``` +That value is positive because consumption is positive, so the implied bounds never bind. + +The following code computes the bounds for every date and state and confirms this. ```{code-cell} ipython3 -ex2 = RecurCompetitive(s, P, ys) +ex1_finite.wealth_distribution(s0_idx=0) +ψ_finite = ex1_finite.continuation_wealths() +bounds = ex1_finite.V @ ex1_finite.ys # bounds[t] = (I + ... + Q^(T-t)) y^k + +print("implied bounds at t = T (rows: states, columns: agents):\n", bounds[-1]) +print("smallest slack ψ_t + bound over all t, states, agents:", + (ψ_finite + bounds).min().round(4)) ``` -```{code-cell} ipython3 -# endowments +At $t = T$, the bounds are just current endowments, and the slack is smallest there because only one period of consumption remains to be valued. -print("ys = \n", ex2.ys) +In the infinite-horizon economy there is no last date at which debts must be settled, so without explicit limits an agent could roll over ever larger debts forever, and the natural debt limits {eq}`eq:debtlimit` must be imposed. -# pricing kernal -print ("Q = \n", ex2.Q) +We can check that as $T \rightarrow \infty$ the finite-horizon results converge to those of the infinite-horizon economy. -# Risk free rate R -print("R = ", ex2.R) -``` +Both economies below start in state 2, and we compare time-0 objects. ```{code-cell} ipython3 -# pricing kernal -ex2.Q -``` +ex1_large = RecurCompetitive(s, P, ys, T=10000) +ex1.wealth_distribution(s0_idx=1) +ex1_large.wealth_distribution(s0_idx=1) -Note that the pricing kernal in example economies 1 and 2 differ. +print("V:", np.abs(ex1.V[0] - ex1_large.V[0]).max()) +print("ψ:", np.abs(ex1.continuation_wealths()[0] + - ex1_large.continuation_wealths()[0]).max()) +print("J:", np.abs(ex1.value_functions()[0] + - ex1_large.value_functions()[0]).max()) +``` -This comes from differences in the aggregate endowments in state 1 and 2 in example 1. +The maximum absolute differences are negligible. -```{code-cell} ipython3 -ex2.β * ex2.u_prime(3.5) / ex2.u_prime(2.5) * ex2.P[0,1] -``` +## Concluding remarks -```{code-cell} ipython3 -ex2.β * ex2.u_prime(2.5) / ex2.u_prime(3.5) * ex2.P[1,0] -``` +We began by promising a computable account of competitive equilibrium in an infinite-horizon exchange economy with heterogeneous endowments, complete markets in one-period Arrow securities, identical CRRA preferences, and common beliefs. +Here is how the lecture delivered on that promise. +### Prices before the wealth distribution -```{code-cell} ipython3 -# Risk free rate R -ex2.R -``` +Because all agents face the same pricing kernel, their Euler equations force consumption shares to be constant, so that $c^k(s) = \alpha_k y(s)$. -```{code-cell} ipython3 -# natural debt limit, A = [A1, A2, ..., AI] -ex2.A -``` +The pricing kernel {eq}`eq:Qformula` therefore depends only on the aggregate endowment, and it coincides with the kernel of a representative-agent Lucas tree economy. -```{code-cell} ipython3 -# when the initial state is state 1 -print(f'α = {ex2.wealth_distribution(s0_idx=0)}') -print(f'ψ = \n{ex2.continuation_wealths()}') -print(f'J = \n{ex2.value_functionss()}') -``` +The wealth distribution $\alpha$ comes second, pinned down by the requirement that every agent start with zero financial wealth, which makes $\alpha_k$ equal to agent $k$'s share of the value of aggregate endowments in the initial state. -```{code-cell} ipython3 -# when the initial state is state 1 -print(f'α = {ex2.wealth_distribution(s0_idx=1)}') -print(f'ψ = \n{ex2.continuation_wealths()}') -print(f'J = \n{ex2.value_functionss()}') -``` +### Bellmanizing the equilibrium -### Example 3 +Each object that the overview promised to describe with a Bellman equation satisfies a one-step recursion of the form $x = b + Q x$: -```{code-cell} ipython3 -# dimensions -K, n = 2, 2 +* asset prices satisfy $p^h = d^h + Q p^h$, as we verified for a Lucas tree in example 2; +* natural debt limits satisfy $\bar A^k = y^k + Q \bar A^k$, which makes them the prices of claims to agents' endowment streams; and +* continuation wealth satisfies $\psi^k = (\alpha_k y - y^k) + Q \psi^k$. -# states -s = np.array([1, 2]) +Value functions satisfy the analogous recursion $J^k = u(\alpha_k y) + \beta P J^k$, with $\beta P$ in place of $Q$. -# transition -λ = 0.9 -P = np.array([[1-λ, λ], [0, 1]]) +These recursions are what let a single Python class, `RecurCompetitive`, compute an entire equilibrium from a few matrix operations. -# endowments -ys = np.empty((n, K)) -ys[:, 0] = [1, 0] # y1 -ys[:, 1] = [0, 1] # y2 -``` +### The five ideas -```{code-cell} ipython3 -ex3 = RecurCompetitive(s, P, ys) -``` +* **Resolvent operators.** Solving each recursion gives $(I - Q)^{-1}$ or $(I - \beta P)^{-1}$, and the similarity $Q = \beta D^{-1} P D$ guarantees that the spectral radius of $Q$ is $\beta < 1$, so these resolvents exist. +* **State-by-state borrowing limits in infinite horizons.** Natural debt limits $\bar A^k = (I - Q)^{-1} y^k$ are the largest debts that agent $k$ could repay from its own endowment, and example 3 showed that they can be zero in states where an agent's future endowment is worthless. +* **No borrowing limits in finite horizons.** When the economy ends at $T$, no one can roll debt over past the last date, and nonnegative consumption implies bounds $[I + Q + \cdots + Q^{T-t}]\, y^k$ that we computed and showed never bind, so no separate debt limits need to be imposed. +* **The law of iterated values.** Multi-period Arrow prices compound as $Q^j$ in the same way that multi-period transition probabilities compound as $P^j$, and the backward recursion $S_t = I + Q S_{t+1}$ used in `RecurCompetitive` values payouts one period at a time. +* **State variable degeneracy.** Starting from zero financial wealth, each agent's wealth is a function of the Markov state alone and returns to zero whenever the state returns to $s_0$, as {ref}`ge_arrow_ex1` verified along a simulated path; {ref}`ge_arrow_ex3` showed that this strong form of degeneracy fails in finite horizons, where wealth also depends on calendar time. -```{code-cell} ipython3 -# endowments +### What the assumptions bought -print("ys = ", ex3.ys) +Complete markets, identical CRRA preferences, and common beliefs together are what make prices independent of the wealth distribution and make wealth a function of the current state alone. -# pricing kernel -print ("Q = ", ex3.Q) +Relaxing any of them breaks at least one of these properties, which is the subject of several of the lectures listed below. -# Risk free rate R -print("R = ", ex3.R) -``` +## Related lectures -```{code-cell} ipython3 -# pricing kernel -ex3.Q -``` +This lecture assumes that all agents share beliefs. -```{code-cell} ipython3 -# natural debt limit, A = [A1, A2, ..., AI] -ex3.A -``` +* {doc}`harrison_kreps` studies an economy in which agents disagree about probabilities and short sales are constrained. +* {doc}`likelihood_ratio_process_2` studies complete markets when agents hold different beliefs, in which case wealth shares drift with likelihood ratios instead of staying constant at $\alpha$. +* {doc}`lq_bewley_complete_markets` shows, in a linear-quadratic setting, how complete markets in Arrow securities deliver a time-invariant cross-section distribution of consumption. +* {doc}`ross_recovery` and {doc}`long_run_risk_operator` study what the Perron–Frobenius eigenvalue and eigenvector of a pricing kernel like $Q$ reveal. +* {doc}`hansen_singleton_1983` confronts Euler equations like those used here with data. -Note that the natural debt limit for agent $1$ in state $2$ is $0$. +## Exercises -```{code-cell} ipython3 -# when the initial state is state 1 -print(f'α = {ex3.wealth_distribution(s0_idx=0)}') -print(f'ψ = \n{ex3.continuation_wealths()}') -print(f'J = \n{ex3.value_functionss()}') +```{exercise-start} +:label: ge_arrow_ex1 ``` -```{code-cell} ipython3 -# when the initial state is state 1 -print(f'α = {ex3.wealth_distribution(s0_idx=1)}') -print(f'ψ = \n{ex3.continuation_wealths()}') -print(f'J = \n{ex3.value_functionss()}') -``` +This exercise verifies that the objects computed by `RecurCompetitive` constitute a recursive competitive equilibrium. -For the specification of the Markov chain in example 3, let's take a look at how the equilibrium allocation changes as a function of transition probability $\lambda$. +Use example 4 and start the economy in state 1. -```{code-cell} ipython3 -λ_seq = np.linspace(0, 0.99, 100) +1. Check that every agent's Euler equation holds at the allocation $c^k(s) = \alpha_k y(s)$ and the pricing kernel $Q$. -# prepare containers -αs0_seq = np.empty((len(λ_seq), 2)) -αs1_seq = np.empty((len(λ_seq), 2)) +2. Check that agent $k$'s budget constraint $c^k(s) + \sum_{s'} Q(s' \mid s)\,\psi^k(s') = y^k(s) + \psi^k(s)$ holds in every state when the agent holds the portfolio $\hat a^k(s') = \psi^k(s')$. -for i, λ in enumerate(λ_seq): - P = np.array([[1-λ, λ], [0, 1]]) - ex3 = RecurCompetitive(s, P, ys) +3. Check that Arrow security markets clear, $\sum_k \psi^k(s) = 0$, and that no natural debt limit binds. - # initial state s0 = 1 - α = ex3.wealth_distribution(s0_idx=0) - αs0_seq[i, :] = α +4. Simulate 200 periods of the Markov chain and confirm that each agent's financial wealth is exactly zero at every visit to the initial state. - # initial state s0 = 2 - α = ex3.wealth_distribution(s0_idx=1) - αs1_seq[i, :] = α +```{exercise-end} +``` + +```{solution-start} ge_arrow_ex1 +:class: dropdown ``` +Here is one solution. + ```{code-cell} ipython3 -fig, axs = plt.subplots(1, 2, figsize=(12, 4)) +ex = RecurCompetitive(ex4.s, ex4.P, ex4.ys) -for i, αs_seq in enumerate([αs0_seq, αs1_seq]): - for j in range(2): - axs[i].plot(λ_seq, αs_seq[:, j], label=f'α{j+1}') - axs[i].set_xlabel('λ') - axs[i].set_title(f'initial state s0 = {s[i]}') - axs[i].legend() +α = ex.wealth_distribution(s0_idx=0) +ψ = ex.continuation_wealths()[0] +c = np.outer(ex.y, α) -plt.show() -``` +euler = max(np.abs(ex.Q - ex.β * ex.P * ex.u_prime(c[:, k])[None, :] + / ex.u_prime(c[:, k])[:, None]).max() + for k in range(ex.K)) +budget = np.abs(c + ex.Q @ ψ - ex.ys - ψ).max() -### Example 4 +print(f"largest Euler equation residual {euler:.1e}") +print(f"largest budget constraint residual {budget:.1e}") +print(f"largest net supply of any security {np.abs(ψ.sum(axis=1)).max():.1e}") +print(f"all natural debt limits slack: {np.all(ψ + ex.A > 0)}") +``` ```{code-cell} ipython3 -# dimensions -K, n = 2, 3 +rng = np.random.default_rng(0) +T_sim = 200 +states = np.empty(T_sim, dtype=int) +states[0] = 0 +for t in range(T_sim - 1): + states[t+1] = rng.choice(ex.n, p=ex.P[states[t]]) + +a = ψ[states] # financial wealth of each agent along the path +print(f"visits to the initial state: {np.sum(states == 0)}") +print(f"largest |wealth| at those visits: {np.abs(a[states == 0]).max():.1e}") +``` -# states -s = np.array([1, 2, 3]) +All four conditions hold to machine precision. -# transition -λ = .9 -μ = .9 -δ = .05 - -# prosperous, moderate, and recession states -P = np.array([[1-λ, λ, 0], [μ/2, μ, μ/2], [(1-δ)/2, (1-δ)/2, δ]]) +The last check is **state variable degeneracy** in action: financial wealth is a function of the Markov state alone, so it returns to its initial value of zero whenever the state does. -# endowments -ys = np.empty((n, K)) -ys[:, 0] = [.25, .75, .2] # y1 -ys[:, 1] = [1.25, .25, .2] # y2 +```{solution-end} ``` -```{code-cell} ipython3 -ex4 = RecurCompetitive(s, P, ys) +```{exercise-start} +:label: ge_arrow_ex2 ``` -```{code-cell} ipython3 -# endowments -print("ys = \n", ex4.ys) +This exercise connects the lecture to {doc}`ross_recovery`. -# pricing kernal -print ("Q = \n", ex4.Q) +An outside observer sees the equilibrium pricing kernel $Q$ and the aggregate endowment $y$, but not $\beta$, $\gamma$, or the transition matrix $P$. -# Risk free rate R -print("R = ", ex4.R) +1. Show that the vector with components $y(\bar s_j)^{\gamma}$ is a right eigenvector of $Q$ with eigenvalue $\beta$. -# natural debt limit, A = [A1, A2, ..., AI] -print("A = \n", ex4.A) +2. Using example 4, compute the Perron–Frobenius eigenvalue and eigenvector of $Q$, and use them to recover $\beta$, $\gamma$, and $P$. -print('') +```{exercise-end} +``` -for i in range(1, 4): - # when the initial state is state i - print(f"when the initial state is state {i}") - print(f'α = {ex4.wealth_distribution(s0_idx=i-1)}') - print(f'ψ = \n{ex4.continuation_wealths()}') - print(f'J = \n{ex4.value_functionss()}\n') +```{solution-start} ge_arrow_ex2 +:class: dropdown ``` +Here is one solution. -### Finite Horizon Example +Let $v_j = y_j^{\gamma}$. -We now revisit the economy defined in example 1, but set the time horizon to be $T=10$. +Using {eq}`eq:Qformula`, -```{code-cell} ipython3 -# dimensions -K, n = 2, 2 +$$ +\sum_j Q_{ij} v_j += \sum_j \beta \left(\frac{y_j}{y_i}\right)^{-\gamma} P_{ij}\, y_j^{\gamma} += \beta\, y_i^{\gamma} \sum_j P_{ij} += \beta\, v_i , +$$ -# states -s = np.array([0, 1]) +because the rows of $P$ sum to one. -# transition -P = np.array([[.5, .5], [.5, .5]]) +Since $v$ is strictly positive, it is the Perron–Frobenius eigenvector of the nonnegative matrix $Q$, and $\beta$ is its largest eigenvalue. -# endowments -ys = np.empty((n, K)) -ys[:, 0] = 1 - s # y1 -ys[:, 1] = s # y2 -``` +Given $\beta$ and $v$, the transition matrix is $P_{ij} = Q_{ij} v_j / (\beta v_i)$, and $\gamma$ is the slope of $\log v$ on $\log y$. ```{code-cell} ipython3 -ex1_finite = RecurCompetitive(s, P, ys, T=10) -``` +eigvals, eigvecs = np.linalg.eig(ex4.Q) +i = np.argmax(eigvals.real) +β_hat = eigvals[i].real +v = np.abs(eigvecs[:, i].real) -```{code-cell} ipython3 -# (I + Q + Q^2 + ... + Q^T) -ex1_finite.V[-1] -``` +γ_hat = np.polyfit(np.log(ex4.y), np.log(v), 1)[0] +P_hat = ex4.Q * v[None, :] / (β_hat * v[:, None]) -```{code-cell} ipython3 -# endowments -ex1_finite.ys +print(f"recovered β = {β_hat:.6f} (true {ex4.β})") +print(f"recovered γ = {γ_hat:.6f} (true {ex4.γ})") +print(f"max |P_hat - P| = {np.abs(P_hat - ex4.P).max():.1e}") ``` -```{code-cell} ipython3 -# pricing kernal -ex1_finite.Q +Recovery is exact because the equilibrium kernel has precisely the **transition independence** structure studied in {doc}`ross_recovery`: $Q = \beta D^{-1} P D$, with $D$ built from the marginal utility of the aggregate endowment. + +```{solution-end} ``` -```{code-cell} ipython3 -# Risk free rate R -ex1_finite.R +```{exercise-start} +:label: ge_arrow_ex3 ``` -In the finite time horizon case, `ψ` and `J` are returned as sequences. +In the infinite-horizon economy, continuation wealth depends only on the Markov state. -Components are ordered from $t=T$ to $t=0$. +This exercise shows that in the finite-horizon economy it depends on calendar time as well. -```{code-cell} ipython3 -# when the initial state is state 2 -print(f'α = {ex1_finite.wealth_distribution(s0_idx=0)}') -print(f'ψ = \n{ex1_finite.continuation_wealths()}\n') -print(f'J = \n{ex1_finite.value_functionss()}') +1. For the finite-horizon version of example 1 with $T = 10$ and initial state 1, report $\psi_t^1(\bar s_1)$ for $t = 0, 1, \ldots, 10$. + +2. Explain why agent 1's wealth does not return to zero when the Markov state returns to $\bar s_1$. + +3. Compute the wealth distribution $\alpha$ for horizons $T = 1, \ldots, 300$ and show that it converges to the infinite-horizon distribution at a geometric rate close to $\beta$. + +```{exercise-end} ``` -```{code-cell} ipython3 -# when the initial state is state 2 -print(f'α = {ex1_finite.wealth_distribution(s0_idx=1)}') -print(f'ψ = \n{ex1_finite.continuation_wealths()}\n') -print(f'J = \n{ex1_finite.value_functionss()}') +```{solution-start} ge_arrow_ex3 +:class: dropdown ``` -We can check the results with finite horizon converges to the ones with infinite horizon as $T \rightarrow \infty$. +Here is one solution. ```{code-cell} ipython3 -ex1_large = RecurCompetitive(s, P, ys, T=10000) -ex1_large.wealth_distribution(s0_idx=1) -``` +s = np.array([0, 1]) +P = np.array([[.5, .5], + [.5, .5]]) +ys = np.array([[1., 0.], + [0., 1.]]) -```{code-cell} ipython3 -ex1.V, ex1_large.V[-1] +ex_T = RecurCompetitive(s, P, ys, T=10) +ex_T.wealth_distribution(s0_idx=0) +ψ_T = ex_T.continuation_wealths() + +print("ψ_t^1(s_1), t = 0,...,10:", ψ_T[:, 0, 0].round(4)) ``` +From {eq}`eq:vv`, $\psi_t^k = \bigl[I + Q + \cdots + Q^{T-t}\bigr]\bigl[\alpha_k y - y^k\bigr]$. + +The initial condition pins $\psi_0^k(\bar s_1) = 0$, but at a later date $t$ fewer periods remain, so the geometric sum is truncated sooner and $\psi_t^k(\bar s_1) \neq 0$. + +In the infinite horizon the sum is never truncated, which is why wealth there depends on the state alone. + ```{code-cell} ipython3 -ex1_large.continuation_wealths() -ex1.ψ, ex1_large.ψ[-1] +α_inf = RecurCompetitive(s, P, ys).wealth_distribution(s0_idx=0)[0] + +T_grid = np.arange(1, 301) +gaps = np.array([abs(RecurCompetitive(s, P, ys, T=T).wealth_distribution(s0_idx=0)[0] + - α_inf) + for T in T_grid]) + +fig, ax = plt.subplots() +ax.semilogy(T_grid, gaps, lw=2, label=r'$|\alpha_1(T) - \alpha_1(\infty)|$') +ax.semilogy(T_grid, gaps[0] * ex_T.β ** (T_grid - 1), '--', lw=1.5, + label=r'reference slope $\beta^{T}$') +ax.set_xlabel('horizon $T$') +ax.legend() +plt.show() ``` -```{code-cell} ipython3 -ex1_large.value_functionss() -ex1.J, ex1_large.J[-1] +The gap shrinks geometrically, at a rate governed by the spectral radius of $Q$, which equals $\beta$. + +```{solution-end} ``` From 22881767f89249f7c5026475e51747973d2e7234 Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Tue, 15 Sep 2026 14:40:41 -0400 Subject: [PATCH 2/3] [affine_risk_prices] Correct term premium and distorted beliefs analysis, add exercises - Fix term-premium description, which had the signs in low- and high-rate states reversed - Rewrite distorted-beliefs section in subjective shocks so the agent's short rate is the market rate; verify both models imply the same risk-neutral dynamics and correct the overstatement ratio - Add identification discussion, exact lognormal SDF volatility, shock distribution under Q, negative-rate probability, and Monte Carlo standard errors - Extend yield-curve horizon and correct factor-loading description - Add exercises on CRRA and the Hansen-Jagannathan bound, the expectations hypothesis regression, and relative entropy of Q vs P - Add bib entries: FamaBliss1987, CampbellShiller1991, CIR1985, Black1995 Co-Authored-By: Claude Opus 5 --- lectures/_static/quant-econ.bib | 40 +++ lectures/affine_risk_prices.md | 547 +++++++++++++++++++++++++++----- 2 files changed, 514 insertions(+), 73 deletions(-) diff --git a/lectures/_static/quant-econ.bib b/lectures/_static/quant-econ.bib index 824a1d029..aa6536d31 100644 --- a/lectures/_static/quant-econ.bib +++ b/lectures/_static/quant-econ.bib @@ -3753,6 +3753,46 @@ @article{AngPiazzesi2003 pages = {745--787} } +@article{FamaBliss1987, + author = {Fama, Eugene F. and Bliss, Robert R.}, + title = {{The information in long-maturity forward rates}}, + journal = {American Economic Review}, + year = 1987, + volume = {77}, + number = {4}, + pages = {680--692} +} + +@article{CampbellShiller1991, + author = {Campbell, John Y. and Shiller, Robert J.}, + title = {{Yield spreads and interest rate movements: A bird's eye view}}, + journal = {Review of Economic Studies}, + year = 1991, + volume = {58}, + number = {3}, + pages = {495--514} +} + +@article{CIR1985, + author = {Cox, John C. and Ingersoll, Jonathan E. and Ross, Stephen A.}, + title = {{A theory of the term structure of interest rates}}, + journal = {Econometrica}, + year = 1985, + volume = {53}, + number = {2}, + pages = {385--407} +} + +@article{Black1995, + author = {Black, Fischer}, + title = {{Interest rates as options}}, + journal = {Journal of Finance}, + year = 1995, + volume = {50}, + number = {5}, + pages = {1371--1376} +} + @article{csiszar1963, author = {Csisz{\'a}r, Imre}, title = {{Eine informationstheoretische Ungleichung und ihre Anwendung auf den Beweis der Ergodizit{\"a}t von Markoffschen Ketten}}, diff --git a/lectures/affine_risk_prices.md b/lectures/affine_risk_prices.md index b740f36c1..32f79cc9d 100644 --- a/lectures/affine_risk_prices.md +++ b/lectures/affine_risk_prices.md @@ -37,7 +37,7 @@ $$ m_{t+1} = \exp\left(-r_t - \frac{1}{2}\sigma_c^2 \gamma^2 - \gamma\sigma_c\varepsilon_{t+1}\right) $$ -where $r_t = \rho + \gamma\mu - \frac{1}{2}\sigma_c^2\gamma^2$. +where $\rho$ is the rate of time preference, $\gamma$ is the coefficient of relative risk aversion, log consumption growth is $g + \sigma_c \varepsilon_{t+1}$, and $r_t = \rho + \gamma g - \frac{1}{2}\sigma_c^2\gamma^2$. This model asserts that exposure to the random part of aggregate consumption growth, $\sigma_c\varepsilon_{t+1}$, is the *only* priced risk, the sole source of discrepancies @@ -73,6 +73,10 @@ Key applications we study include: 4. *Distorted beliefs*: reinterpreting risk price estimates when agents hold systematically biased forecasts ({cite:t}`piazzesi2015trend`); see also {doc}`advanced:risk_aversion_or_mistaken_beliefs`. +The lecture uses lognormal pricing tools that also appear in {doc}`markov_asset` and {doc}`hansen_singleton_1983`. + +The change-of-measure arguments rely on likelihood ratios of the kind studied in {doc}`likelihood_ratio_process` and {doc}`divergence_measures`. + We start with the following imports: ```{code-cell} ipython3 @@ -80,6 +84,8 @@ import numpy as np import matplotlib.pyplot as plt from collections import namedtuple from numpy.linalg import eigvals +from scipy.linalg import solve_discrete_lyapunov +from scipy.stats import norm ``` ## The model @@ -265,6 +271,14 @@ The second equation says that the conditional standard deviation of the SDF is approximately the magnitude of the vector of risk prices, a measure of overall **market price of risk**. +The approximation comes from an exact formula: because $m_{t+1}$ is conditionally lognormal, + +$$ +\frac{\text{std}_t(m_{t+1})}{\mathbb{E}_t(m_{t+1})} = \sqrt{\exp(\lambda_t^\top\lambda_t) - 1} +$$ + +By the Hansen–Jagannathan bound {cite}`Hansen_Jagannathan_1991`, this ratio bounds the conditional Sharpe ratio of every excess return, so $\|\lambda_t\|$ tells us how large Sharpe ratios can be. + ## Pricing risky assets ### Lognormal returns @@ -353,6 +367,70 @@ Each component of $\lambda_t$ prices the corresponding component of $\varepsilon An asset that loads heavily on a risk component with a large risk price earns a correspondingly high expected return. +```{exercise} +:label: arp_ex3 + +Suppose that a representative agent has CRRA utility with risk aversion $\gamma$ and discount factor $\beta = e^{-\rho}$, and that log consumption growth is $\log(c_{t+1}/c_t) = g + \sigma_c^\top \varepsilon_{t+1}$, where $\sigma_c$ is an $m \times 1$ vector. + +1. Show that $m_{t+1} = \beta (c_{t+1}/c_t)^{-\gamma}$ has the form {eq}`eq_sdf` with a constant risk price vector $\lambda_t = \gamma \sigma_c$, and find $r_t$. +2. Define the conditional Sharpe ratio of the log return on asset $j$ as $(\nu_t(j) - r_t)/\|\alpha_t(j)\|$. Use {eq}`eq_excess` and the Cauchy–Schwarz inequality to show that the largest such Sharpe ratio is $\|\lambda_t\|$, and that it is attained by returns whose exposure vector is proportional to $\lambda_t$. +3. Suppose that $\|\sigma_c\| = 0.02$ per year and that some asset has an annual Sharpe ratio of $0.4$. Using the exact bound $\sqrt{\exp(\lambda^\top\lambda) - 1} \geq 0.4$, compute the smallest $\gamma$ consistent with the CRRA model, and compare it with the first-order answer $\gamma \geq 0.4 / 0.02$. +``` + +```{solution-start} arp_ex3 +:class: dropdown +``` + +*Part 1.* Taking logs, + +$$ +\log m_{t+1} = -\rho - \gamma g - \gamma \sigma_c^\top \varepsilon_{t+1} +$$ + +Matching the shock term with {eq}`eq_sdf` gives $\lambda_t = \gamma \sigma_c$. + +Matching the constant gives $-r_t - \frac{1}{2}\gamma^2 \sigma_c^\top\sigma_c = -\rho - \gamma g$, so + +$$ +r_t = \rho + \gamma g - \frac{1}{2}\gamma^2 \sigma_c^\top \sigma_c +$$ + +This is the CRRA model from the overview, now written as a special case of the affine model with $\lambda_z = 0$. + +*Part 2.* By {eq}`eq_excess`, the Sharpe ratio is $\alpha_t(j)^\top\lambda_t / \|\alpha_t(j)\|$. + +The Cauchy–Schwarz inequality gives $\alpha_t(j)^\top\lambda_t \leq \|\alpha_t(j)\| \, \|\lambda_t\|$, with equality exactly when $\alpha_t(j)$ is a positive multiple of $\lambda_t$. + +The following check maximizes the Sharpe ratio over many random exposure vectors. + +```{code-cell} ipython3 +rng = np.random.default_rng(1234) +λ_example = np.array([0.3, 0.1]) +α_draws = rng.standard_normal((20_000, 2)) +sharpe = α_draws @ λ_example / np.linalg.norm(α_draws, axis=1) +print(f"largest Sharpe ratio over draws: {sharpe.max():.5f}") +print(f"||λ||: {np.linalg.norm(λ_example):.5f}") +``` + +*Part 3.* + +```{code-cell} ipython3 +σ_c_norm, target_sr = 0.02, 0.4 +λ_norm_required = np.sqrt(np.log(1 + target_sr**2)) +print(f"required ||λ|| (exact bound): {λ_norm_required:.4f}") +print(f"implied γ (exact bound): {λ_norm_required / σ_c_norm:.1f}") +print(f"implied γ (first order): {target_sr / σ_c_norm:.1f}") +``` + +Either way, the CRRA model needs a coefficient of relative risk aversion near $20$. + +This is the equity premium puzzle expressed in the language of this lecture. + +The affine model sidesteps the puzzle by treating $\lambda_t$ as free parameters to be estimated from asset returns rather than tying them to consumption growth. + +```{solution-end} +``` + ## Affine term structure of yields One of the most important applications is the **affine term structure model** studied @@ -411,7 +489,7 @@ where the scalar $\bar A_n$ and the $m \times 1$ vector $\bar B_n$ satisfy the with initial conditions $\bar A_1 = -\delta_0$ and $\bar B_1 = -\delta_1$. ```{exercise} -:label: arp_ex3 +:label: arp_ex4 Derive the Riccati difference equations {eq}`eq_riccati_a` and {eq}`eq_riccati_b` by substituting the conjectured bond price {eq}`eq_bondprice` into the pricing @@ -426,7 +504,7 @@ $\varepsilon_{t+1}$, then evaluate the conditional expectation using the lognormal moment generating function. ``` -```{solution-start} arp_ex3 +```{solution-start} arp_ex4 :class: dropdown ``` @@ -571,7 +649,7 @@ mystnb: caption: Yield curves under the one-factor affine model name: fig-yield-curves-1f --- -n_max_1f = 60 +n_max_1f = 200 maturities_1f = np.arange(1, n_max_1f + 1) z_low = np.array([-5.0]) @@ -614,7 +692,7 @@ ax.set_xlim(1, n_max_1f) ax2 = ax.twiny() ax2.set_xlim(ax.get_xlim()) -year_ticks = [4, 20, 40, 60] +year_ticks = [4, 40, 80, 120, 160, 200] ax2.set_xticks(year_ticks) ax2.set_xticklabels([f"{t/4:.0f}y" for t in year_ticks]) ax2.set_xlabel("Maturity (years)") @@ -626,12 +704,16 @@ plt.show() When the short rate is low, the yield curve is upward-sloping, while when the short rate is high, it is downward-sloping. -All three curves converge to the same long-run yield $y_\infty$ at long -maturities, and the long-run yield lies above the mean short rate -$\delta_0$. +All three curves approach the same long-run yield $y_\infty$, which lies above the mean short rate $\delta_0$. + +The approach is slow. + +Because $\bar B_n$ converges to a finite limit, the state enters $y_t(n)$ through $\bar B_n^\top z_t / n$, so gaps between curves shrink only at rate $1/n$. + +That is why we plot maturities out to 50 years: at 15 years the three curves are still spread between about 3.5% and 5.0%, while at 50 years they lie between about 4.1% and 4.6%. ````{exercise} -:label: arp_ex4 +:label: arp_ex5 Show that the long-run yield satisfies @@ -650,11 +732,12 @@ is the fixed point of the recursion {eq}`eq_riccati_b`. Then explain why $y_\infty > \delta_0$ under this parameterization. *Hint:* Use {eq}`eq_yield` and the Riccati equations -{eq}`eq_riccati_a`--{eq}`eq_riccati_b`. For the inequality, consider -each subtracted term separately. +{eq}`eq_riccati_a`--{eq}`eq_riccati_b`. + +For the inequality, consider each subtracted term separately. ```` -```{solution-start} arp_ex4 +```{solution-start} arp_ex5 :class: dropdown ``` @@ -677,7 +760,9 @@ The quadratic term $\tfrac{1}{2}\bar B_\infty^\top CC^\top \bar B_\infty = \tfra This is a **convexity effect** from Jensen's inequality that pushes $y_\infty$ below $\delta_0$. -The linear term $\bar B_\infty^\top(\mu - C\lambda_0)$ is negative because $\bar B_\infty < 0$ (since $\delta_1 > 0$) while $\mu - C\lambda_0 > 0$ (since $\lambda_0 < 0$). Subtracting this negative quantity raises $y_\infty$ above $\delta_0$. +The linear term $\bar B_\infty^\top(\mu - C\lambda_0)$ is negative because $\bar B_\infty < 0$ (since $\delta_1 > 0$) while $\mu - C\lambda_0 > 0$ (since $\lambda_0 < 0$). + +Subtracting this negative quantity raises $y_\infty$ above $\delta_0$. This is a **risk-premium effect**: positive term premiums tilt the average yield curve upward. @@ -717,6 +802,21 @@ plt.tight_layout() plt.show() ``` +Because $r_t$ is an affine function of a Gaussian state, a Gaussian affine model assigns positive probability to negative short rates. + +Under the stationary distribution of the one-factor model, $r_t$ is normal with mean $\delta_0$ and standard deviation $\delta_1 \sigma_z$, which lets us compute that probability. + +```{code-cell} ipython3 +σ_z = model_1f.C[0, 0] / np.sqrt(1 - model_1f.φ[0, 0]**2) +σ_r = model_1f.δ_1[0] * σ_z +print(f"Stationary std of r_t: {σ_r * 4 * 100:.2f}% p.a.") +print(f"P(r_t < 0): {norm.cdf(-model_1f.δ_0 / σ_r):.2e}") +``` + +The probability is small in this calibration, but it can be substantial in calibrations fit to periods of low interest rates. + +Square-root models such as {cite:t}`CIR1985` and shadow-rate models such as {cite:t}`Black1995` are two ways of keeping nominal rates non-negative, at the cost of some of the tractability that the Gaussian specification delivers. + ### A two-factor model To match richer yield-curve dynamics, practitioners routinely use $m \geq 2$ @@ -834,7 +934,17 @@ plt.tight_layout() plt.show() ``` -We can see that the level factor dominates at long maturities. +The right panel shows how yields at different maturities respond to the two factors. + +The level loading $B_{n,1}$ declines gradually with maturity, from $0.002$ at one quarter to about half that at 15 years, so the persistent factor moves yields at all maturities. + +The slope loading $B_{n,2}$ starts at $0.001$, decays quickly, and turns slightly negative beyond about 30 quarters. + +The sign change reflects the off-diagonal entry $\phi_{12} = -0.03$: a high $z_{2t}$ raises the short rate today but pushes the level factor, and hence future short rates, down. + +As a result, the level factor dominates yields at long maturities, while the slope factor matters mainly at the short end. + +As in the one-factor case, the curves in the left panel are still approaching their common long-run yield at 60 quarters. ## Risk premiums @@ -851,6 +961,16 @@ $$ The term premium equals the inner product of the bond's shock exposure $\bar B_n^\top C$ with the risk price vector $\lambda_t$. +This formula measures the premium as the log of an expected gross return. + +The expected log excess return is smaller by a Jensen's inequality term: + +$$ +\mathbb{E}_t \log R_{t+1}^{(n+1)} - r_t = \bar B_n^\top C \lambda_t - \tfrac{1}{2}\bar B_n^\top CC^\top \bar B_n +$$ + +Only the first term depends on the state, so the two measures differ by a maturity-specific constant that does not affect how term premiums vary over time. + Because the term premium equals $\bar B_n^\top C \lambda_t$, its sign depends on the *current* risk-price vector $\lambda_t$, which is state-dependent whenever $\lambda_z \neq 0$. @@ -872,13 +992,14 @@ are risky and carry a positive term premium. Algebraically, $\bar B_n < 0$ and $C\lambda_t < 0$ combine to give $\bar B_n^\top C \lambda_t > 0$. -In other states, however, $\lambda_t$ may change sign (e.g. the -first component flips in the low-rate regime of our two-state -calibration), and long-bond term premiums can become negative at -longer maturities. +In other states, however, components of $\lambda_t$ can change sign. + +With $\lambda_z < 0$, a low value of the level factor $z_{1t}$ pushes the first component of $\lambda_t$ above zero. + +Since long bonds load mainly on the level shock, their term premiums then turn negative. ```{exercise} -:label: arp_ex5 +:label: arp_ex6 Derive the term premium formula above by computing the one-period holding return on an $(n+1)$-period bond and identifying its shock loading. @@ -889,7 +1010,7 @@ dynamics {eq}`eq_var`, and apply the Riccati equations {eq}`eq_riccati_a`--{eq}`eq_riccati_b` to simplify. ``` -```{solution-start} arp_ex5 +```{solution-start} arp_ex6 :class: dropdown ``` @@ -963,7 +1084,12 @@ mystnb: name: fig-term-premiums-2f --- def term_premiums(model, z, n_max): - """Compute term premiums for maturities 1 to n_max.""" + """ + Compute one-period term premiums on bonds of maturity 1, ..., n_max. + + An n-period bond held for one period becomes an (n-1)-period bond, + so its premium is B_bar_{n-1}^⊤ C λ_t (and zero for n = 1). + """ A_bar, B_bar = bond_coefficients(model, n_max + 1) λ_t = risk_prices(model, z) return np.array([B_bar[n-1] @ model.C @ λ_t @@ -1026,7 +1152,105 @@ plt.tight_layout() plt.show() ``` -We see that the term premium is positive at all maturities in the low-rate state, but becomes negative at longer maturities in the high-rate state. +The left panel shows that the sign of the term premium depends on the state. + +In the high-rate state, $\lambda_t \approx (-0.025, 0.001)$, and the term premium is positive and rises with maturity, reaching about 0.6% per year at 15 years. + +In the low-rate state, the first component of $\lambda_t$ has turned positive, $\lambda_t \approx (0.005, -0.011)$, and the term premium is negative at every maturity, falling to about $-0.15$% per year at 15 years. + +Investors in the low-rate state accept a lower expected return on long bonds than on rolling over short bonds because long bonds pay off well in the states that they value most. + +The right panel decomposes the term premium at $z_t = 0$, where both components of $\lambda_t$ are negative. + +The level factor accounts for almost all of the premium at long maturities. + +The slope contribution is small and turns negative beyond about 30 quarters, mirroring the sign change in the slope loading shown earlier. + +```{exercise} +:label: arp_ex7 + +The expectations hypothesis says that expected excess returns on long bonds are constant over time, so that they cannot be forecast by the yield spread. + +1. Simulate the two-factor model `model_2f` for $T = 200{,}000$ quarters. + Regress the one-quarter excess holding return on a 20-quarter bond, + $\log p_{t+1}(19) - \log p_t(20) - r_t$, on a constant and the spread $y_t(20) - r_t$. +2. Compute the population regression slope implied by the model, using $\bar B_n$ and the stationary covariance matrix $\Sigma_z$ of $z_t$, and compare it with your estimate. +3. Repeat both steps with $\lambda_z = 0$ and explain the result. +4. In U.S. data, {cite:t}`FamaBliss1987` and {cite:t}`CampbellShiller1991` find that high spreads forecast *high* excess returns on long bonds. + Does `model_2f` reproduce this pattern? What happens if you flip the sign of $\lambda_z$? +``` + +```{solution-start} arp_ex7 +:class: dropdown +``` + +From {eq}`eq_excess` and the term-premium formula, the log excess holding return on a 20-quarter bond is + +$$ +x_{t+1} = \bar B_{19}^\top C \lambda_t - \tfrac{1}{2}\bar B_{19}^\top CC^\top \bar B_{19} + \bar B_{19}^\top C \varepsilon_{t+1} +$$ + +Its conditional mean is a constant plus $a^\top z_t$ with $a = \lambda_z^\top C^\top \bar B_{19}$. + +The spread is $s_t = y_t(20) - r_t = \text{constant} + b^\top z_t$ with $b = -\bar B_{20}/20 - \delta_1$. + +Because $\varepsilon_{t+1}$ is orthogonal to $z_t$, the population slope is + +$$ +\beta = \frac{a^\top \Sigma_z b}{b^\top \Sigma_z b} +$$ + +where $\Sigma_z$ solves $\Sigma_z = \phi \Sigma_z \phi^\top + CC^\top$. + +```{code-cell} ipython3 +def eh_regression(model, n=20, T=200_000, seed=1): + """OLS and population slopes of excess returns on the yield spread.""" + A_bar, B_bar = bond_coefficients(model, n) + z_bar = np.linalg.solve(np.eye(model.m) - model.φ, model.μ) + Z = simulate(model, z_bar, T, rng=np.random.default_rng(seed)) + + r = model.δ_0 + Z[:-1] @ model.δ_1 + log_p = lambda k, z: A_bar[k] + z @ B_bar[k] + excess = log_p(n - 1, Z[1:]) - log_p(n, Z[:-1]) - r + spread = -log_p(n, Z[:-1]) / n - r + + X = np.column_stack([np.ones(T), spread]) + coef = np.linalg.lstsq(X, excess, rcond=None)[0] + resid = excess - X @ coef + se = np.sqrt(resid.var() / (T * spread.var())) + + Σ_z = solve_discrete_lyapunov(model.φ, model.C @ model.C.T) + a = model.λ_z.T @ model.C.T @ B_bar[n - 1] + b = -B_bar[n] / n - model.δ_1 + β_pop = (a @ Σ_z @ b) / (b @ Σ_z @ b) + return coef[1], se, β_pop + +cases = { + "λ_z as calibrated": λ_z_2, + "λ_z = 0": np.zeros((2, 2)), + "λ_z sign flipped": -λ_z_2, +} +print(f"{'case':>20} {'OLS slope':>10} {'s.e.':>7} {'population':>10}") +for label, lz in cases.items(): + mod = create_affine_model(μ_2, φ_2, C_2, δ_0_2, δ_1_2, λ_0_2, lz) + b_ols, se, b_pop = eh_regression(mod) + print(f"{label:>20} {b_ols:>10.4f} {se:>7.4f} {b_pop:>10.4f}") +``` + +With the calibrated $\lambda_z$, the OLS slope is close to the population slope of about $-0.17$ and is many standard errors from zero, so the expectations hypothesis fails in simulated data. + +With $\lambda_z = 0$, the vector $a$ is zero, so expected excess returns are constant and the population slope is exactly zero. + +The OLS estimate is then within sampling error of zero. + +The expectations hypothesis holds in an affine model exactly when risk prices do not vary with the state. + +The calibrated model gets the *sign* of the Fama–Bliss and Campbell–Shiller finding wrong: a high spread forecasts a low excess return. + +Flipping the sign of $\lambda_z$ reverses the sign of the slope, which shows that the regression evidence is informative about $\lambda_z$ and not just about the size of average term premiums. + +```{solution-end} +``` ## Risk-neutral probabilities @@ -1065,7 +1289,17 @@ This is a log-normal random variable with mean 1, so it is a valid likelihood ratio that can be used to twist the conditional distribution of $z_{t+1}$. -Multiplying the physical conditional distribution by this likelihood ratio +To see what the twist does to the shocks, multiply the standard normal density of $\varepsilon_{t+1}$ by {eq}`eq_rn_ratio`: + +$$ +(2\pi)^{-m/2}\exp\!\left(-\tfrac{1}{2}\varepsilon^\top\varepsilon\right) +\exp\!\left(-\tfrac{1}{2}\lambda_t^\top\lambda_t - \lambda_t^\top\varepsilon\right) += (2\pi)^{-m/2}\exp\!\left(-\tfrac{1}{2}(\varepsilon + \lambda_t)^\top(\varepsilon + \lambda_t)\right) +$$ + +So under $Q$ the shock is $\varepsilon_{t+1} \sim \mathcal{N}(-\lambda_t, I)$: the twist shifts its mean by $-\lambda_t$ and leaves its covariance matrix unchanged. + +Substituting $\varepsilon_{t+1} = -\lambda_t + \varepsilon^Q_{t+1}$ into {eq}`eq_var` shows that multiplying the physical conditional distribution by this likelihood ratio transforms it into the **risk-neutral conditional distribution** $$ @@ -1090,6 +1324,87 @@ The adjustments $-C\lambda_0$ (constant) and $-C\lambda_z$ $\mathbb{E}^P_t m_{t+1} R_{j,t+1} = 1$ adjusts expected returns for exposure to the risks $\varepsilon_{t+1}$. +```{exercise} +:label: arp_ex8 + +How different are the risk-neutral and physical measures? + +A natural measure is relative entropy (Kullback–Leibler divergence), discussed in {doc}`divergence_measures`. + +1. Show that the conditional relative entropy of $Q$ with respect to $P$, $\mathbb{E}^Q_t\left[\log(\xi^Q_{t+1}/\xi^Q_t)\right]$, and the conditional relative entropy of $P$ with respect to $Q$, $\mathbb{E}^P_t\left[-\log(\xi^Q_{t+1}/\xi^Q_t)\right]$, both equal $\tfrac{1}{2}\lambda_t^\top\lambda_t$. +2. Suppose that $z_0$ is drawn from the stationary distribution of $z_t$ under $P$. Show that the relative entropy of $P$ with respect to $Q$ for a sample $z_1, \ldots, z_T$ equals $T$ times + $$ + \tfrac{1}{2}\left(\bar\lambda^\top\bar\lambda + \operatorname{tr}(\lambda_z \Sigma_z \lambda_z^\top)\right) + $$ + where $\bar z = (I - \phi)^{-1}\mu$, $\bar\lambda = \lambda_0 + \lambda_z \bar z$, and $\Sigma_z$ solves $\Sigma_z = \phi\Sigma_z\phi^\top + CC^\top$. +3. Evaluate this formula for `model_2f`, verify it by simulation, and use Pinsker's inequality to bound how well any test based on 100 years of quarterly data on $z_t$ could distinguish $P$ from $Q$. +``` + +```{solution-start} arp_ex8 +:class: dropdown +``` + +*Part 1.* We showed above that $\varepsilon_{t+1} \sim \mathcal{N}(-\lambda_t, I)$ under $Q$, while $\varepsilon_{t+1} \sim \mathcal{N}(0, I)$ under $P$. + +Hence + +$$ +\mathbb{E}^Q_t\left[-\tfrac{1}{2}\lambda_t^\top\lambda_t - \lambda_t^\top\varepsilon_{t+1}\right] += -\tfrac{1}{2}\lambda_t^\top\lambda_t + \lambda_t^\top\lambda_t += \tfrac{1}{2}\lambda_t^\top\lambda_t +$$ + +and + +$$ +\mathbb{E}^P_t\left[\tfrac{1}{2}\lambda_t^\top\lambda_t + \lambda_t^\top\varepsilon_{t+1}\right] += \tfrac{1}{2}\lambda_t^\top\lambda_t +$$ + +The two divergences coincide because the two conditional distributions are normal with the same covariance matrix. + +*Part 2.* When $C$ is invertible, the path $z_1, \ldots, z_T$ and the shocks $\varepsilon_1, \ldots, \varepsilon_T$ determine each other given $z_0$. + +The log likelihood ratio of the path is therefore the sum of the one-period log likelihood ratios, and by the law of iterated expectations its expectation under $P$ is $\sum_{t=0}^{T-1} \mathbb{E}^P\left[\tfrac{1}{2}\lambda_t^\top\lambda_t\right]$. + +Under the stationary distribution, $\lambda_t = \bar\lambda + \lambda_z(z_t - \bar z)$ with $\mathbb{E}(z_t - \bar z) = 0$ and $\text{Var}(z_t) = \Sigma_z$. + +Therefore $\mathbb{E}(\lambda_t^\top\lambda_t) = \bar\lambda^\top\bar\lambda + \operatorname{tr}(\lambda_z\Sigma_z\lambda_z^\top)$ for every $t$, which gives the formula. + +*Part 3.* Pinsker's inequality says that the total variation distance between two distributions is at most $\sqrt{D/2}$, where $D$ is their relative entropy. + +With equal prior probabilities on $P$ and $Q$, the smallest achievable probability of choosing the wrong model is $(1 - \text{TV})/2$, so it is at least $(1 - \sqrt{D/2})/2$. + +```{code-cell} ipython3 +z_bar_2 = np.linalg.solve(np.eye(2) - model_2f.φ, model_2f.μ) +Σ_z_2 = solve_discrete_lyapunov(model_2f.φ, model_2f.C @ model_2f.C.T) +λ_bar_2 = risk_prices(model_2f, z_bar_2) +entropy = 0.5 * (λ_bar_2 @ λ_bar_2 + + np.trace(model_2f.λ_z @ Σ_z_2 @ model_2f.λ_z.T)) + +Z_sim = simulate(model_2f, z_bar_2, 200_000, rng=np.random.default_rng(7)) +Λ_sim = model_2f.λ_0 + Z_sim @ model_2f.λ_z.T +entropy_sim = 0.5 * np.mean(np.sum(Λ_sim**2, axis=1)) + +T_years = 100 +D = 4 * T_years * entropy +print(f"relative entropy per quarter (formula): {entropy:.6f}") +print(f"relative entropy per quarter (simulation): {entropy_sim:.6f}") +print(f"relative entropy over {T_years} years: {D:.4f}") +print(f"lower bound on error probability: {(1 - np.sqrt(D / 2)) / 2:.3f}") +``` + +Even with a century of quarterly data, no test can push the average probability of choosing the wrong model below about 37%. + +Yet the gap between these two hard-to-distinguish measures is exactly what generates the term premiums plotted above. + +Time-series data on the state alone therefore say little about risk prices, which is why estimates of $\lambda_0$ and $\lambda_z$ rely heavily on the cross-section of bond yields. + +This echoes the detection-error calculations of {doc}`advanced:doubts_or_variability`, where plausible amounts of model uncertainty are calibrated in the same way. + +```{solution-end} +``` + ### Asset pricing in a nutshell Let $\mathbb{E}^P$ denote an expectation under the physical measure that @@ -1133,7 +1448,7 @@ Below we confirm this numerically ```{code-cell} ipython3 def bond_price_mc_Q(model, z0, n, n_sims=50_000, rng=None): - """Estimate p_t(n) by Monte Carlo under Q.""" + """Estimate p_t(n) by Monte Carlo under Q; return estimate and std. error.""" if rng is None: rng = np.random.default_rng(0) m = len(z0) @@ -1143,28 +1458,34 @@ def bond_price_mc_Q(model, z0, n, n_sims=50_000, rng=None): disc += model.δ_0 + Z @ model.δ_1 ε = rng.standard_normal((n_sims, m)) Z = model.μ_rn + Z @ model.φ_rn.T + ε @ model.C.T - return np.mean(np.exp(-disc)) + payoffs = np.exp(-disc) + return payoffs.mean(), payoffs.std() / np.sqrt(n_sims) z_test = np.array([0.01, 0.005]) p_analytic = bond_prices(model_2f, z_test, 40) rng = np.random.default_rng(0) maturities_check = [4, 12, 24, 40] -mc_prices = [bond_price_mc_Q(model_2f, z_test, n, n_sims=100_000, rng=rng) - for n in maturities_check] +mc_results = [bond_price_mc_Q(model_2f, z_test, n, n_sims=100_000, rng=rng) + for n in maturities_check] -header = (f"{'Maturity':>10} {'Analytic':>12}" - f" {'Monte Carlo':>12} {'Error (bps)':>12}") +header = (f"{'Maturity':>10} {'Analytic':>10} {'Monte Carlo':>11}" + f" {'Error (bps)':>11} {'s.e. (bps)':>10} {'z-score':>8}") print(header) -print("-" * 52) -for n, mc in zip(maturities_check, mc_prices): +print("-" * len(header)) +for n, (mc, se) in zip(maturities_check, mc_results): analytic = p_analytic[n - 1] - error_bp = abs(analytic - mc) / analytic * 10_000 - print(f"{n:>10} {analytic:>12.6f} {mc:>12.6f} {error_bp:>12.2f}") + error_bp = (mc - analytic) / analytic * 10_000 + se_bp = se / analytic * 10_000 + print(f"{n:>10} {analytic:>10.6f} {mc:>11.6f}" + f" {error_bp:>11.2f} {se_bp:>10.2f} {error_bp / se_bp:>8.2f}") ``` -The analytical and Monte Carlo bond prices agree closely, validating the -Riccati recursion {eq}`eq_riccati_a`–{eq}`eq_riccati_b`. +The table reports each Monte Carlo error alongside its standard error, both in basis points of the analytical price. + +All the z-scores are within $\pm 2$, so the differences between analytical and simulated prices are consistent with pure simulation noise. + +This validates the Riccati recursion {eq}`eq_riccati_a`–{eq}`eq_riccati_b`. ## Distorted beliefs @@ -1230,25 +1551,38 @@ $$ where $\mathbb{E}^S_t$ is the conditional expectation under the subjective $S$ measure and $m^\star_{t+1}$ is the SDF of an agent with these beliefs. -In particular, the agent's SDF is +To express the agent's SDF, define the **subjective shocks** + +$$ +\varepsilon^S_{t+1} = \varepsilon_{t+1} + \kappa_t +$$ + +By the same argument we used for the risk-neutral measure, $\varepsilon^S_{t+1} \sim \mathcal{N}(0, I)$ under $S$, and the state evolves as + +$$ +z_{t+1} = (\mu - C\kappa_0) + (\phi - C\kappa_z) z_t + C\varepsilon^S_{t+1} +$$ + +The agent's SDF is exponential quadratic in these subjective shocks: $$ -m^\star_{t+1} = \exp\!\left(-r^\star_t +m^\star_{t+1} = \exp\!\left(-r_t - \tfrac{1}{2}\lambda_t^{\star\top}\lambda^\star_t - - \lambda_t^{\star\top}\varepsilon_{t+1}\right) + - \lambda_t^{\star\top}\varepsilon^S_{t+1}\right) $$ -where $r^\star_t$ is the short rate and $\lambda^\star_t$ is the agent's -vector of risk prices. +where $\lambda^\star_t = \lambda^\star_0 + \lambda^\star_z z_t$ is the agent's vector of risk prices. + +Because $\mathbb{E}^S_t m^\star_{t+1} = \exp(-r_t)$, the short rate in this SDF is the market short rate $r_t$ that we observe. Using {eq}`eq_srat` to convert to the physical measure, the subjective pricing equation becomes $$ \mathbb{E}^P_t\!\left[ - \exp\!\left(-r^\star_t + \exp\!\left(-r_t - \tfrac{1}{2}\lambda_t^{\star\top}\lambda^\star_t - - \lambda_t^{\star\top}\varepsilon_{t+1} + - \lambda_t^{\star\top}(\varepsilon_{t+1} + \kappa_t) \right) \exp\!\left( - \tfrac{1}{2}\kappa_t^\top\kappa_t @@ -1258,7 +1592,8 @@ $$ \right] = 1 $$ -Combining the two exponentials gives +The constant terms in the combined exponent are +$-r_t - \tfrac{1}{2}\lambda_t^{\star\top}\lambda^\star_t - \lambda_t^{\star\top}\kappa_t - \tfrac{1}{2}\kappa_t^\top\kappa_t = -r_t - \tfrac{1}{2}(\lambda^\star_t + \kappa_t)^\top(\lambda^\star_t + \kappa_t)$, so the two exponentials combine exactly into $$ \mathbb{E}^P_t\!\left[ @@ -1269,8 +1604,6 @@ $$ \right] = 1 $$ -where $r_t = r^\star_t - \lambda_t^{\star\top}\kappa_t$. - Comparing this with the rational-expectations econometrician's pricing equation @@ -1284,20 +1617,47 @@ $$ $$ we see that what the econometrician interprets as $\lambda_t$ is actually -$\lambda^\star_t + \kappa_t$. -Because the econometrician's estimates partly reflect systematic -distortions in subjective beliefs, they can overstate the representative -agent's true risk prices $\lambda^\star_t$ in this calibration. +$$ +\hat\lambda_t = \lambda^\star_t + \kappa_t +$$ + +### What bond prices can and cannot reveal + +The decomposition has a simple interpretation in terms of the risk-neutral measure. + +Starting from the physical measure, the econometrician reaches $Q$ by twisting with $\hat\lambda_t$: + +$$ +\mu - C\hat\lambda_0 = (\mu - C\kappa_0) - C\lambda^\star_0, +\qquad +\phi - C\hat\lambda_z = (\phi - C\kappa_z) - C\lambda^\star_z +$$ + +The right sides show that the agent reaches the *same* $Q$ by twisting the subjective measure with $\lambda^\star_t$. -Below we construct a numerical example to illustrate this point. +Since bond prices depend only on $Q$, the econometrician and the agent agree about every bond price. -We keep the same physical state dynamics and short-rate specification as above, but choose a separate true risk-price process $(\lambda_t^\star)$ and a distorted-belief econometrician process $(\hat\lambda_t)$ to illustrate the decomposition. +They disagree about expected returns. -We then set the subjective parameters $\check\mu, \check\phi$ to match the evidence in +The term premium measured by the econometrician is $\bar B_n^\top C\hat\lambda_t$, while the premium that the agent expects is $\bar B_n^\top C\lambda^\star_t$. + +The difference, $\bar B_n^\top C\kappa_t$, is the part of measured excess returns that the agent does not expect and that therefore shows up as predictable forecast errors. + +Bond prices and data on $z_t$ identify $\hat\lambda_t$, but they cannot split it into $\lambda^\star_t$ and $\kappa_t$. + +Splitting it requires direct evidence on beliefs, such as the survey forecasts used by {cite:t}`piazzesi2015trend`. + +The same identification problem is central to {doc}`ross_recovery` and {doc}`misspecified_recovery`, which ask when risk-neutral prices alone can reveal subjective beliefs. + +### A numerical illustration + +We keep the same physical state dynamics and short-rate specification as above, choose the agent's risk prices $\lambda^\star_t$, and deduce the econometrician's risk prices $\hat\lambda_t = \lambda^\star_t + \kappa_t$. + +We set the subjective parameters $\check\mu, \check\phi$ to match the evidence in {cite:t}`piazzesi2015trend` that experts behave as if the level and slope of the yield curve are more persistent than under the physical measure. -In particular, we use +In particular, we use $$ \check\phi = \begin{pmatrix} 0.985 & -0.025 \\ 0.00 & 0.94 \end{pmatrix} @@ -1311,43 +1671,63 @@ $$ φ_S = np.array([[0.985, -0.025], [0.00, 0.94]]) μ_S = np.array([0.005, 0.0]) +# κ_t = κ_0 + κ_z z_t twists P into S κ_z = np.linalg.solve(C_2, φ_P - φ_S) κ_0 = np.linalg.solve(C_2, μ_P - μ_S) +# Agent's risk prices, which price subjective shocks ε^S λ_star_0 = np.array([-0.03, -0.015]) λ_star_z = np.array([[-0.006, 0.0], [0.0, -0.004]]) +# Econometrician's risk prices, which price physical shocks ε λ_hat_0 = λ_star_0 + κ_0 λ_hat_z = λ_star_z + κ_z ``` +The agent's model pairs the subjective dynamics with $\lambda^\star_t$, and the econometrician's model pairs the physical dynamics with $\hat\lambda_t$. + +We first confirm that the two models imply the same risk-neutral dynamics and hence the same bond prices. + +```{code-cell} ipython3 +# Agent: subjective dynamics, risk prices λ* +model_subj = create_affine_model( + μ_S, φ_S, C_2, δ_0_2, δ_1_2, λ_star_0, λ_star_z) +# Econometrician: physical dynamics, risk prices λ̂ = λ* + κ +model_econ = create_affine_model( + μ_P, φ_P, C_2, δ_0_2, δ_1_2, λ_hat_0, λ_hat_z) + +print("Same risk-neutral dynamics:", + np.allclose(model_subj.φ_rn, model_econ.φ_rn) + and np.allclose(model_subj.μ_rn, model_econ.μ_rn)) +print("Same yields at z = (1, -1):", + np.allclose(compute_yields(model_subj, np.array([1.0, -1.0]), 60), + compute_yields(model_econ, np.array([1.0, -1.0]), 60))) +``` + +Now we compare the term premium the agent expects with the term premium the econometrician measures. + ```{code-cell} ipython3 --- mystnb: figure: - caption: True vs. distorted-belief term premiums and overstatement ratio + caption: Subjective vs. measured term premiums and overstatement ratio name: fig-distorted-beliefs --- -model_true = create_affine_model( - μ_2, φ_2, C_2, δ_0_2, δ_1_2, λ_star_0, λ_star_z) -model_econ = create_affine_model( - μ_2, φ_2, C_2, δ_0_2, δ_1_2, λ_hat_0, λ_hat_z) - z_ref = np.array([0.0, 0.0]) n_max_db = 60 maturities_db = np.arange(1, n_max_db + 1) -tp_true = term_premiums(model_true, z_ref, n_max_db) * 4 * 100 +tp_subj = term_premiums(model_subj, z_ref, n_max_db) * 4 * 100 tp_econ = term_premiums(model_econ, z_ref, n_max_db) * 4 * 100 fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 5.5)) -ax1.plot(maturities_db, tp_true, lw=2.2, - label=r"True risk prices $\lambda^\star_t$") +ax1.plot(maturities_db, tp_subj, lw=2.2, + label=r"Agent's expected premium, $\lambda^\star_t$") line_econ, = ax1.plot(maturities_db, tp_econ, lw=2.2, ls="--", - label=(r"RE econometrician" + label=(r"Measured by RE econometrician," r" $\hat\lambda_t = \lambda^\star_t + \kappa_t$")) -ax1.fill_between(maturities_db, tp_true, tp_econ, +ax1.fill_between(maturities_db, tp_subj, tp_econ, alpha=0.15, color=line_econ.get_color(), label="Belief distortion component") ax1.axhline(0, color="black", lw=0.8, ls=":") @@ -1356,9 +1736,9 @@ ax1.set_ylabel("Term premium (% p.a.)") ax1.legend(fontsize=9.5) ax1.set_xlim(1, n_max_db) -mask = np.abs(tp_true) > 1e-8 -ratio = np.full_like(tp_true, np.nan) -ratio[mask] = tp_econ[mask] / tp_true[mask] +mask = np.abs(tp_subj) > 1e-8 +ratio = np.full_like(tp_subj, np.nan) +ratio[mask] = tp_econ[mask] / tp_subj[mask] ax2.plot(maturities_db[mask], ratio[mask], lw=2.2) ax2.axhline(1, color="black", lw=0.8, ls="--", @@ -1377,15 +1757,35 @@ for ax in (ax1, ax2): plt.tight_layout() plt.show() + +for n in [4, 20, 40, 60]: + print(f"n = {n:>2}: agent {tp_subj[n-1]:.3f}%, " + f"econometrician {tp_econ[n-1]:.3f}%, " + f"ratio {tp_econ[n-1] / tp_subj[n-1]:.2f}") +``` + +At $z_t = 0$, the distortion is $\kappa_t = \kappa_0 = (-0.005, 0)$, which comes from the experts' upward bias $\check\mu_1 = 0.005$ in forecasting the level factor. + +Experts who expect higher future interest rates expect lower returns on long bonds than the returns that actually materialize on average. + +The econometrician therefore overstates the term premium that the agent requires, by 14 to 18 percent in this calibration. + +The persistence distortion $\kappa_z$ makes the size and even the sign of the gap depend on the state. + +```{code-cell} ipython3 +for label, z in [("High rate", np.array([3.0, -2.0])), + ("Low rate", np.array([-3.0, 2.0]))]: + gap = (term_premiums(model_econ, z, n_max_db) + - term_premiums(model_subj, z, n_max_db)) * 4 * 100 + print(f"{label}: belief-distortion gap at 5 and 15 years = " + f"{gap[19]:.2f}%, {gap[59]:.2f}%") ``` -When expert beliefs are overly persistent ($\check\phi$ has larger eigenvalues -than $\phi$), the rational-expectations econometrician attributes too much of -the observed risk premium to risk aversion. +When rates are high, experts extrapolate them too far into the future, so the econometrician's measured premium exceeds the agent's premium by almost 2 percentage points at 15 years. + +When rates are low, the gap reverses sign. -Disentangling belief distortions from genuine risk prices requires additional -data, for example, the survey forecasts used by -{cite:t}`piazzesi2015trend`. +A rational-expectations econometrician therefore attributes to time-varying risk prices movements in measured excess returns that actually come from the agent's systematic forecast errors. Our {doc}`advanced:risk_aversion_or_mistaken_beliefs` lecture explores this confounding in greater depth. @@ -1407,6 +1807,7 @@ Key features are: 4. **Belief distortions:** The framework naturally accommodates non-rational beliefs via likelihood-ratio twists of the physical measure, as in {cite:t}`piazzesi2015trend`. +5. **Limits to identification:** Bond prices reveal only the risk-neutral measure, so separating risk prices from belief distortions requires additional evidence, such as survey forecasts; see also {doc}`ross_recovery` and {doc}`misspecified_recovery`. The model also connects directly to the Hansen–Jagannathan bounds studied in {doc}`advanced:doubts_or_variability` and to robust From 7eaa979f34a1e4e03c162856e92514d633ae5bff Mon Sep 17 00:00:00 2001 From: thomassargent30 Date: Thu, 17 Sep 2026 16:30:14 -0400 Subject: [PATCH 3/3] [recovery trio] Correct math and code, improve flow, add cross-references Review of ross_recovery, long_run_risk_operator and misspecified_recovery for mathematical correctness, coherence and cross-lecture consistency. ross_recovery: - Make the Perron eigenvector positivity test scale invariant; the old test was applied to scipy's unit-norm vector and failed spuriously from gamma = 12, close to the gamma = 10 used in the exercises - Plot the relative pricing kernel on a log axis; it spans a factor of 9e6, which made most curves invisible - Note that the large-gamma cases imply riskless rates of -18% and -78%, and that the middle-state rate matching rho is a knife-edge coincidence - Attribute bounded continuous-state recovery to Carr and Yu rather than to misspecified_recovery, correct s_i to log(S_i/S_0), state the E[R*] = R_f assumption, and fix the Mehra-Prescott attribution long_run_risk_operator: - Correct the Feller nonattainment condition to 2 xi_f xbar_f >= sigma_f^2; the growth twist rescales the mean-reversion speed and the long-run mean but leaves their product invariant - Say log jump multiplier where the code means log, and fix a Summary step that equated an operator with a multiplicative functional - Replace a misleading reference line in the jump eigenvalue figure - Deliver the promise that the two frontiers can differ, by computing them under stochastic volatility, and rewrite an exercise that duplicated a worked example in the body misspecified_recovery: - Rewrite the permanent shocks section, which did not demonstrate its claim: with a shock independent of the Markov state, recovery over that state is exact, and the martingale component is nondegenerate only on the filtration that reveals the shock. Adds a numerical check - Select the eigenfunction by the lecture's own ergodicity assumption rather than by smallest eigenvalue exponent - Add the consumption SDE and the centered-drift convention, and correct a comment about what the martingale component changes Across the three: add cross-references to long_run_risk_operator from both companions, with notes recording the symbol correspondence, plus grammar, heading case and whitespace fixes. Co-Authored-By: Claude Opus 5 (1M context) --- lectures/long_run_risk_operator.md | 386 +++++++++++++++++++++-------- lectures/misspecified_recovery.md | 317 ++++++++++++++++------- lectures/ross_recovery.md | 126 +++++++--- 3 files changed, 599 insertions(+), 230 deletions(-) diff --git a/lectures/long_run_risk_operator.md b/lectures/long_run_risk_operator.md index 079a5dbfd..be3a53ef6 100644 --- a/lectures/long_run_risk_operator.md +++ b/lectures/long_run_risk_operator.md @@ -31,7 +31,7 @@ kernelspec: Standard short-horizon asset pricing tells us how equilibrium prices compensate investors for tiny, instantaneous exposures to shocks. -That is, they tell us about the *short end* of the term +That is, they tell us about the *short end* of the term structure of risk prices. But many of the most interesting asset pricing questions (e.g., the equity @@ -41,15 +41,15 @@ options) concern the *long end* of the term structure of risk prices. This lecture studies the long end using the operator approach of {cite:t}`HansenScheinkman2009`. -At center stage will be a stochastic discount factor process and a return process that are +At center stage will be a stochastic discount factor process and a return process that are multiplicative across time in the sense that conditional expectations define a *semigroup* of valuation operators indexed by horizon $t$. -Long-horizon behaviour of the semigroup is controlled by a single eigenvalue +Long-horizon behavior of the semigroup is controlled by a single eigenvalue problem on the state space. By solving that eigenvalue problem and selecting an appropriate eigenfunction, we can factor the -multiplicative functional $M_t$ into three economically meaningful +multiplicative functional $M_t$ into three economically meaningful pieces: a deterministic exponential trend, a non-negative martingale that changes probability measure, and a transient state-dependent component. @@ -80,7 +80,7 @@ We will refer to {eq}`eq:hs-factorization` as the **multiplicative factorization** associated with $(\rho,\phi,\hat M)$. {cite:t}`AlvarezJermann2005` applied a related permanent-transitory -decomposition to stochastic discount factors. +decomposition to stochastic discount factors. The operator approach links that decomposition to an explicit eigenvalue problem. @@ -104,7 +104,7 @@ The plan of this lecture is to: stochastic growth) and the valuation semigroups they generate. 2. Introduce the **generator** of a semigroup, a local operator whose - eigenvalue problem controls long-run behaviour. + eigenvalue problem controls long-run behavior. 3. Find the principal eigenfunction $\phi$ and derive the factorization. @@ -118,7 +118,7 @@ The plan of this lecture is to: A recurring theme is that shocks to persistent state variables drive a wedge between local and long-run risk prices. -Generating that wedge is the mechanism through which long-run risk models like {cite:t}`Bansal_Yaron_2004` +Generating that wedge is the mechanism through which long-run risk models like {cite:t}`Bansal_Yaron_2004` generate large equity premia. We start with the following imports @@ -140,7 +140,7 @@ history. We will work with a strong Markov process whose sample paths are càdlàg (defined below). -To arrive at the explicit formulas presented later we will specialize to a semimartingale that +To arrive at the explicit formulas presented later we will specialize to a semimartingale that decomposes into a continuous component $X^c$ and a pure-jump component $X^j$: @@ -176,7 +176,7 @@ We also impose two simplifying assumptions: occur on any bounded interval; this keeps integrals against the jump measure well-defined and finite. * **Sufficient rank in $\Gamma$** so that the Brownian shocks relevant for - pricing can be recovered from the state history; this makes the + pricing can be recovered from the state history; this makes the Markov state $X$ "rich enough" to describe valuation. These assumptions let us write the generator @@ -210,7 +210,7 @@ $$ and the left limit $M_{t-}(\omega) := \lim_{s \uparrow t} M_s(\omega)$ exists and is finite for all $t > 0$. -Thus, paths can jump, but each jump $\Delta M_t := M_t - M_{t-}$ occurs +Thus, paths can jump, but each jump $\Delta M_t := M_t - M_{t-}$ occurs instantaneously. At the jump time $t$, the value is the post-jump value, @@ -245,7 +245,7 @@ $$ (eq:multiplicative) where $\theta_t$ shifts the underlying Markov path forward by $t$ units. ``` -Why is this a useful condition to require? +Why is this a useful condition to require? Think of $M_t = S_t$, a stochastic discount factor. @@ -260,7 +260,7 @@ $$ For the price to depend only on the current Markov state $X_\tau$ (and not on the entire history up to $\tau$), the ratio $S_t/S_\tau$ must be a function -only of the Markov path *after* $\tau$. +only of the Markov path *after* $\tau$. Thus, $S_{\tau+u}/S_\tau = S_u(\theta_\tau)$, which is exactly @@ -392,7 +392,7 @@ Four positive multiplicative functionals will appear often below. | $G$ | stochastic growth in cash flows | $\{\mathbb G_t\}$ | | $Q=GS$ | valuation of growing cash flows | $\{\mathbb Q_t\}$ | -The first three are primitives. +The first three are primitives. The fourth combines discounting and growth to value cash flows that grow stochastically over time. @@ -441,7 +441,7 @@ The **cash-flow valuation semigroup** is the multiplicative semigroup generated by $Q=GS$. ``` -The long-horizon behaviour of $\mathbb Q_t$ is the central object of the +The long-horizon behavior of $\mathbb Q_t$ is the central object of the lecture: it tells us how current prices value cash-flow growth risk that materializes far in the future. @@ -479,7 +479,7 @@ That is the standard instantaneous risk-return relation. This will give us a benchmark against which to compare long-run risk prices. For a textbook discrete-time treatment of the same SDF-based asset-pricing -ideas, see {doc}`advanced:asset_pricing_lph`. +ideas, see {doc}`advanced:asset_pricing_lph`. For an estimation perspective on Euler-equation-based asset pricing, see {doc}`hansen_singleton_1982`. @@ -572,7 +572,7 @@ the same exposure units as $\gamma^v(x)$. Jump risk is priced through the function $\kappa^s$. -This local relation is one end of the term structure of risk prices. +This local relation is one end of the term structure of risk prices. The eigenvalue calculations below describe the other end. @@ -583,7 +583,7 @@ horizon $t$. That is more information than we can use directly. -What we care about is the long-run behaviour: how $\mathbb M_t \psi$ grows as $t \to \infty$. +What we care about is the long-run behavior: how $\mathbb M_t \psi$ grows as $t \to \infty$. The **generator** $\mathbb A$ compresses the entire semigroup into one time-independent operator on the state space. @@ -707,7 +707,7 @@ $$ Without that upgrade we get only the supermartingale inequality $\mathbb M_t \phi \le \exp(\rho t)\, \phi$, which we will revisit below. -So the long-run behaviour of $\mathbb M_t$ is encoded in an eigenvalue +So the long-run behavior of $\mathbb M_t$ is encoded in an eigenvalue problem for the local operator $\mathbb A$, together with the martingale property of $\hat M$. @@ -723,7 +723,7 @@ functions, where the semigroup is a contraction. But the functions we care about most are the principal eigenfunctions $\phi$ solving $\mathbb A\phi = \rho\phi$, and these typically *grow* with the state $X$ (in the affine-Gaussian benchmark, $\phi$ is -exponential-affine in $x$). +exponential-affine in $x$). So they do not lie in this space, and the limit need not converge for them. @@ -746,8 +746,9 @@ Concretely: Fix a Borel function $\psi$, and look for a second Borel function $\chi$ that will play the role of "the instantaneous rate of change of $M_t \psi(X_t)$ -at the current state". We ask whether there exists $\chi$ such -that +at the current state". + +We ask whether there exists $\chi$ such that $$ N_t @@ -897,7 +898,9 @@ denominators throughout: it has to be safe to divide by it. Why does an eigenfunction of $\mathbb A$ give us the multiplicative factorization {eq}`eq:hs-factorization`? -The discrete-time analogy points the way. If $K\phi = \lambda\phi$, then +The discrete-time analogy points the way. + +If $K\phi = \lambda\phi$, then $$ \lambda^{-n}\, M_n\, \frac{\phi(X_n)}{\phi(X_0)} @@ -924,7 +927,7 @@ $$ dZ_t = M_t\, \mathbb A\phi(X_t)\, dt + dN_t , $$ -where $N$ is a local martingale. +where $N$ is a local martingale. The eigenvalue equation $\mathbb A\phi = \rho\phi$ replaces the drift by $\rho Z_t\, dt$, and @@ -959,7 +962,7 @@ $$ $$ ``` -The verification establishes only that $\hat M$ is a *local* martingale, but +The verification establishes only that $\hat M$ is a *local* martingale, but the definition above (and the change-of-measure interpretation of $\hat M$) require it to be a martingale. @@ -999,8 +1002,8 @@ $$ (eq:semigroup-eigen) We now have a factorization {eq}`eq:hs-factorization` for *any* principal eigenfunction. -But for $(\rho,\phi)$ to describe **long-run** behaviour of -$\mathbb M_t$ the twisted +But for $(\rho,\phi)$ to describe **long-run** behavior of +$\mathbb M_t$ the twisted process must settle into a stationary regime as $t \to \infty$. If it doesn't, the transient factor $\phi(X_0)/\phi(X_t)$ will not vanish, @@ -1052,7 +1055,7 @@ $$ Without it, the long-run distribution could depend on the starting state; different basins of attraction would give different -limits. +limits. *Condition 3: every important region is visited infinitely often.* @@ -1160,7 +1163,7 @@ We now apply the framework to a concrete example. We start with the simplest case: a finite-state Markov chain. For background on finite Markov chains in discrete time, see -{doc}`finite_markov`. +{doc}`finite_markov`. For the asset-pricing applications of finite-state chains that motivate the construction here, see {doc}`markov_asset`. @@ -1235,10 +1238,10 @@ $$ \hat A = D_\phi^{-1} A D_\phi - \rho I, $$ -where $D_\phi = \operatorname{diag}(\phi)$. +where $D_\phi = \operatorname{diag}(\phi)$. The row sums of $\hat A$ vanish, -so $\hat A$ is itself a valid intensity matrix. +so $\hat A$ is itself a valid intensity matrix. The stationary distribution $\hat\varsigma$ solves $\hat\varsigma^\top \hat A = 0$. @@ -1312,7 +1315,8 @@ at rate $\lambda_1 = 0.30$). State 2 is a *recession* (lower short rate $r_2=0.02$, switching to boom at rate $\lambda_2 = 0.50$). -For now we set the jump multipliers to zero, so the SDF only changes +For now we set the log jump multipliers $\kappa$ to zero --- equivalently, +the jump multipliers $\exp[\kappa]$ to one --- so the SDF only changes continuously through the in-state decay rates. ```{code-cell} ipython3 @@ -1428,7 +1432,7 @@ and the dashed horizontal lines mark the limits predicted by {eq}`eq:long-run-limit`. Both curves settle onto their predicted limits, confirming that the -long-run behaviour depends on the starting state only through $\phi$. +long-run behavior depends on the starting state only through $\phi$. ```{note} The asymptotic exponential rate of convergence is governed by the gap @@ -1445,7 +1449,7 @@ checked directly. ### Adding jumps State transitions in this chain are discontinuous, so it is natural to allow -the multiplicative functional to jump at the transition times. +the multiplicative functional to jump at the transition times. These jumps are the analogue of the $\kappa$ function in the jump-diffusion @@ -1454,7 +1458,7 @@ parameterization. A natural example arises with a stochastic discount factor that jumps *down* when the economy moves from recession into boom and *up* on the reverse transition. -The matrix `κ_jump` below encodes this. +The matrix `κ_jump` below encodes this. We use the convention `κ[j, i]` = log jump multiplier of $M$ for the transition $i \to j$, with @@ -1476,40 +1480,62 @@ print(φ_jump) ``` To see how the long-run rate $\rho$ responds to jump risk, we hold the -boom-to-recession multiplier fixed and trace out $\rho$ as the -recession-to-boom multiplier varies. +boom-to-recession log multiplier fixed at its calibrated value and trace out +$\rho$ as the recession-to-boom log multiplier varies. + +The right benchmark to compare against is therefore the eigenvalue at +$\kappa(\text{rec} \to \text{boom}) = 0$ with the boom-to-recession jump +still switched on, which the black dot marks. ```{code-cell} ipython3 --- mystnb: figure: - caption: Jumps and the long-run growth rate + caption: Jumps and the long-run growth rate, holding the boom-to-recession + log multiplier fixed name: fig-lrr-jumps-eigenvalue --- +κ_boom_to_rec = κ_jump[1, 0] + κ_grid = np.linspace(-0.5, 0.5, 100) ρ_grid = np.empty_like(κ_grid) for n, k in enumerate(κ_grid): κ_temp = np.array([[0.0, k], - [0.30, 0.0]]) + [κ_boom_to_rec, 0.0]]) A_temp = build_generator(U, r, κ_temp) ρ_grid[n], _ = principal_eigenpair(A_temp) +ρ_no_up_jump, _ = principal_eigenpair( + build_generator(U, r, np.array([[0.0, 0.0], + [κ_boom_to_rec, 0.0]])) +) + fig, ax = plt.subplots() ax.plot(κ_grid, ρ_grid, lw=2) -ax.axhline(ρ, color="black", ls="--", lw=1) +ax.plot([0.0], [ρ_no_up_jump], "o", color="black", + label="no recession-to-boom jump") ax.axvline(0, color="black", ls=":", lw=1) ax.set_xlabel("jump log multiplier for recession to boom") ax.set_ylabel("principal eigenvalue") +ax.legend() plt.show() + +print(f"ρ at κ(rec -> boom) = 0 = {ρ_no_up_jump:.6f}") ``` The principal eigenvalue is monotonically increasing in the recession-to-boom log multiplier: as that multiplier rises, $M$ jumps less downward (or more upward) on good news, which mechanically pushes $\rho$ up. -The economically sensible SDF region is to the left of zero, where the -multiplier is negative. +The black dot sits at $\rho = 0.022934$. + +Switching the recession-to-boom jump on at the calibrated $\kappa = -0.20$ +moves $\rho$ down to $-0.019067$, the value printed above. + +The economically sensible region for a stochastic discount factor is to the +left of zero, where the log multiplier is negative and $M$ jumps down on +good news. ## The affine diffusion example @@ -1581,10 +1607,10 @@ and proportional to $\sqrt{X^f}$ in the $B^f$ direction. ### Why exponential-affine eigenfunctions work When the state is affine and the drift of $A$ is affine, applying the -generator to an exponential-affine function +generator to an exponential-affine function $\phi(x^f,x^o) = \exp(c_f x^f + c_o x^o)$ returns another exponential-affine function. -This closure property turns the eigenvalue equation +This closure property turns the eigenvalue equation $\mathbb A\phi = \rho\phi$ into a small system of algebraic equations in $(c_f, c_o, \rho)$. ```{prf:definition} Exponential-Affine Eigenfunction @@ -1786,7 +1812,7 @@ preferences in a different setting is {doc}`survival_recursive_preferences`. This section derives the SDF coefficients for the unit-elasticity -recursive specification. +recursive specification. You can skip on a first read and come back later --- the numerical example uses the simpler Breeden parameters above. @@ -1901,11 +1927,19 @@ same operator calculation applies once the SDF parameters are replaced by Let's set up parameters and solve for the principal eigenpair. -We use parameters in the standard long-run-risk neighbourhood: a -mean-reverting volatility factor $X^f$ with mean $0.04$, a slower-moving +We use illustrative parameters loosely in the long-run-risk family: a +mean-reverting volatility factor $X^f$ with mean $0.04$, a more persistent predictable-growth factor $X^o$ with mean $0.02$, risk aversion $a=4$, and a time discount rate $b=0.03$. +These are chosen to make the operator calculations transparent, not to match +asset-price moments. + +With time-separable CRRA preferences and $a=4$ they imply an instantaneous +riskless rate of about $10.6\%$ at the state means and a long zero-coupon +yield of $9.6\%$ (printed below), which is the familiar risk-free rate +puzzle rather than a resolution of it. + ```{code-cell} ipython3 params_state = { "ξ_f": 0.70, @@ -2229,17 +2263,17 @@ state component. We will see *two* related ways to vary risk exposure, each leading to a slightly different long-run risk price: -1. **Valuation-functional frontier:** +1. **Valuation-functional frontier:** - Hold the SDF $S$ fixed and vary the - asset's Brownian exposures $(\gamma^v_f, \gamma^v_o)$. - + asset's Brownian exposures $(\gamma^v_f, \gamma^v_o)$. + - Use the local pricing restriction to determine the drift $\beta^v$, then compute $\rho^v$ for the $V$-semigroup. -2. **Cash-flow frontier:** +2. **Cash-flow frontier:** - Hold the SDF $S$ fixed and vary the cash-flow's - growth exposures $(\gamma^g_f, \gamma^g_o)$. + growth exposures $(\gamma^g_f, \gamma^g_o)$. - Set $M = GS$ and compute the principal eigenvalue $\rho$ of the cash-flow valuation semigroup. @@ -2247,7 +2281,9 @@ In simple log-normal examples, these two frontiers coincide. But they can differ with stochastic volatility, nonlinear dynamics, or jump risk. -We will work out both types of examples in the affine model below. +We will work out both types of examples in the affine model below: in the +$B^o$ direction the two frontiers agree exactly, while in the $B^f$ +direction stochastic volatility pulls them apart. ### Stochastic discount factor decomposition @@ -2265,7 +2301,7 @@ $$ $$ This is the **permanent-transitory decomposition** of -{cite:t}`AlvarezJermann2005`, linked now to a concrete eigenfunction +{cite:t}`AlvarezJermann2005`, linked now to a concrete eigenfunction construction. The factor $\exp(\rho t)$ is the deterministic trend in the SDF and the @@ -2541,29 +2577,56 @@ The last line is the Itô compensator that makes $\exp(A_t^g-\delta t) = \hat G_t$ a *local* martingale, with $\delta$ the constant trend growth rate. -Stochastic stability of the growth-twisted process needs three conditions. +In this affine setting the three abstract conditions of +{prf:ref}`lrr-def-stochastic-stability` --- a stationary distribution, an +irreducible skeleton, and Harris recurrence --- all follow once the twisted +$X^f$ is mean reverting and does not hit zero. + +Alongside them sits the separate requirement that $\hat G$ itself be a +martingale, the Assumption-6.1 analogue for the growth twist. -The **Feller-type nonattainment** inequality +Take nonattainment first. + +Under the twist the drift of $X^f$ becomes $$ - 2(\xi_f+\sigma_f\gamma_f^g)\bar x_f \geq \sigma_f^2 + \xi_f \bar x_f + - \bigl[\xi_f-\sigma_f(\gamma_f+c_f\sigma_f)\bigr] x^f , + \qquad + \gamma_f = \gamma_f^s+\gamma_f^g , $$ -keeps the twisted $X^f$ from hitting zero. +while Girsanov leaves the diffusion coefficient $\sqrt{x^f}\sigma_f$ +unchanged. -*Mean reversion* of the twisted $X^f$ is picked by the same root-selection -argument we used for the SDF in {eq}`eq:cf-roots`. +Writing this drift in the canonical square-root form +$\hat\kappa(\hat\theta-x^f)$, the twist rescales the mean-reversion speed +$\hat\kappa$ and the long-run mean $\hat\theta$, but it leaves their +*product* $\hat\kappa\hat\theta=\xi_f\bar x_f$ fixed. -$\hat G$ itself must be a martingale, the Assumption-6.1 analogue for the -growth twist. +Since the **Feller-type nonattainment** inequality sees only that product, +it is the same one that governs the original process, -The Feller inequality is necessary but not sufficient on its own. +$$ + 2\xi_f\bar x_f \geq \sigma_f^2 , +$$ + +with no exposure parameter in it at all. + +*Mean reversion* of the twisted $X^f$, i.e. $\hat\kappa>0$, is a genuinely +separate requirement, and it is picked by the same root-selection argument we +used for the SDF in {eq}`eq:cf-roots`. + +Neither condition is sufficient on its own. ```{note} -This Feller restriction is a concrete instance of a general point we -flagged earlier: changing growth risk can violate stability and invalidate -the long-run approximation, so the choice of $(\gamma_f^g, \gamma_o^g)$ -isn't free. +Nonattainment is free here, but stability overall is not: changing growth +risk can still violate it and invalidate the long-run approximation, so the +choice of $(\gamma_f^g, \gamma_o^g)$ isn't free. + +At this calibration, for instance, a large negative $\gamma_f^g$ drives the +discriminant in {eq}`eq:cf-roots` below zero, so no real exponential-affine +eigenfunction exists at all. ``` To price the cash flow $D_t=D_0G_t\psi(X_t)$, use the semigroup generated by @@ -2652,6 +2715,51 @@ print(f"finite-difference slope = {finite_difference:.6f}") print(f"formula = {long_run_price_o:.6f}") ``` +### Where the two frontiers come apart + +We promised above that the valuation-functional and cash-flow frontiers +can differ. + +In the $B^o$ direction they do not: the two finite differences just computed +agree to six decimals, because $\gamma_o$ enters the eigenvalue +{eq}`eq:affine-rho` linearly. + +The $B^f$ direction is the interesting one, because there the exposure feeds +through $c_f$, which solves the quadratic {eq}`eq:cf-eq`. + +```{code-cell} ipython3 +def central_difference(f, h=1e-5): + return (f(h) - f(-h)) / (2 * h) + +valuation_price_f = central_difference( + lambda g: valuation_eigenvalue_for_exposure(0.0, g) +) +cashflow_price_f = central_difference( + lambda g: required_return_for_growth_exposure(0.0, g) +) +local_price_f = -params_sdf["γ_f"] * params_sdf["xbar_f"] + +print(f"B^f local price (at x^f = xbar_f) = {local_price_f:.6f}") +print(f"B^f valuation-functional frontier = {valuation_price_f:.6f}") +print(f"B^f cash-flow frontier = {cashflow_price_f:.6f}") +``` + +The three numbers differ in the third decimal place. + +The local price evaluated at $x^f=\bar x_f$ is the smallest, the +valuation-functional frontier is slightly larger, and the cash-flow frontier +is larger still. + +The reason is that a $B^f$ exposure shifts $c_f$ nonlinearly, and the two +frontiers load that nonlinearity differently: the valuation frontier also +adjusts $\beta_f^v$ through the local pricing restriction +{eq}`eq:valuation-local-restriction-affine`, whereas the cash-flow frontier +adjusts $\beta_f$ through the Itô compensator in {eq}`eq:growth-functional`. + +This is the discrepancy anticipated in the discussion of the two frontiers +above, and it is absent in the $B^o$ direction precisely because $X^o$ has +constant volatility. + ## Assumptions behind the scenes The examples above make the eigenfunction calculation look routine. @@ -2703,7 +2811,7 @@ $$ \frac{\mathbb A V}{V} \leq a_0 . $$ -Roughly: $V$ doesn't grow too fast under the semigroup. +Roughly: $V$ doesn't grow too fast under the semigroup. With this in hand, for any $\alpha > a_0$ define the **resolvent operator** @@ -2743,12 +2851,12 @@ The existence proof then proceeds in three steps: 3. **Eigenfunction extraction.** The minorization, combined with additional boundedness or strengthened drift assumptions, identifies a critical spectral value for $F_\alpha$ and an associated positive - eigenfunction. - + eigenfunction. + - Inverting the resolvent transform produces a positive eigenfunction for the original semigroup. -These steps are all nontrivial and are out of scope for this lecture. +These steps are all nontrivial and are out of scope for this lecture. The details are in Section 9 of {cite:t}`HansenScheinkman2009`. @@ -2763,7 +2871,9 @@ We can summarize the chain of conditions as: In the finite-state case, all four follow from one Perron-Frobenius calculation; in the affine model, they reduce to picking the right root of -a quadratic. In general, each must be checked separately. +a quadratic. + +In general, each must be checked separately. The full theory in {cite:t}`HansenScheinkman2009` also delivers stronger $L^p$ approximation results and Lyapunov criteria for stochastic stability, @@ -2782,10 +2892,12 @@ The main steps are: 2. Build the semigroup $\mathbb M_t\psi(x)=\mathbb{E}[M_t\psi(X_t)\mid X_0=x]$. -3. When $M = VS$ is the product of a valuation functional and an SDF, - impose the local pricing restriction that $VS$ is a martingale; for - cash-flow valuation semigroups $\mathbb Q_t = GS$, the pricing - restriction is on $S$ alone, and $G$ enters only as a growth twist. +3. When $V$ is a valuation functional, use the local pricing restriction + that $VS$ is a martingale to determine the drift of $V$ from its + Brownian and jump exposures, and then apply the eigenvalue problem to + $M = V$; for cash-flow valuation take $M = Q = GS$, the functional + generating the semigroup $\{\mathbb Q_t\}$, where the pricing restriction + falls on $S$ alone and $G$ enters only as a growth twist. 4. Solve the principal eigenvalue problem $\mathbb A\phi=\rho\phi$. @@ -2914,29 +3026,38 @@ The principal eigenvalue is the larger root, so $-r_1<\rho<0$. ```{exercise} :label: lrr_ex2 -In the affine model, compute the local and long-run prices of exposure to -$B^o$ for +{numref}`fig-lrr-persistence-risk-prices` shows the long-run price of $B^o$ +exposure falling towards the local price as the mean-reversion speed +$\xi_o$ rises. -$$ - \xi_o \in \{0.1, 0.2, 0.5, 1, 2, 5\}. -$$ +This exercise asks you to pin down the *rate* at which it falls. -Use the formulas +Define the **persistence wedge** $$ - \text{local price} = -\gamma_o^s + w(\xi_o) + = + \text{long-run price of } B^o + - + \text{local price of } B^o . $$ -and +1. Using {eq}`eq:long-run-price-o` together with the Breeden coefficients +{eq}`eq:breeden-sdf-params`, show analytically that $$ - \text{long-run price} - = - -\gamma_o^s - - \frac{\beta_o^s}{\xi_o}\sigma_o . + w(\xi_o) = \frac{a\sigma_o}{\xi_o} , $$ -Explain why the two prices converge as $\xi_o \to \infty$. +so the wedge is exactly proportional to $1/\xi_o$ and, in particular, does +not depend on the consumption loading $\vartheta_o$. + +2. Verify this numerically on the grid +$\xi_o \in \{0.1, 0.2, 0.5, 1, 2, 5\}$ by checking that the product +$\xi_o\, w(\xi_o)$ is constant across the grid and equal to $a\sigma_o$. + +3. Plot $w$ against $\xi_o$ on log-log axes and confirm that the fitted +slope is $-1$, the signature of exactly hyperbolic decay. ``` ```{solution-start} lrr_ex2 @@ -2945,31 +3066,58 @@ Explain why the two prices converge as $\xi_o \to \infty$. Here is one solution: +*1.* The local price is $-\gamma_o^s$ and, by {eq}`eq:long-run-price-o`, the +long-run price is $-\gamma_o^s - (\beta_o^s/\xi_o)\sigma_o$. + +Subtracting, the common term $-\gamma_o^s$ cancels and only the persistence +correction survives: + +$$ + w(\xi_o) = -\frac{\beta_o^s}{\xi_o}\sigma_o . +$$ + +The Breeden coefficients {eq}`eq:breeden-sdf-params` set $\beta_o^s = -a$, +which gives $w(\xi_o) = a\sigma_o/\xi_o$. + +Because $\vartheta_o$ enters only through $\gamma_o^s = -a\vartheta_o$, which +appears identically in both prices, it cancels and cannot affect the wedge. + +*2.* and *3.* Numerically: + ```{code-cell} ipython3 ξ_vals = np.array([0.1, 0.2, 0.5, 1.0, 2.0, 5.0]) -local_vals = np.full_like(ξ_vals, -params_sdf["γ_o"]) -long_vals = (-params_sdf["γ_o"] - - (params_sdf["β_o"] / ξ_vals) * params_sdf["σ_o"]) +wedge = -(params_sdf["β_o"] / ξ_vals) * params_sdf["σ_o"] -for ξ, lp, lrp in zip(ξ_vals, local_vals, long_vals): - print(f"ξ_o = {ξ:3.1f}: local = {lp:.4f}, long-run = {lrp:.4f}") +print(f"a * σ_o = {a * params_sdf['σ_o']:.6f}\n") +for ξ, w in zip(ξ_vals, wedge): + print(f"ξ_o = {ξ:3.1f}: wedge = {w:.6f}, ξ_o * wedge = {ξ * w:.6f}") + +slope, _ = np.polyfit(np.log(ξ_vals), np.log(wedge), 1) +print(f"\nlog-log slope = {slope:.6f}") fig, ax = plt.subplots() -ax.plot(ξ_vals, local_vals, "--", lw=2, label="local") -ax.plot(ξ_vals, long_vals, "o-", lw=2, label="long-run") -ax.set_xscale("log") +ax.loglog(ξ_vals, wedge, "o-", lw=2, label="persistence wedge $w$") +ax.loglog(ξ_vals, a * params_sdf["σ_o"] / ξ_vals, "--", lw=2, + label="$a\\sigma_o/\\xi_o$") ax.set_xlabel("$\\xi_o$") -ax.set_ylabel("risk price") +ax.set_ylabel("wedge") ax.legend() plt.show() ``` -As $\xi_o$ increases, $X^o$ mean reverts faster. +The product $\xi_o\, w(\xi_o)$ prints as $0.040000$ at every grid point, +matching $a\sigma_o = 4 \times 0.01$, and the fitted log-log slope is +$-1.000000$. + +So the two prices do not merely converge: the wedge decays at the exact +hyperbolic rate $a\sigma_o/\xi_o$. -A shock to $B^o$ then has a shorter-lived effect on future expected growth. +The economics behind the rate is that a $B^o$ shock displaces $X^o$ by +$\sigma_o$ on impact, and that displacement decays at rate $\xi_o$, so its +cumulative effect on expected growth is $\sigma_o/\xi_o$. -The persistence term $(\beta_o^s/\xi_o)\sigma_o$ converges to zero, so the -long-run price converges to the local price. +Each unit of that cumulative effect is priced by the SDF's loading $a$ on +$X^o$. ```{solution-end} ``` @@ -2990,7 +3138,9 @@ U = $$ decay-rate vector $r = (0.06, 0.04, 0.01)$, and no jumps in the -multiplicative functional. Let $\psi=(3,1,2)$. +multiplicative functional. + +Let $\psi=(3,1,2)$. 1. Compute the principal eigenpair $(\rho,\phi)$ and twisted stationary distribution $\hat\varsigma$, and report the theoretical limit @@ -3059,15 +3209,29 @@ ax.semilogy(t_vals, errors, lw=2) ax.set_xlabel("$t$") ax.set_ylabel("error") plt.show() +``` + +For part 3 we estimate the empirical decay rate by fitting a straight line to +$\log(\text{error})$ over a window in which the leading correction term +dominates, and compare the fitted slope to the gap. + +```{code-cell} ipython3 +mask = (t_vals > 20) & (t_vals < 40) +fitted_slope, _ = np.polyfit(t_vals[mask], np.log(errors[mask]), 1) -print(f"spectral gap = {gap:.6f}") +print(f"empirical decay rate = {-fitted_slope:.6f}") +print(f"spectral gap = {gap:.6f}") ``` The normalized semigroup converges at an exponential rate governed by the separation between the dominant eigenvalue and the remaining eigenvalues. -In this finite-state example, that separation is the spectral gap computed -above. +In this finite-state example, that separation is the spectral gap, and the +two numbers printed above agree to three decimal places. + +The small remaining discrepancy is the contribution of the third eigenvalue, +which has not yet died out completely; fitting over a later window shrinks +it further. ```{solution-end} ``` @@ -3121,7 +3285,7 @@ $$ $$ *2.* For $f(a) = e^a$ we have $f'(a) = f''(a) = e^a$, so $f'(A_{t-}) = -f''(A_{t-}) = M_{t-}$. +f''(A_{t-}) = M_{t-}$. The [(generalized) Itô's formula](https://almostsuremath.com/2010/01/25/the-generalized-ito-formula/) for a semimartingale gives @@ -3212,7 +3376,9 @@ $$ N_t = M_t\phi(X_t) - \phi(X_0) - \int_0^t M_s \chi(X_s)\, ds $$ -is a local martingale. The task therefore has two pieces: identify the +is a local martingale. + +The task therefore has two pieces: identify the predictable drift of $M_t\phi(X_t)$ to read off a candidate $\chi$, and verify that the residual $N_t$ really is a local martingale. @@ -3265,7 +3431,7 @@ $\chi(x)$, and check that it matches the closed form (4) Identify the continuous Itô integrand from part (1) as a local martingale $N^c_t$ and the compensated -jump sum from part (2) as a local martingale $N^j_t$. +jump sum from part (2) as a local martingale $N^j_t$. Show that the semimartingale decomposition of $Y_t = M_t\phi(X_t)$ implies @@ -3275,7 +3441,9 @@ $$ = N^c_t + N^j_t , $$ -which is a local martingale. Conclude via +which is a local martingale. + +Conclude via {prf:ref}`lrr-def-extended-generator` that $\mathbb A \phi = \chi$. ``` diff --git a/lectures/misspecified_recovery.md b/lectures/misspecified_recovery.md index 7b360a5c1..b55e6216a 100644 --- a/lectures/misspecified_recovery.md +++ b/lectures/misspecified_recovery.md @@ -36,6 +36,9 @@ beliefs from the pricing kernel. This lecture asks what the same Perron--Frobenius approach delivers when that restriction is not imposed. +The eigenfunction, martingale-factorization, and twisted-measure machinery that we use +here is developed at length in {doc}`long_run_risk_operator`. + We will keep three probability measures separate. The first is the correctly specified probability measure, which governs the Markov @@ -69,7 +72,7 @@ adverse long-run-risk states than the correctly specified probability measure. We will: -- use results from {doc}`ross_recovery` without re-proving it, +- use results from {doc}`ross_recovery` without re-proving them, - study misspecification through the martingale component, - show why recursive utility and permanent shocks make the recovered probability measure differ from the correctly specified probability measure, @@ -250,7 +253,7 @@ The question is whether the transition matrix associated with the long-term risk-neutral probability, $\hat{\mathbf{P}}$, still equals the correctly specified matrix $\mathbf{P}$. -### Degenerate Martingale Component +### Degenerate martingale component We start with a three-state economy: recession, normal, and expansion. @@ -259,9 +262,14 @@ The correctly specified transition matrix is deliberately simple. For trend-stationary consumption and power utility, the SDF is $$ -s_{ij}=A\left(\frac{c_j}{c_i}\right)^{-\gamma}. +s_{ij}=A\left(\frac{c_j}{c_i}\right)^{-\gamma}, +\qquad +A = \exp(-\delta-\gamma g_c), $$ +where $\delta$ is the subjective discount rate, $\gamma$ is risk aversion, and $g_c$ is +trend consumption growth. + This is a case where Ross recovery should return the correctly specified transition matrix. @@ -304,7 +312,8 @@ The row-normalized matrix $\bar{\mathbf{P}}$ is a short-horizon risk-neutral cha measure: it folds the one-period SDF into transition probabilities, so it generally differs from the correctly specified matrix $\mathbf{P}$. -The logic comes from the Perron--Frobenius construction in {doc}`ross_recovery`. +The reason $\hat{\mathbf{P}}$ can equal $\mathbf{P}$ comes from the Perron--Frobenius +construction in {doc}`ross_recovery`. In the transition-independent case, the pricing kernel has the form $s_{ij}=\exp(\hat\eta)\hat e_i/\hat e_j$. @@ -341,35 +350,11 @@ $$ When $\hat h_{ij}=1$ for every transition, $\hat{\mathbf P}$ and $\mathbf P$ are the same. -The next section explains why this ratio is the one-period martingale increment. +The section {ref}`mr_martingale_component` defines this ratio formally in +{eq}`eq-mr-hhat-finite` and explains why it is a one-period martingale increment. -In the power-utility example, write - -$$ -A = \exp(-\delta-\gamma g_c), -\qquad -s_{ij}=A\left(\frac{c_j}{c_i}\right)^{-\gamma}. -$$ - -Taking $\hat e_i=c_i^\gamma$, up to scale, gives - -$$ -[\mathbf{Q}\hat e]_i -= \sum_j A\left(\frac{c_j}{c_i}\right)^{-\gamma}p_{ij}c_j^\gamma -= A c_i^\gamma -= A\hat e_i, -$$ - -so $\exp(\hat\eta)=A$. - -Consequently, - -$$ -\hat h_{ij} -= A^{-1}A\left(\frac{c_j}{c_i}\right)^{-\gamma} - \frac{c_j^\gamma}{c_i^\gamma} -=1. -$$ +We ask you to verify in {ref}`ex_power_utility_success` that $\hat e_i=c_i^\gamma$ and +$\exp(\hat\eta)=A$ in this example, so that $\hat h_{ij}\equiv 1$. ```{code-cell} ipython3 H_power = np.divide(P_hat, P_true, out=np.ones_like(P_true), where=P_true > 0) @@ -411,7 +396,8 @@ transition matrix. In this example, that cancellation exhausts the SDF, so the martingale component is degenerate. -## Martingale Component +(mr_martingale_component)= +## Martingale component Let $(\hat \eta, \hat e)$ be the Perron--Frobenius eigenvalue exponent and positive right eigenvector of $\mathbf{Q}$: @@ -515,8 +501,8 @@ $$ Thus $\hat{\mathbf{P}}=\mathbf{P}$ if and only if $\hat h_{ij}=1$ on every feasible transition. -This condition is the same as saying that the SDF can be written as -{eq}`eq-mr-finite-sdf-decomposition` with no extra martingale increment. +This condition is the same as saying that the SDF takes the form displayed in +{prf:ref}`prop-misspecified-recovery-martingale-component`. ``` This finite-state implication is a special case of the paper's general identification @@ -818,9 +804,9 @@ Now return to the Perron--Frobenius step. The finite-state equation was {eq}`eq-mr-pf-finite`. -The general-state replacement is an eigenfunction problem for the pricing operators: -find a scalar $\hat\eta$ and a positive function $\hat e$ such that, for every horizon -$t$, +The general-state replacement is an eigenfunction problem for the pricing operators of +the kind studied in {doc}`long_run_risk_operator`: find a scalar $\hat\eta$ and a +positive function $\hat e$ such that, for every horizon $t$, ```{math} :label: eq-mr-pf-general @@ -937,6 +923,20 @@ differs from the correctly specified probability measure. We show the restriction that rules out this difference in the next section. +```{note} +The objects $(\hat e,\hat\eta,\hat H)$ are the ones that +{doc}`long_run_risk_operator` writes as $(\phi,\rho,\hat M)$, working there with a +generic multiplicative functional $M$ in place of the stochastic discount factor $S$ +used here; what that lecture calls the **twisted measure** is what this lecture calls +the long-term risk-neutral measure $\hat{\mathbf P}=P^{\hat H}$. + +One symbol does not travel. + +Here $Q_t$ is the semigroup built from the stochastic discount factor alone, which that +lecture writes $\mathbb S_t$; there, $\mathbb Q_t$ is instead the cash-flow valuation +semigroup built from $Q=GS$, which also carries a stochastic growth factor. +``` + ### Selection and recovery In finite irreducible matrix problems, Perron--Frobenius theory gives a unique positive @@ -949,6 +949,9 @@ positive eigenfunctions may solve the same pricing operator problem when one doe The paper therefore imposes a selection condition on the probability measure induced by the candidate eigenfunction. +This is the same difficulty that {doc}`long_run_risk_operator` treats under +"Stability of the twisted process"; see {prf:ref}`lrr-def-stochastic-stability` there. + ````{prf:assumption} Ergodicity of the recovered measure :label: assumption-mr-ergodicity @@ -1012,7 +1015,8 @@ is allowed to depend on the auxiliary process $Y$. ### Continuous-time version -Let's briefly introduce the model in continuous time before discussing examples where recovery fails. +Let's briefly restate the framework in continuous time before discussing examples where +recovery fails. We introduce the diffusion notation because the long-run risk example below is written in continuous time. @@ -1080,10 +1084,10 @@ finite-state model. The Markov and triangular structure of $Z$ is preserved, which is why the same Perron--Frobenius decomposition can be applied. +## When recovery fails -## When the recovery fails - -Now let's discuss a few examples where the recovered probability measure differs from the correctly specified probability measure. +Now let's discuss a few examples where the recovered probability measure differs from +the correctly specified probability measure. ### Recursive utility @@ -1265,11 +1269,12 @@ Thus, as the continuation-value term creates a nonconstant $\hat h_{ij}$, the tr matrix associated with the long-term risk-neutral probability no longer equals the correctly specified transition matrix. -### Permanent Shocks +### Permanent shocks Recursive utility gives one nonconstant martingale component. -Permanent shocks provide another. +Permanent shocks provide another, but this example has to be read carefully, because +what it delivers depends on the information set on which recovery is run. Suppose consumption has a permanent shock, @@ -1278,7 +1283,8 @@ $$ = g + x(X_{t+1})-x(X_t) + \sigma \varepsilon_{t+1}, $$ -where $\varepsilon_{t+1}$ is independent over time. +where $\varepsilon_{t+1}$ is independent over time and independent of the Markov state +$X$. With power utility, the SDF contains @@ -1293,25 +1299,87 @@ The middle term depends only on the current and next Markov states. It is a ratio of state functions, so the Perron--Frobenius transition formula can cancel it. -The permanent shock term depends on the new shock $\varepsilon_{t+1}$. - -Because that shock is not summarized by the finite Markov state in this construction, -there is no state function whose ratio can cancel it. +The last term depends on the new shock $\varepsilon_{t+1}$, which is not summarized by +the Markov state. -After dividing by its conditional mean, the shock term becomes a martingale increment: +After dividing by its conditional mean, that term becomes a martingale increment: $$ \frac{\exp(-\gamma\sigma\varepsilon_{t+1})} {E[\exp(-\gamma\sigma\varepsilon_{t+1})]}. $$ -Thus permanent consumption shocks can make the recovered probability measure differ -from investors' beliefs, even under ordinary power utility. +Whether that martingale increment breaks recovery depends on the information set on +which the eigenfunction problem is posed, so we take the two cases in turn. + +Consider first an analyst who prices claims written on the Markov state $X$ alone. + +Taking expectations over $\varepsilon_{t+1}$, the Arrow prices over the states of $X$ +are + +$$ +q_{ij} += \exp(-\delta-\gamma g)\, + E[\exp(-\gamma\sigma\varepsilon_{t+1})]\, + \frac{\exp(-\gamma x_j)}{\exp(-\gamma x_i)}\, + p_{ij}. +$$ + +Because $\varepsilon_{t+1}$ is independent of $X$, the permanent shock contributes the +same constant to every entry of $\mathbf{Q}$ and factors out. + +What is left is exactly transition independent in $X$, with $\hat e_i=\exp(\gamma x_i)$. -This statement is relative to the Markov state used in the recovery procedure. +So Perron--Frobenius recovery of the transition matrix of $X$ is exact here: the +martingale increment over the states of $X$ is identically one. -Enlarging the state or information structure to account for the shock can accommodate -it, but doing so leads to the identification problem discussed in +The next cell confirms this in a three-state example. + +```{code-cell} ipython3 +x_perm = np.array([-0.02, 0.0, 0.02]) # state effect on log consumption +σ_perm = 0.01 # scale of the permanent shock +E_perm = np.exp(0.5 * (γ_power * σ_perm)**2) # E[exp(-γ σ ε)] for ε ~ N(0, 1) + +# Arrow prices over X: the permanent shock enters only through the constant E_perm +S_perm = (np.exp(-δ - γ_power * g_c) * E_perm + * np.exp(-γ_power * x_perm)[None, :] + / np.exp(-γ_power * x_perm)[:, None]) +Q_perm = S_perm * P_true + +H_perm, _, e_perm, P_hat_perm = martingale_increment(Q_perm, P_true) + +print("eigenfunction: numerical vs exp(gamma x)") +print(np.round(e_perm / e_perm[1], 6)) +print(np.round(np.exp(γ_power * x_perm) / np.exp(γ_power * x_perm[1]), 6)) +print(f"\nmax |P_hat - P| = {np.max(np.abs(P_hat_perm - P_true)):.1e}") +print(f"max |h_hat - 1| = {np.max(np.abs(H_perm[P_true > 0] - 1)):.1e}") +``` + +The recovered eigenfunction is $\exp(\gamma x_i)$ and both discrepancies are at machine +precision. + +Now enlarge the filtration so that it reveals consumption, and therefore reveals +$\varepsilon_{t+1}$ as well. + +Relative to investors' information about $(X,\varepsilon)$, the martingale increment +displayed above is not identically one: it tilts the distribution of the permanent shock +toward low realizations. + +So the recovered law of consumption differs from investors' beliefs even under ordinary +power utility, although the recovered law of the Markov state does not. + +The conclusion can now be stated precisely. + +Permanent consumption shocks make the recovered probability measure differ from +investors' beliefs on the filtration that reveals those shocks, even under ordinary +power utility. + +Recovery over $X$ alone also breaks down as soon as the permanent shock stops being +independent of $X$, since the shock then no longer factors out of $\mathbf{Q}$ into a +constant. + +Enlarging the state or information structure to account for the shock does not repair +recovery; it leads to the identification problem discussed in {ref}`mr_additional_state`. ### Long-run risk @@ -1343,7 +1411,39 @@ dX_{2t} \end{aligned} $$ -Here $X_1$ is predictable consumption growth and $X_2$ is stochastic volatility. +Log consumption has an affine drift and the same volatility scaling: + +$$ +d\log C_t += [\beta_{c0}+\beta_{c1}(X_{1t}-\iota_1)+\beta_{c2}(X_{2t}-\iota_2)]dt + + \sqrt{X_{2t}}\,\alpha_c\cdot dW_t . +$$ + +Here $X_1$ is predictable consumption growth and $X_2$ is a stochastic volatility state. + +Two conventions are used throughout this section and both matter for reading the code. + +First, every drift is written relative to the long-run means $(\iota_1,\iota_2)$, so a +coefficient triple $(\beta_0,\beta_1,\beta_2)$ always means +$\beta_0+\beta_1(x_1-\iota_1)+\beta_2(x_2-\iota_2)$. + +Second, each diffusion loading is scaled by $\sqrt{X_{2t}}$, so an Ito correction +$\tfrac12|\alpha|^2$ enters the coefficient on $x_2$ rather than the constant. + +The two conventions work together, and it is worth seeing how, because the code below +carries a term $-\tfrac12|\alpha_{H^*}|^2$ in the $x_2$ coefficient of the drift of +$\log S$ and a term $-\tfrac12\iota_2|\alpha_{H^*}|^2$ in its constant, where +$\alpha_{H^*}$ is the shock exposure of the continuation-value martingale defined +below. + +That is one correction, not two. + +The continuation-value martingale contributes the drift $-\tfrac12 x_2|\alpha_{H^*}|^2$ +to $\log S$, and writing this single term in centered form splits it into +$-\tfrac12|\alpha_{H^*}|^2$ multiplying $(x_2-\iota_2)$ and $-\tfrac12\iota_2 +|\alpha_{H^*}|^2$ left over in the constant. + +The calibration below sets $\beta_{c1}=1$, so $X_1$ *is* predictable consumption growth. The representative agent has Epstein--Zin utility with unit elasticity of intertemporal substitution. @@ -1506,14 +1606,23 @@ def solve_pf_lrr(p, v1, v2): roots = [(-lin - np.sqrt(disc)) / (2 * quad), (-lin + np.sqrt(disc)) / (2 * quad)] - candidates = [] + # Selection rule: keep the root under which X is stationary and ergodic under the + # induced measure. In this affine model that requires the twisted volatility + # process to mean revert (mu_hat_22 < 0) to a positive long-run mean. + selected = [] for e2 in roots: - eta = (β_s0 - β_s11 * ι1 - β_s12 * ι2 - - e1 * (μ11 * ι1 + μ12 * ι2) - e2 * μ22 * ι2) - candidates.append((eta, e2)) - - # Choose the solution that gives the smaller eigenvalue exponent. - eta, e2 = min(candidates) + α_h = α_s + σ1 * e1 + σ2 * e2 + μ_hat_22 = μ22 + np.dot(σ2, α_h) + ι_hat_2 = (μ22 / μ_hat_22) * ι2 + if μ_hat_22 < 0 and ι_hat_2 > 0: + eta = (β_s0 - β_s11 * ι1 - β_s12 * ι2 + - e1 * (μ11 * ι1 + μ12 * ι2) - e2 * μ22 * ι2) + selected.append((eta, e2)) + + if len(selected) != 1: + raise ValueError("Selection condition does not pin down a unique eigenfunction") + + eta, e2 = selected[0] return e1, e2, eta, α_s @@ -1523,7 +1632,8 @@ def recovered_lrr_dynamics(p, e1, e2, α_s): ι1, ι2 = p["ι1"], p["ι2"] σ1, σ2 = p["σ1"], p["σ2"] - # The long-term risk-neutral measure uses the SDF exposure plus the eigenfunction exposure. + # The long-term risk-neutral measure uses the SDF exposure plus the + # eigenfunction exposure. α_h = α_s + σ1 * e1 + σ2 * e2 # A diffusion change of measure shifts each drift by sigma_i dot alpha_h. @@ -1573,6 +1683,14 @@ def risk_neutral_lrr_dynamics(p, α_s): ) ``` +The quadratic for $e_2$ has two roots, and `solve_pf_lrr` selects between them using the +criterion stated in {prf:ref}`assumption-mr-ergodicity`, which +{prf:ref}`prop-mr-uniqueness` shows leaves at most one solution. + +Here the discarded root gives $\hat\mu_{22}=+0.0115$ and $\hat\iota_2=-1.13$, an +explosive volatility process reverting to a negative long-run mean, so $X$ is certainly +not stationary and ergodic under the measure it induces. + For the calibration used here, the recovered probability measure changes the long-run state distribution. @@ -1608,13 +1726,17 @@ predictable consumption growth. The volatility slope $v_2$ is negative in this calibration, so higher volatility lowers continuation value. -The eigenfunction coefficient $e_1$ has the opposite sign: the long-term change of -measure loads negatively on predictable growth. +The eigenfunction coefficient $e_1$ has the opposite sign: the eigenfunction declines in +predictable growth. + +The change of measure itself loads through $\alpha_S+\sigma_1e_1+\sigma_2e_2$, and the +eigenfunction term $\sigma_1e_1$ reinforces the negative tilt already present in +$\alpha_S$. Thus the recovered probability measure assigns more probability to histories with lower expected growth. -The positive $e_2$ has the opposite implication for volatility, assigning more +The positive $e_2$ works in the other direction for volatility, assigning more probability to higher-volatility states. The table translates those coefficients into state dynamics. @@ -1630,7 +1752,7 @@ rises from $1$ to about $1.13$. The small negative log eigenvalue means that $\exp(\eta)$ is slightly below one; with the usual yield sign convention, $-\eta$ is the corresponding long-run discount rate. -#### Stationary Densities +#### Stationary densities The coefficient table gives one summary of the difference between probability measures. @@ -1653,8 +1775,13 @@ In this calibration, the one-period risk-neutral and long-term risk-neutral stat distributions are close to each other, and both are far from the correctly specified distribution. -Thus the martingale component accounts for much of the risk adjustment in the -state dynamics. +The whole gap between $\mathbf{P}$ and $\hat{\mathbf{P}}$ is the martingale component +$\hat H$, whose shock exposure is $\alpha_S+\sigma_1e_1+\sigma_2e_2$. + +What the closeness of the two risk-neutral densities shows is how that exposure is +split: most of it comes from the one-period risk price $\alpha_S$, while the +Perron--Frobenius eigenfunction supplies the rest, about a tenth of the loading on the +growth shock and about a quarter of the loading on the volatility shock. The paper's Figure 1 reports model-implied stationary densities; the simulation below is a numerical approximation to those densities. @@ -1914,8 +2041,9 @@ def yield_quantiles(log_num, log_den, horizons): def transform_functional(β0, β1, β2, α, dyn_old, dyn_new, α_h): """Rewrite a multiplicative functional after changing probabilities.""" - # The drift changes because the martingale component changes the - # Brownian shock exposure used to forecast the cash flow. + # Girsanov: under the new measure the drift of log M gains x2 * (alpha . alpha_h), + # while the shock exposure alpha is unchanged. The x2 loading therefore moves by + # alpha . alpha_h, and the constant is re-centered on the new long-run means. β_level = β0 - β1 * dyn_old["ι1"] - β2 * dyn_old["ι2"] β2_new = β2 + np.dot(α, α_h) β0_new = β_level + β1 * dyn_new["ι1"] + β2_new * dyn_new["ι2"] @@ -2013,10 +2141,33 @@ The bond panel verifies the zero-coupon comparison. Since $\log E[1]=0$ under any measure, the solid and dashed bond-yield bands coincide. +Differencing the two panels gives the paper's headline long-horizon result, which the +cell above has already computed. + +```{code-cell} ipython3 +prem_P = 1e4 * (qC_P[1] - qB_P[1]) +prem_H = 1e4 * (qC_H[1] - qB_P[1]) + +print("median consumption premium over a maturity-matched bond, basis points") +print("maturity correctly specified recovered") +for q in [1, 8, 20, 40, 100]: + print(f"{q:6d}q {prem_P[q - 1]:18.1f} {prem_H[q - 1]:13.1f}") + +print(f"\nlargest absolute premium: {np.max(np.abs(prem_P)):.0f} bp under P, " + f"{np.max(np.abs(prem_H)):.0f} bp under P-hat") +``` + +Under the correctly specified probability measure the consumption claim earns 80 to 336 +basis points over a maturity-matched bond. + +Under the recovered probability measure that premium never exceeds 8 basis points in +absolute value, which is the sense in which long-horizon risk premia relative to +maturity-matched bonds vanish under the long-term risk-neutral measure. + (mr_additional_state)= ## Additional state vector -{cite:t}`BorovickaHansenScheinkman2016` then asks whether enlarging the state vector +{cite:t}`BorovickaHansenScheinkman2016` then ask whether enlarging the state vector changes the recovery problem. So far, the Perron--Frobenius eigenfunction has depended only on the Markov state @@ -2039,16 +2190,16 @@ X_{t+1}=\phi_x(X_t,\Delta W_{t+1}), Y_{t+1}-Y_t=\phi_y(X_t,\Delta W_{t+1}). $$ -Let $\varepsilon$ denote an eigenfunction candidate that is allowed to depend on both +Let $\tilde e$ denote an eigenfunction candidate that is allowed to depend on both the stationary state $X_t$ and the growing component $Y_t$. -Let $\zeta$ be a vector of loadings on $Y$, and let $e_\zeta$ be a positive function -of $X$. +Let $\zeta$ be a vector of loadings on $Y$, and let $\tilde e_\zeta$ be a positive +function of $X$. Then a natural candidate is $$ -\varepsilon(x,y)=\exp(\zeta \cdot y)e_\zeta(x). +\tilde e(x,y)=\exp(\zeta \cdot y)\tilde e_\zeta(x). $$ This form is natural because $Y$ enters through increments. @@ -2077,10 +2228,10 @@ $$ E\left[ \frac{S_{t+1}}{S_t} \exp\{\zeta \cdot (Y_{t+1}-Y_t)\} - e_\zeta(X_{t+1}) + \tilde e_\zeta(X_{t+1}) \mid X_t=x \right] -=\exp(\eta_\zeta)e_\zeta(x). +=\exp(\eta_\zeta)\tilde e_\zeta(x). $$ Changing $\zeta$ changes how much long-run growth risk is loaded into the eigenfunction. @@ -2088,8 +2239,8 @@ Changing $\zeta$ changes how much long-run growth risk is loaded into the eigenf Thus adding $Y_t$ can make the subjective probability measure one possible solution, but it also creates a family of possible solutions. -The extra state variable therefore does not remove the identification problem; it -usually makes the selection problem more explicit. +The extra state variable therefore does not remove the identification problem; it makes +the selection problem more explicit. The paper also points out a related practical issue. @@ -2171,8 +2322,8 @@ That measure equals investors' beliefs only when the martingale component is identically one. Recursive utility, permanent shocks, and long-run risk models give this martingale an -economically important role, so it should not be overlooked when assessing the -implications of transition independence for belief recovery. +economically important role, so transition independence is a substantive economic +restriction, not a technical convenience. ## Exercises diff --git a/lectures/ross_recovery.md b/lectures/ross_recovery.md index 3f879d069..94fc99320 100644 --- a/lectures/ross_recovery.md +++ b/lectures/ross_recovery.md @@ -63,7 +63,7 @@ If the pricing kernel also satisfies a structural restriction called **transitio independence**, then state prices uniquely determine both the natural probability transition matrix and the transition pricing kernel. -No historical return data or assumed utility function is needed if some assumptions +No historical return data or assumed utility function is needed if some assumptions about the structure of the pricing kernel hold. This is the **Recovery Theorem**. @@ -71,7 +71,7 @@ This is the **Recovery Theorem**. It has several important implications: * It shows how state-price transition data can identify the market's forward-looking - natural distribution when the assumption holds + natural distribution when the assumption holds. * It provides tests of the efficient market hypothesis. * It sheds light on the "dark matter" of finance: the probability of rare catastrophic events embedded in market prices. @@ -82,9 +82,9 @@ This lecture covers the pricing kernel, and natural probabilities, * Ross's Recovery Theorem and its proof via the Perron–Frobenius theorem, * an implementation that recovers the natural distribution from a - simulated state-price matrix, and + simulated state-price matrix, * how option prices and forward equations can be used to estimate transition - state prices, + state prices, and * comparisons between risk-neutral and recovered natural densities. Let's import the packages we'll need. @@ -221,7 +221,7 @@ equations. The system is under-identified by $m^2 - m$ parameters, so some structural restriction on the kernel is needed to pin down $\phi$ and $f$ separately. -Transition independence restriction does the job, as we will see in the next section. +The transition independence restriction does the job, as we will see in the next section. ### Transition independence @@ -405,13 +405,13 @@ the kernel $\beta z_i/z_j$ is decreasing in $z_j$. When $h$ represents marginal utility and states are ordered by consumption or payoff, larger $z_j$ corresponds to lower marginal utility -- "good times" that require less insurance and so receive less pricing weight per unit of natural -probability. +probability. The same eigenvector argument also yields a useful limiting case. -If the one-period -bond price is identical in every current state, then the vector of ones is already the -Perron vector, so recovery has no state-dependent change of measure left to perform. +If the one-period bond price is identical in every current state, then the vector of ones +is already the Perron vector, so recovery has no state-dependent change of measure left +to perform. ```{prf:corollary} @@ -484,12 +484,18 @@ $$ where $Z \geq 0$ captures the downward shift induced by risk adjustment and $\epsilon$ is a residual satisfying $E[\epsilon \mid R-Z]=0$. -Taking expectations gives +Because $R^*$ is the market return under the risk-neutral measure, its expectation is the +riskless return: $E[R^*] = R_f$. + +Taking expectations of the representation above therefore gives $$ -E[R] = R_f + E[Z] > R_f. +E[R] = E[R^*] + E[Z] = R_f + E[Z], $$ +which strictly exceeds $R_f$ whenever $Z$ is positive with positive probability -- that +is, whenever the two densities genuinely differ. + ## Numerical example We now demonstrate the Recovery Theorem numerically. @@ -566,7 +572,7 @@ Following Ross's Table I, we represent the distribution on a finite grid of stat This example is Ross-inspired rather than an exact reproduction of Ross's Table I. Ross's Table I uses a fixed future payoff distribution, so its rows of $F$ are -identical. +identical. Here the same CRRA/lognormal pricing logic is embedded in a finite Markov transition matrix whose rows shift with the current state. @@ -576,8 +582,8 @@ the same range below. The truncation is an essential part of the finite-state model: it is what brings the example into the Perron--Frobenius setting. -In the -unbounded continuous lognormal growth model, Ross shows that recovery is not unique. +In the unbounded continuous lognormal growth model, Ross shows that recovery is not +unique. On the finite grid, the natural transition probabilities and state prices are @@ -589,8 +595,9 @@ f_{ij} \propto p_{ij} = e^{-\rho T} e^{-\gamma(s_j - s_i)} f_{ij}, $$ -where $s_i = \ln S_i$, $s_j = \ln S_j$, $n(\cdot)$ is the standard normal density, and -the discretized probabilities $f_{ij}$ are normalized row by row. +where $s_i = \ln (S_i/S_0)$ and $s_j = \ln (S_j/S_0)$ are log states measured relative to +today's index level, $n(\cdot)$ is the standard normal density, and the discretized +probabilities $f_{ij}$ are normalized row by row. The next cell constructs this finite grid and builds $P$. @@ -647,10 +654,16 @@ print(f"Middle-state risk-free rate: {-np.log(P[5].sum()):.4f}") The row sums are the model-implied one-period bond prices in each current state. -They -vary near the boundaries because the finite grid truncates and renormalizes the +They vary near the boundaries because the finite grid truncates and renormalizes the conditional transition probabilities. +The middle-state rate printed above happens to equal $\rho$ only because this calibration +satisfies $\mu = \tfrac{1}{2}\sigma^2(1+\gamma)$, which holds at $\mu = 0.08$, +$\sigma = 0.2$ and $\gamma = 3$. + +It is a coincidence of the numbers chosen here, not a check on the code or a general +property. + ### Applying the recovery theorem The Recovery Theorem requires computing the **Perron eigenvector** of $P$. @@ -684,7 +697,13 @@ def recover_natural_distribution(P, tol=1e-10): if np.mean(z_candidate) < 0: z_candidate = -z_candidate - if β_candidate > 0 and np.all(z_candidate > tol): + # eig returns eigenvectors of unit Euclidean norm, so the smallest entry + # of a legitimately positive z can be far below any absolute threshold + # (it is of order e^{-2γ n_σ σ√T} here). We therefore rescale and test + # the sign, which makes the test invariant to the eigenvector's scale. + z_candidate = z_candidate / np.max(np.abs(z_candidate)) + + if β_candidate > 0 and np.all(z_candidate > 0): β_recovered = β_candidate z = z_candidate break @@ -777,7 +796,7 @@ probabilities overweight bad states and underweight good states relative to the measure. We first plot the natural distribution against the risk-neutral one and the recovered -relative pricing kernel +relative pricing kernel. ```{code-cell} ipython3 mid = len(states) // 2 @@ -808,7 +827,7 @@ axes[1].set_title('recovered relative pricing kernel') plt.show() ``` -The CDF clearly shows the first-order stochastic dominance +The CDF clearly shows the first-order stochastic dominance. ```{code-cell} ipython3 cdf_nat = np.cumsum(f_nat) @@ -826,10 +845,10 @@ print(f"Natural CDF <= Risk-neutral CDF at all states: " f"{np.all(cdf_nat <= cdf_rn + 1e-10)}") ``` -The gap between the two CDFs is generated by the slope of the pricing kernel. +The gap between the two CDFs is generated by the slope of the pricing kernel. -In the -CRRA benchmark, this slope is controlled by the risk-aversion coefficient $\gamma$. +In the CRRA benchmark, this slope is controlled by the risk-aversion coefficient +$\gamma$. We next vary $\gamma$ to see how the recovered kernel and the natural/risk-neutral wedge change. @@ -842,6 +861,14 @@ probabilities, depends on the coefficient of risk aversion $\gamma$. We illustrate this by plotting the relative pricing kernel $1/z$ and the gap between the natural and risk-neutral densities for a range of values of $\gamma$. +The left panel uses a logarithmic vertical axis because $1/z$ spans about seven orders of +magnitude across these values of $\gamma$, so on a linear axis the curves for small +$\gamma$ would be flat against the horizontal axis and invisible. + +On the log axis the economic content is immediate: since $1/z_j = e^{-\gamma s_j}$ +exactly, $\log (1/z_j)$ is linear in the log state $s_j$ with slope $-\gamma$, so the +recovered kernel is log-linear and $\gamma$ is simply its slope. + ```{code-cell} ipython3 γs = [1.0, 2.0, 3.0, 5.0, 8.0] colors = cm.viridis(np.linspace(0.1, 0.9, len(γs))) @@ -864,6 +891,7 @@ for γ_val, color in zip(γs, colors): axes[1].plot(gross, f_nat_g - f_rn_g, color=color, lw=2, label=f'$\\gamma={γ_val:.0f}$') +axes[0].set_yscale('log') axes[0].set_xlabel('gross return') axes[0].set_ylabel('relative kernel $1/z$') axes[0].set_title('relative pricing kernel vs risk aversion') @@ -885,6 +913,16 @@ probability; above $v$ the natural probability dominates. A higher $\gamma$ amplifies this wedge. +A caution about the large-$\gamma$ cases: the one-period bond price in the middle state +rises to $1.1972$ at $\gamma = 5$ and $2.1815$ at $\gamma = 8$, implied riskless rates of +$-18\%$ and $-78\%$, and the largest row sum of $P$ reaches $3.63$. + +This is the usual CRRA precautionary-savings blow-up rather than a defect of the +recovery calculation, whose Perron root remains $e^{-\rho T}$ for every $\gamma$. + +We include these values to make the shape of the kernel visible across a wide range, not +as plausible calibrations of an actual economy. + ## Recovering the discount rate A useful by-product of the Recovery Theorem is the *recovered subjective discount @@ -929,8 +967,8 @@ One of the most striking applications of the Recovery Theorem is its ability to the market's recovered natural probability of catastrophes from the risk premium attached to them. -{cite:t}`barro2006rare` and {cite:t}`MehraPrescott1985` discuss how rare disasters might -explain the equity premium puzzle. +{cite:t}`MehraPrescott1985` posed the equity premium puzzle, and {cite:t}`barro2006rare` +argues that a small probability of rare macroeconomic disasters can help account for it. The risk-neutral probability of a large decline is elevated both because (a) the market assigns a high natural probability to such events and (b) the pricing kernel upweights @@ -983,9 +1021,8 @@ This is a simulation illustrating Ross's decomposition. The risk-neutral density assigns higher probability to large drops than the recovered natural density. -In this CRRA -simulation, increasing risk aversion makes the risk-neutral crash probability rise -faster than the recovered natural crash probability. +In this CRRA simulation, increasing risk aversion makes the risk-neutral crash +probability rise faster than the recovered natural crash probability. We will say more in {ref}`rt_ex3`. @@ -1059,17 +1096,17 @@ If a trading strategy has a very high Sharpe ratio, then some pricing kernel mus volatile enough to price that payoff. The Hansen--Jagannathan bound {cite}`Hansen_Jagannathan_1991` says that, for any excess -return with mean $\mu_\text{excess}$ and standard deviation $\sigma_\text{asset}$, +return with mean $\mu_\text{excess}$ and standard deviation $\sigma_\text{excess}$, $$ -\frac{|\mu_\text{excess}|}{\sigma_\text{asset}} \leq e^{rT}\, \sigma(M), +\frac{|\mu_\text{excess}|}{\sigma_\text{excess}} \leq e^{rT}\, \sigma(\phi), $$ -where $M$ is the one-period stochastic discount factor and $r$ is the +where $\phi$ is the one-period pricing kernel of {eq}`eq:canon_ge` and $r$ is the continuously compounded riskless rate over horizon $T$. Ross's point is that recovery gives an estimate of the relevant volatility -$\sigma(M)$. +$\sigma(\phi)$. Hence it gives an upper bound on the Sharpe ratio of any strategy based on the same stock-market information used in recovery. @@ -1093,7 +1130,7 @@ Then the $R^2$ of a forecasting regression based on $I_t$ is bounded above by th variance of the recovered kernel: $$ -R^2 \leq e^{2rT} \, \sigma^2(M). +R^2 \leq e^{2rT} \, \sigma^2(\phi). $$ Only the component of the kernel projected on this information set is relevant. @@ -1108,8 +1145,10 @@ practice. *Finite state space:* -Ross's theorem is proved for a finite-state irreducible Markov chain; bounded -continuous-state recovery requires additional results in {doc}`misspecified_recovery`. +Ross's theorem is proved for a finite-state irreducible Markov chain. + +Recovery on a continuous state space requires a boundedness or compactness restriction: +{cite:t}`CarrYu2012`, discussed below, establish recovery for a bounded diffusion. In continuous, unbounded state spaces (e.g., a lognormal diffusion), uniqueness fails because any exponential $e^{\alpha x}$ satisfies the characteristic equation. @@ -1151,12 +1190,23 @@ unique positive eigenvector. If the kernel is not transition independent, recovery is not guaranteed. -{cite:t}`BorovickaHansenScheinkman2016` show that the Ross recovery can confound the +{cite:t}`BorovickaHansenScheinkman2016` show that Ross recovery can confound the long-run risk component of the kernel with the natural probability distribution, yielding an incorrect decomposition. We discuss this in the sequel lecture {doc}`misspecified_recovery`. +```{seealso} +{doc}`long_run_risk_operator` develops the general operator treatment of this problem, +in which the principal eigenfunction of the pricing operator and the resulting +multiplicative martingale factorization of the stochastic discount factor are precisely +what transition independence assumes away. + +Be warned that the symbol $\phi$ denotes the pricing kernel in the present lecture but +the principal eigenfunction there; it is this lecture's eigenvector $z$ that plays the +role of that lecture's $\phi$. +``` + *Empirical estimation:* Extracting reliable state prices from observed option prices requires careful @@ -1253,7 +1303,7 @@ print(f"Decreasing: {φ_relative_ex[0] > φ_relative_ex[1] > φ_relative_ex[2]}" **Stochastic dominance.** -Using the recovered $F$ and the normalised risk-neutral matrix $Q = P / \text{row sums}$ +Using the recovered $F$ and the normalized risk-neutral matrix $Q = P / \text{row sums}$ from the exercise above: 1. Compute the one-step marginal distributions $f_j = F_{2,j}$ and $q_j = Q_{2,j}$