46. Rational Inattention and Endogenous Information#

46.1. Overview#

An observer in A First Look at the Kalman Filter tracks a hidden state through a signal whose precision the modeler hands him.

Sims [2003] let the decision maker choose that precision and constrained how much information he could process.

He wanted to explain why decision makers respond to shocks slowly and partially, as aggregate consumption, prices, and investment do in the data, without assuming that they pay adjustment costs or form expectations badly.

A decision maker who cannot measure everything measures precisely the directions that carry most of his loss and leaves the rest noisy, so his actions respond to a shock only as his estimate of it improves.

Turmuhambetova [2005] wrote the choice as a control problem, proved that a separation property survives it, and computed the price the decision maker pays in units of Shannon’s mutual information.

This lecture poses her problem, solves it, and reports its two answers.

The first answer tells the decision maker how precisely to measure the hidden state.

He drives the conditional variance of each payoff-relevant direction down to a level proportional to the price of information and inversely proportional to the loss that a unit of conditional variance in that direction inflicts through his action.

He measures a direction not at all when its prior variance already lies below that level.

The second answer tells him what to measure.

He whitens the state by its prior covariance \(\Sigma\) and measures the eigenvectors of \(\Sigma^{1/2} Q \Sigma^{1/2}\), where \(Q\) measures the loss that a unit of conditional variance inflicts through his action.

Those eigenvectors are in general neither the eigenvectors of \(\Sigma\) nor the eigenvectors of \(Q\).

Both answers follow from the separation property that Wonham [1968] proved for linear-quadratic control problems with exogenous signals and that Turmuhambetova [2005] extended to problems in which the decision maker chooses the signal.

Separation makes the conditional mean and the conditional covariance of the hidden state sufficient for the decision maker’s choices.

The conditional covariance then evolves without reference to the realized data, so the attention plan solves a deterministic control problem.

The lecture proceeds as follows.

Three control problems poses the full information, partial information, and endogenous information problems.

Measuring the flow of information prices a signal with Shannon’s mutual information.

The filter and the information bill writes the recursions that the price applies to.

Separation states the property that makes the conditional mean and covariance sufficient.

Signals and measurement errors reads the choice of a signal as the choice of a measurement error.

What imprecision costs derives the loss that an imprecise estimate inflicts on a decision maker who faces a quadratic return.

How precisely to measure answers the first question, and What to measure answers the second.

The frontier traces the curve between information bought and loss borne.

The dynamic problem lets precision bought today lower tomorrow’s prior covariance.

Turmuhambetova’s continuous-time rate recovers her formulas as the period shrinks.

Turmuhambetova’s applications reports her permanent income and portfolio results.

Attention and robustness compares her decision maker with the robust decision maker of Robust Consumption Smoothing and Precautionary Savings and Robust Permanent Income and Pricing.

An Inattentive Permanent Income Consumer carries the apparatus into the permanent income model of The LQ Permanent Income Model, where the rank bound (46.15) leaves the consumer one number to buy and a closed-form price at which he stops buying it.

46.1.1. Information as a priced good#

Information Projections shows that mutual information is the KL divergence of a joint distribution from the product of its marginals, and so is the value of an m-projection.

Sims [2003] and Turmuhambetova [2005] charge the decision maker that divergence.

The decision maker therefore buys divergence and must decide which directions of the state space to spend it on.

Information Projections prices mutual information the same way, in its entropy-regularized transport problem, where a dispatcher pays a price per nat of information that the destination of a unit carries about its origin.

There the decision maker chooses a joint distribution of origins and destinations.

Matching a Ramsey Model to a Descriptive Model computes an m-projection of the same kind for an econometric problem, projecting the distribution that a stochastic growth model implies for growth rates onto a five-parameter family of Gaussian distributions.

That projection sits at a boundary of the family, where the first-order condition in one parameter becomes an inequality, as (46.19) does in the directions that the decision maker here leaves unmeasured.

46.2. Three control problems#

Turmuhambetova [2005] poses three problems in continuous time.

We pose them in discrete time, because A First Look at the Kalman Filter and LQ Control: Foundations work in discrete time, and we recover her continuous-time formulas in a later section.

A hidden state \(z_t \in \mathbb{R}^n\) evolves as

(46.1)#\[z_{t+1} = A z_t + C w_{t+1}, \qquad w_{t+1} \sim \mathcal{N}(0, I_k) ,\]

with \(z_0 \sim \mathcal{N}(\bar z_0, \Sigma_0)\), where \(\bar z_0\) is the prior mean and \(\Sigma_0\) the prior covariance.

The eigenvalues of \(A\) determine the persistence of \(z\); the matrix \(C\) describes how the \(k\)-dimensional shocks \(w_{t+1}\) impinge on \(z\) at time \(t+1\).

A decision maker chooses actions \(u_t\) and receives the discounted return \(E \sum_{t \geq 0} \beta^t U(u_t, z_t)\).

In the full information problem he observes \(z_t\) before choosing \(u_t\).

In the partial information problem he observes a signal

\[ s_t = D z_t + \varepsilon_t , \qquad \varepsilon_t \sim \mathcal{N}(0, \Sigma_{ss}) , \]

whose matrix \(D\) and noise covariance \(\Sigma_{ss}\) the modeler fixes.

In the endogenous information problem he observes an additional signal

(46.2)#\[y_t = G_t z_t + v_t , \qquad v_t \sim \mathcal{N}(0, I_m) ,\]

and he chooses the matrix \(G_t\).

The rows of \(G_t\) name the linear combinations of \(z_t\) that the decision maker measures, and the scale of each row sets how precisely he measures it.

He pays a price \(\theta > 0\) per unit of information that \(y_t\) carries about \(z_t\).

Sims [2003] constrains the decision maker’s capacity instead of charging him, and Exercise 46.1 shows that \(\theta\) is the multiplier on a capacity constraint in the one-period problem.

His problem is

(46.3)#\[\max_{\{u_t, G_t\}} E \sum_{t \geq 0} \beta^t \bigl[ U(u_t, z_t) - \theta \, \mathcal{I}_t \bigr] ,\]

where \(\mathcal{I}_t\) is the information that \(y_t\) delivers about \(z_t\) beyond what the decision maker already has, defined in the next section.

The three problems bound the decision maker’s welfare from above and below: the full information problem gives him more than he can buy, the partial information problem gives him only what the modeler hands him, and the endogenous information problem places him between the two at a position that \(\theta\) selects.

Turmuhambetova [2005] restricts the decision maker to Gaussian channels, and so do we.

The optimal channel among all channels depends on the form of \(U\), and Turmuhambetova [2005] does not construct it.

46.3. Measuring the flow of information#

Shannon [1948] measured the uncertainty in a random vector \(Z\) with density \(p\) by its entropy \(H(Z) = -E[\log p(Z)]\) and the information that \(Y\) carries about \(Z\) by

(46.4)#\[I(Z; Y) = H(Z) - H(Z \mid Y) .\]

Information Projections writes the same quantity as a KL divergence,

\[ I(Z; Y) = D\bigl( p_{Z,Y} \, \| \, p_Z \, p_Y \bigr) , \]

the divergence of the joint distribution of \((Z,Y)\) from the product of its marginals, which is the divergence attained by the m-projection of \(p_{Z,Y}\) onto the family of distributions that make \(Z\) and \(Y\) independent.

A channel of capacity \(\kappa = \max I(Z;Y)\) transmits a source of entropy rate \(H < \kappa\) with arbitrarily small error frequency, and no coding achieves \(H(Z \mid Y) < H - \kappa\).

Shannon’s coding theorem makes mutual information the rate at which a physical channel can carry a source.

No other measure of statistical dependence bounds what a physical channel can carry.

For jointly normal \(Z\) and \(Y\),

(46.5)#\[I(Z;Y) = \tfrac{1}{2} \bigl( \log \det \operatorname{Var}(Z) - \log \det \operatorname{Var}(Z \mid Y) \bigr) .\]

The volume of the covariance ellipsoid of \(Z\) is proportional to \(\sqrt{\det \operatorname{Var}(Z)}\), so the decision maker pays the logarithm of the factor by which the signal shrinks that volume.

46.4. The filter and the information bill#

Write \(\mathcal{F}_t\) for what the decision maker has seen through date \(t\), the date-\(t\) signals included.

Write \(\Sigma_t = \operatorname{Var}(z_t \mid \mathcal{F}_{t-1})\) for the covariance of the hidden state before he sees the date-\(t\) signals and \(\hat\Sigma_t = \operatorname{Var}(z_t \mid \mathcal{F}_t)\) for the covariance after he sees them.

Bayes’s rule for jointly normal vectors adds the precision that each conditionally independent signal contributes to the precision of the prior.

Writing \(K_t = G_t^\top G_t\) for the precision that the endogenous signal contributes,

(46.6)#\[\hat\Sigma_t^{-1} = \Sigma_t^{-1} + D^\top \Sigma_{ss}^{-1} D + K_t ,\]

and the state recursion (46.1) carries the covariance forward,

(46.7)#\[\Sigma_{t+1} = A \hat\Sigma_t A^\top + C C^\top .\]

Equations (46.6) and (46.7) are the Kalman recursions of A First Look at the Kalman Filter, with \(K_t\) chosen rather than given.

A First Look at the Kalman Filter writes the updating step with a gain matrix instead of with precisions, and the Woodbury identity turns its form into (46.6).

We set \(D = 0\) in what follows, so that the endogenous signal is the decision maker’s only source of information.

The decision maker’s choice enters only through \(K_t\), and \(K_t = G_t^\top G_t\) is positive semidefinite of rank at most \(m\).

Letting him choose the number of rows \(m\) of \(G_t\) makes the attainable posteriors exactly the \(\hat\Sigma_t\) that satisfy \(0 \prec \hat\Sigma_t \preceq \Sigma_t\).

Substituting (46.6) into (46.5) prices the signal,

(46.8)#\[\mathcal{I}_t = \tfrac{1}{2} \log \det \bigl( I + \Sigma_t K_t \bigr) = \tfrac{1}{2} \bigl( \log \det \Sigma_t - \log \det \hat\Sigma_t \bigr) .\]

We call \(\theta \mathcal{I}_t\) the information bill.

A decision maker who also sees an exogenous signal pays (46.8) with \(\Sigma_t\) replaced by the posterior that the exogenous signal alone delivers.

Natural logarithms put \(\mathcal{I}_t\) in nats, and \(\log 2\) nats make one bit.

Sims [2003] quotes capacities in bits.

Three expressions for the bill agree.

rng = np.random.default_rng(0)
n, m = 3, 2
root = rng.normal(size=(n, n))
Σ = root @ root.T + 0.3 * np.eye(n)
G = rng.normal(size=(m, n))
K = G.T @ G

Σ_hat = np.linalg.inv(np.linalg.inv(Σ) + K)

print(f"from the two determinants  {0.5 * (np.linalg.slogdet(Σ)[1] - np.linalg.slogdet(Σ_hat)[1]):.10f}")
print(f"as log det(I + Σ K)       {0.5 * np.linalg.slogdet(np.eye(n) + Σ @ K)[1]:.10f}")
print(f"as log det(I + G Σ G')    {0.5 * np.linalg.slogdet(np.eye(m) + G @ Σ @ G.T)[1]:.10f}")
from the two determinants  1.5386610446
as log det(I + Σ K)       1.5386610446
as log det(I + G Σ G')    1.5386610446

The third expression is \(m \times m\) rather than \(n \times n\), which matters when the decision maker measures few combinations of a long state vector.

46.5. Separation#

Wonham [1968] proved that a decision maker who faces an exogenous linear Gaussian signal and a quadratic return can restrict attention to controls that depend on the conditional mean of the hidden state.

A decision maker who chooses his own signal threatens that conclusion, because his choice of \(G_t\) changes the information he will have, and he might use the choice to manufacture a filtration that a mean and a covariance fail to summarize.

Turmuhambetova [2005] proved that he gains nothing by doing so.

Her Theorem 5.8 states that the supremum over controls adapted to the observed history equals the supremum over controls adapted to the observed state, the exogenous signal, and the filtered mean \(\hat z_t\), and her proof follows Miller and Runggaldier [1997].

Setting \(D = 0\) leaves \((\hat z_t, \hat\Sigma_t)\).

The proof inverts the filter: from the recursions for \(\hat z\) and for the observed state she recovers the innovations, so the two filtrations coincide.

Another Look at the Kalman Filter constructs an innovations representation and The Kalman Filter and Vector Autoregressions derives one.

Her theorem requires a positive definite initial conditional covariance, which keeps the inversion well defined.

She requires the state to evolve linearly in \(z\), the covariance of its shocks not to depend on \(z\), and the conditional distribution of \(z\) to be Gaussian.

She does not require \(U\) to be quadratic, and in her applications it is not.

The posterior covariance \(\hat\Sigma_t\) enters the decision maker’s problem as a state, and the recursions (46.6) and (46.7) move it without reference to the realized signals.

The attention plan therefore solves a deterministic control problem in the covariance matrix.

46.6. Signals and measurement errors#

Turmuhambetova [2005] gives her problem a second reading, in her Section 6.

Let the decision maker observe \(\tilde y_t = z_t + \tilde v_t\) with \(\tilde v_t \sim \mathcal{N}(0, \Sigma_{yy})\), and let him choose the covariance \(\Sigma_{yy}\) of his own measurement error.

The two problems coincide under

(46.9)#\[\Sigma_{yy}^{-1} = G_t^\top G_t = K_t .\]

A decision maker who buys capacity and a decision maker who buys accurate instruments solve the same problem.

The second reading connects the problem to A First Look at the Kalman Filter directly: the decision maker runs a Kalman filter whose signal-to-noise ratio he selects, and he pays for the selection.

A singular \(K_t\) of rank \(r < n\) corresponds to a measurement error with infinite variance in \(n - r\) directions, which is to say that the decision maker ignores those directions entirely.

46.7. What imprecision costs#

Separation lets us study the attention plan without carrying the action \(u_t\) along, once we know what imprecision costs.

Let the return be quadratic, \(U(u_t, z_t) = -(z_t^\top R z_t + u_t^\top H u_t)\) with \(R \succeq 0\) and \(H \succ 0\), and let the action move the state,

(46.10)#\[z_{t+1} = A z_t + B u_t + C w_{t+1} .\]

We write \(H\) for the matrix that LQ Control: Foundations calls \(Q\), because \(Q\) here denotes the weight that (46.13) puts on the conditional covariance, and Shannon’s entropy \(H(\cdot)\) carries an argument where this \(H\) does not.

Let \(P\) solve the Riccati equation of LQ Control: Foundations,

(46.11)#\[P = R + \beta A^\top P A - \beta^2 A^\top P B (H + \beta B^\top P B)^{-1} B^\top P A ,\]

and let \(F = \beta (H + \beta B^\top P B)^{-1} B^\top P A\) be the feedback matrix that \(P\) delivers.

Maximizing \(U\) is minimizing the loss \(z_t^\top R z_t + u_t^\top H u_t\), and we work with the loss from here on.

A decision maker who observes \(z_t\) sets \(u_t = -F z_t\) and bears the expected loss

(46.12)#\[L_{\text{full}} = \bar z_0^\top P \bar z_0 + \operatorname{tr}(P \Sigma_0) + \frac{\beta}{1 - \beta} \operatorname{tr}(P C C^\top) ,\]

where the expectation runs over the date-zero prior \(z_0 \sim \mathcal{N}(\bar z_0, \Sigma_0)\), and where LQ Control: Foundations derives the last term as the price of the shocks \(C w_{t+1}\).

A decision maker who observes only his own signals sets \(u_t = -F \hat z_t\) and bears

(46.13)#\[L_{\text{full}} + \sum_{t \geq 0} \beta^t \operatorname{tr}(Q \hat\Sigma_t) , \qquad Q = R + \beta A^\top P A - P .\]

Separation, not certainty equivalence, licenses \(u_t = -F \hat z_t\).

Wonham [1968] leaves \(F\) unchanged and replaces \(z_t\) by its conditional mean, while LQ Control: Foundations reserves the term certainty equivalence for a different property, that \(F\) does not depend on \(C\).

The term \(L_{\text{full}}\) does not involve the attention plan, so \(\operatorname{tr}(Q \hat\Sigma_t)\) is the entire price of imprecision.

The sum converges when \(\beta \rho(A)^2 < 1\), which a decision maker who buys little precision needs, because \(\Sigma_t\) then grows like \(A^t \Sigma_0 (A^\top)^t\).

Four steps deliver (46.13).

First, write \(e_t = z_t - \hat z_t\) for the filtering error.

Because \(\hat z_t\) is a conditional expectation, \(e_t\) is orthogonal to every function of \(\mathcal{F}_t\) and in particular to \(\hat z_t\), so \(E[z_t^\top R z_t] = E[\hat z_t^\top R \hat z_t] + \operatorname{tr}(R \hat\Sigma_t)\).

The same orthogonality splits the loss at every date into a part that the decision maker’s own estimate carries and a part that his error carries.

Second, the filtered mean follows \(\hat z_{t+1} = (A - BF) \hat z_t + \eta_{t+1}\), where \(\eta_{t+1}\) is the news that the date-\((t+1)\) signal delivers.

The law of total variance, \(\Sigma_{t+1} = \hat\Sigma_{t+1} + \operatorname{Var}(\hat z_{t+1} \mid \mathcal{F}_t)\), gives \(\eta_{t+1}\) the covariance \(\Sigma_{t+1} - \hat\Sigma_{t+1}\).

The same identity at date zero gives \(\hat z_0\) the mean \(\bar z_0\) and the variance \(\Sigma_0 - \hat\Sigma_0\).

Third, the problem in \(\hat z\) carries the same \(A\), \(B\), \(R\), and \(H\) as the full-information problem, so \(F\) solves it too and its value is

\[ \bar z_0^\top P \bar z_0 + \operatorname{tr}\bigl(P (\Sigma_0 - \hat\Sigma_0)\bigr) + \sum_{t \geq 0} \beta^{t+1} \operatorname{tr}\bigl(P (\Sigma_{t+1} - \hat\Sigma_{t+1})\bigr) . \]

Fourth, add \(\sum_t \beta^t \operatorname{tr}(R \hat\Sigma_t)\) from the first step.

The terms in \(P\) telescope: \(-\operatorname{tr}(P \hat\Sigma_0) - \sum_{t \geq 0} \beta^{t+1} \operatorname{tr}(P \hat\Sigma_{t+1})\) collects into \(-\sum_{t \geq 0} \beta^t \operatorname{tr}(P \hat\Sigma_t)\).

Substituting \(\Sigma_{t+1} = A \hat\Sigma_t A^\top + C C^\top\) turns \(\sum_{t \geq 0}\beta^{t+1}\operatorname{tr}(P\Sigma_{t+1})\) into \(\sum_{t \geq 0}\beta^{t+1}\operatorname{tr}(A^\top PA\,\hat\Sigma_t)\) plus the geometric sum \(\tfrac{\beta}{1-\beta}\operatorname{tr}(PCC^\top)\).

The coefficient on \(\hat\Sigma_t\) is then \(R - P + \beta A^\top P A\), which is \(Q\).

The Riccati equation (46.11) writes that coefficient two more ways,

(46.14)#\[Q = \beta^2 A^\top P B (H + \beta B^\top P B)^{-1} B^\top P A = \beta A^\top P B F ,\]

so \(Q \succeq 0\) without further assumption.

Substituting \(A^\top P B = \beta^{-1} F^\top(H + \beta B^\top P B)\) into (46.14) writes it a third way,

(46.15)#\[Q = F^\top (H + \beta B^\top P B) F ,\]

which bounds the rank of \(Q\) by the number of controls, because \(H + \beta B^\top PB\) is positive definite and carries the dimension of \(u_t\).

A decision maker with \(m\) controls therefore buys information about at most \(m\) linear combinations of the state, however large \(n\) is, and those combinations are the rows of his own decision rule.

An Inattentive Permanent Income Consumer works out the case \(m = 1\), where the single combination he buys is his own wealth.

\(Q\) vanishes when \(B = 0\).

A decision maker who cannot act on what he learns buys no information, however uncertain he is about \(z_t\).

\(Q\) therefore weights a direction of the state by the loss that a unit of conditional variance in it inflicts through the action, and not by the weight that \(R\) gives it.

def riccati(A, B, R, H, β, tol=1e-15, max_iter=200_000):
    """Iterate the Riccati equation and return P and the feedback gain F."""
    P = R.copy()
    for _ in range(max_iter):
        S = H + β * B.T @ P @ B
        P_new = R + β * A.T @ P @ A - β**2 * A.T @ P @ B @ np.linalg.solve(S, B.T @ P @ A)
        if np.max(np.abs(P_new - P)) < tol:
            P = P_new
            break
        P = P_new
    return P, β * np.linalg.solve(H + β * B.T @ P @ B, B.T @ P @ A)

rng = np.random.default_rng(7)
A_lq = rng.normal(size=(3, 3)) * 0.4 + np.diag([0.8, 0.5, 0.9])
B_lq = rng.normal(size=(3, 2)) * 0.6
C_lq = rng.normal(size=(3, 2)) * 0.5
R_lq, H_lq, β_lq = np.diag([1.0, 2.0, 0.5]), np.eye(2) * 0.7, 0.95

P_lq, F_lq = riccati(A_lq, B_lq, R_lq, H_lq, β_lq)
Q_lq = R_lq + β_lq * A_lq.T @ P_lq @ A_lq - P_lq
S_lq = H_lq + β_lq * B_lq.T @ P_lq @ B_lq

print(f"eigenvalues of Q: {np.round(np.linalg.eigvalsh(Q_lq), 6)}")
print(f"Q equals β A'PB F:           "
      f"{np.allclose(Q_lq, β_lq * A_lq.T @ P_lq @ B_lq @ F_lq)}")
print(f"Q equals β² A'PB S^(-1) B'PA: "
      f"{np.allclose(Q_lq, β_lq**2 * A_lq.T @ P_lq @ B_lq @ np.linalg.solve(S_lq, B_lq.T @ P_lq @ A_lq))}")
eigenvalues of Q: [0.       0.121282 0.810496]
Q equals β A'PB F:           True
Q equals β² A'PB S^(-1) B'PA: True

Setting \(B = 0\) confirms it.

P_0, _ = riccati(A_lq, np.zeros((3, 1)), R_lq, np.array([[1.0]]), β_lq)
Q_0 = R_lq + β_lq * A_lq.T @ P_0 @ A_lq - P_0
print(f"with B = 0, the largest entry of Q is {np.max(np.abs(Q_0)):.2e}")
with B = 0, the largest entry of Q is 4.44e-16

Propagating the mean and variance of \(\hat z_t\) checks the telescoping of the third and fourth steps.

The check takes the first two steps for granted, because it computes the loss from \(\operatorname{tr}(R \hat\Sigma_t)\) and from \(\Sigma_{t+1} - \hat\Sigma_{t+1}\) rather than from the joint distribution of \(z_t\) and \(\hat z_t\).

def covariance_path(K, Σ_0, A, C, T):
    """Prior and posterior covariances under a constant precision K."""
    Σ, priors, posts = Σ_0.copy(), [], []
    for _ in range(T):
        priors.append(Σ)
        Σ_hat = np.linalg.inv(np.linalg.inv(Σ) + K)
        posts.append(Σ_hat)
        Σ = A @ Σ_hat @ A.T + C @ C.T
    return priors, posts

def exact_loss(K, Σ_0, zbar_0, A, B, C, R, H, β, F, T=3000):
    """Discounted loss under the policy u = -F ẑ, from first and second moments."""
    priors, posts = covariance_path(K, Σ_0, A, C, T)
    ABF, m, V, loss = A - B @ F, zbar_0.copy(), priors[0] - posts[0], 0.0
    for t in range(T - 1):
        loss += β**t * (m @ R @ m + np.trace(R @ (V + posts[t]))
                        + (F @ m) @ H @ (F @ m) + np.trace(F.T @ H @ F @ V))
        m = ABF @ m
        V = ABF @ V @ ABF.T + (priors[t + 1] - posts[t + 1])
        if β**t < 1e-14:
            break
    return loss

def decomposed_loss(K, Σ_0, zbar_0, A, C, β, P, Q, T=3000):
    """The full-information loss and the loss from imprecision."""
    _, posts = covariance_path(K, Σ_0, A, C, T)
    full = zbar_0 @ P @ zbar_0 + np.trace(P @ Σ_0) + β / (1 - β) * np.trace(P @ C @ C.T)
    return full, sum(β**t * np.trace(Q @ posts[t]) for t in range(T))

Σ_0 = np.eye(3) * 1.5
zbar_0 = np.array([1.0, -2.0, 0.5])     # a prior mean away from the origin
G_lq = rng.normal(size=(2, 3)) * 0.8

print(f"{'attention plan':<20}{'exact loss':>13}{'full info':>12}{'imprecision':>13}{'sum':>13}")
for name, K_try in (("K = G'G, rank two", G_lq.T @ G_lq),
                    ("K = 0", np.zeros((3, 3))),
                    ("K = 50 I", np.eye(3) * 50.0)):
    e = exact_loss(K_try, Σ_0, zbar_0, A_lq, B_lq, C_lq, R_lq, H_lq, β_lq, F_lq)
    f, a = decomposed_loss(K_try, Σ_0, zbar_0, A_lq, C_lq, β_lq, P_lq, Q_lq)
    print(f"{name:<20}{e:>13.6f}{f:>12.6f}{a:>13.6f}{f + a:>13.6f}")

print(f"\nthe prior mean contributes zbar_0' P zbar_0 = {zbar_0 @ P_lq @ zbar_0:.6f} to every row")
attention plan         exact loss   full info  imprecision          sum
K = G'G, rank two      131.537569  113.232373    18.305196   131.537569
K = 0                  162.305212  113.232373    49.072839   162.305212
K = 50 I               113.562865  113.232373     0.330492   113.562865

the prior mean contributes zbar_0' P zbar_0 = 13.615535 to every row

The three sums reproduce the three exact losses.

46.8. How precisely to measure#

The one-period problem that (46.13) poses is

(46.16)#\[\min_{K \succeq 0} \ \operatorname{tr}\bigl(Q (\Sigma^{-1} + K)^{-1}\bigr) + \tfrac{\theta}{2} \log \det (I + \Sigma K) .\]

Take \(\Sigma = \operatorname{diag}(\sigma_1^2, \ldots, \sigma_n^2)\) and \(Q = \operatorname{diag}(q_1, \ldots, q_n)\), and let the decision maker spend \(r_i\) nats on direction \(i\).

By (46.8), spending \(r_i\) nats shrinks the conditional variance to \(\hat\sigma_i^2 = \sigma_i^2 e^{-2 r_i}\), and (46.16) becomes

\[ \min_{r \geq 0} \ \sum_i q_i \sigma_i^2 e^{-2 r_i} + \theta \sum_i r_i . \]

The first-order condition in \(r_i\) is \(-2 q_i \sigma_i^2 e^{-2 r_i} + \theta = 0\), so

(46.17)#\[\hat\sigma_i^2 = \min\Bigl( \sigma_i^2, \ \frac{\theta}{2 q_i} \Bigr) , \qquad r_i = \max\Bigl( 0, \ \tfrac{1}{2} \log \frac{2 q_i \sigma_i^2}{\theta} \Bigr) .\]

The decision maker equalizes \(q_i \hat\sigma_i^2\) at \(\theta/2\) across the directions he measures.

He measures direction \(i\) not at all when \(2 q_i \sigma_i^2 \leq \theta\).

Rate-distortion theory calls (46.17) reverse water-filling, and Cover and Thomas [2006] derive it for a Gaussian source under a mean-squared-error criterion.

Rational inattention adds the weights \(q_i\).

The decision maker equalizes conditional variance measured in units of loss rather than conditional variance itself.

def water_fill(σ2, q, θ):
    """Posterior variances and nats spent, from the reverse water-filling rule."""
    σ2, q = np.asarray(σ2, dtype=float), np.asarray(q, dtype=float)
    post = np.minimum(σ2, θ / (2 * q))
    return post, 0.5 * np.log(σ2 / post)

σ2 = np.array([4.0, 1.0, 0.5, 0.2])
q = np.array([1.0, 3.0, 0.4, 2.0])
θ = 1.0

post, r = water_fill(σ2, q, θ)
for i in range(len(σ2)):
    print(f"direction {i}:  prior {σ2[i]:.3f}   weight {q[i]:.1f}   "
          f"nats {r[i]:.4f}   posterior {post[i]:.4f}   q*posterior {q[i]*post[i]:.4f}")
direction 0:  prior 4.000   weight 1.0   nats 1.0397   posterior 0.5000   q*posterior 0.5000
direction 1:  prior 1.000   weight 3.0   nats 0.8959   posterior 0.1667   q*posterior 0.5000
direction 2:  prior 0.500   weight 0.4   nats 0.0000   posterior 0.5000   q*posterior 0.2000
direction 3:  prior 0.200   weight 2.0   nats 0.0000   posterior 0.2000   q*posterior 0.4000

The decision maker ignores directions 2 and 3, and the product \(q_i \hat\sigma_i^2\) is \(0.5\) wherever he measures.

A general-purpose optimizer applied to (46.16) reproduces the rule.

def static_loss(r, σ2, q, θ):
    return np.sum(q * σ2 * np.exp(-2 * np.asarray(r))) + θ * np.sum(r)

res = minimize(static_loss, np.full(len(σ2), 0.1), args=(σ2, q, θ),
               bounds=[(0, None)] * len(σ2), tol=1e-14)
print(f"rule      nats {np.round(r, 6)}   loss {static_loss(r, σ2, q, θ):.10f}")
print(f"optimizer nats {np.round(res.x, 6)}   loss {res.fun:.10f}")
rule      nats [1.039721 0.89588  0.       0.      ]   loss 3.5356005055
optimizer nats [1.039721 0.89588  0.       0.      ]   loss 3.5356005055

Direction 0 has the largest prior variance and direction 1 the largest weight, and both receive attention.

Direction 3 has a larger weight than direction 0 and receives none, because its prior variance is already small enough that \(2 q_3 \sigma_3^2 = 0.8\) falls below \(\theta = 1\).

θ_grid = np.linspace(0.02, 6.0, 400)
nats = np.array([water_fill(σ2, q, t)[1] for t in θ_grid])
posts = np.array([water_fill(σ2, q, t)[0] for t in θ_grid])

fig, axes = plt.subplots(1, 2, figsize=(11, 4))
for i in range(len(σ2)):
    lab = rf"$\sigma^2={σ2[i]}$, $q={q[i]}$"
    axes[0].plot(θ_grid, nats[:, i], lw=2, label=lab)
    axes[1].plot(θ_grid, posts[:, i], lw=2, label=lab)
axes[0].set_xlabel(r"price of information $\theta$")
axes[0].set_ylabel("nats spent")
axes[1].set_xlabel(r"price of information $\theta$")
axes[1].set_ylabel("conditional variance")
axes[1].legend(fontsize=8)
plt.tight_layout()
plt.show()
_images/a3f7e609225e0e2b8026d1ab6118e62db401e1ad8a7c67e225f6e6486baec268.png

Fig. 46.1 Attention and the price of information#

Fig. 46.1 shows each direction leaving the decision maker’s attention at the price \(\theta = 2 q_i \sigma_i^2\), above which its conditional variance rests at its prior value.

46.9. What to measure#

Nothing requires \(Q\) and \(\Sigma\) to be diagonal in the same coordinates, and when they are not, the decision maker measures linear combinations of the components of \(z\).

Let \(\Sigma^{1/2}\) be the symmetric square root of \(\Sigma\) and let

(46.18)#\[\tilde Q = \Sigma^{1/2} Q \Sigma^{1/2} = U \Lambda U^\top , \qquad \Lambda = \operatorname{diag}(\lambda_1, \ldots, \lambda_n) ,\]

be its eigendecomposition.

Writing \(\Pi = \Sigma^{-1/2} \hat\Sigma \, \Sigma^{-1/2}\) for the whitened posterior, which satisfies \(0 \prec \Pi \preceq I\), the problem (46.16) becomes

\[ \min_{0 \prec \Pi \preceq I} \ \operatorname{tr}(\tilde Q \Pi) - \tfrac{\theta}{2} \log \det \Pi . \]

We write \(\Pi\) rather than \(P\), because \(P\) already solves the Riccati equation (46.11).

The objective is convex in \(\Pi\), and its gradient is \(\tilde Q - \tfrac{\theta}{2} \Pi^{-1}\).

Setting the gradient to zero gives \(\Pi = \tfrac{\theta}{2} \tilde Q^{-1}\), the matrix version of the scalar rule \(\hat\sigma_i^2 = \theta / 2 q_i\).

The constraint \(\Pi \preceq I\) binds in the directions where \(\tfrac{\theta}{2\lambda_i}\) exceeds one, and its multiplier there drives the eigenvalue of \(\Pi\) to one, so

(46.19)#\[\Pi^* = U \operatorname{diag}\bigl( \min(1, \theta / 2\lambda_i) \bigr) U^\top , \qquad \hat\Sigma^* = \Sigma^{1/2} \Pi^* \Sigma^{1/2} , \qquad K^* = \Sigma^{-1/2} \bigl( (\Pi^*)^{-1} - I \bigr) \Sigma^{-1/2} .\]

Write \(\zeta = \Sigma^{-1/2} z\) for the whitened state, whose prior covariance is \(I\) and whose loss matrix is \(\tilde Q\).

The decision maker measures the eigenvectors of \(\tilde Q\) in the whitened coordinates and spends \(\max(0, \tfrac{1}{2}\log(2\lambda_i/\theta))\) nats on the \(i\)th of them.

Collecting the rank-one terms of \(K^*\) gives

(46.20)#\[K^* = \sum_i d_i \, (\Sigma^{-1/2} u_i) (\Sigma^{-1/2} u_i)^\top , \qquad d_i = \max\Bigl( 0, \ \frac{2 \lambda_i}{\theta} - 1 \Bigr) ,\]

so the decision maker observes \(\sqrt{d_i} \, (\Sigma^{-1/2} u_i)^\top z\) for each \(i\) with \(d_i > 0\), and the rows of \(G^*\) are those vectors.

Only \(K\) enters (46.6) and (46.8), so the problem pins down \(K^*\) and leaves \(G^*\) free up to an orthogonal transformation of its rows.

Equation (46.20) picks the factorization that diagonalizes the precision in the whitened coordinates, and distinct eigenvalues \(\lambda_i\) make that factorization unique up to signs.

The rank of \(K^*\) is the number of directions with \(2\lambda_i > \theta\), and we let \(m\) in (46.2) be large enough to supply that many rows.

He measures neither the principal components of the state, which are the eigenvectors of \(\Sigma\), nor the directions that his loss function weights most heavily, which are the eigenvectors of \(Q\).

The matrix \(\tilde Q\) combines the two: its eigenvalue \(\lambda_i\) reports how much loss a direction carries after the prior covariance has scaled it.

def attention(Σ, Q, θ):
    """Solve the static problem.

    Returns the posterior covariance, the chosen precision K, the nats spent on
    each direction, the eigenvalues of Σ^(1/2) Q Σ^(1/2), and the measured
    combinations Σ^(-1/2) U as columns.
    """
    w, V = np.linalg.eigh(Σ)
    Σ_h = V @ np.diag(np.sqrt(w)) @ V.T
    Σ_mh = V @ np.diag(1 / np.sqrt(w)) @ V.T
    λ, U = np.linalg.eigh(Σ_h @ Q @ Σ_h)
    λ = np.maximum(λ, 0.0)              # eigenvalues of a positive semidefinite matrix
    measured = 2 * λ > θ                # the directions that earn any attention
    safe = np.where(measured, λ, 1.0)
    p = np.where(measured, θ / (2 * safe), 1.0)
    nats = np.where(measured, 0.5 * np.log(2 * safe / θ), 0.0)
    Π = U @ np.diag(p) @ U.T
    Σ_hat = Σ_h @ Π @ Σ_h
    K = Σ_mh @ (U @ np.diag(1 / p - 1) @ U.T) @ Σ_mh
    return Σ_hat, K, nats, λ, Σ_mh @ U       # columns are the measured combinations

A three-dimensional example compares the rule with a direct minimization over precision matrices.

rng = np.random.default_rng(5)
root_Q = rng.normal(size=(3, 3))
Q = root_Q @ root_Q.T
root_Σ = rng.normal(size=(3, 3))
Σ = root_Σ @ root_Σ.T + 0.5 * np.eye(3)
θ = 0.8

Σ_hat, K, nats, λ, dirs = attention(Σ, Q, θ)
rule_value = np.trace(Q @ Σ_hat) + 0.5 * θ * np.linalg.slogdet(np.eye(3) + Σ @ K)[1]

def value_of_factor(x):
    "Objective at K = L L', with L lower triangular read from x."
    L = np.zeros((3, 3))
    L[np.tril_indices(3)] = x
    K_try = L @ L.T
    post = np.linalg.inv(np.linalg.inv(Σ) + K_try)
    return np.trace(Q @ post) + 0.5 * θ * np.linalg.slogdet(np.eye(3) + Σ @ K_try)[1]

best = min((minimize(value_of_factor, rng.normal(size=6) * 0.7,
                     method="L-BFGS-B", tol=1e-14).fun for _ in range(30)))
print(f"eigenvalues of Σ^(1/2) Q Σ^(1/2): {np.round(λ, 5)}")
print(f"nats on each direction:           {np.round(nats, 5)}")
print(f"value from the rule {rule_value:.10f}")
print(f"value from search   {best:.10f}")
eigenvalues of Σ^(1/2) Q Σ^(1/2): [ 0.10564  3.7469  19.80993]
nats on each direction:           [0.      1.11861 1.95124]
value from the rule 3.3615151776
value from search   3.3615151776

The decision maker spends nothing on the direction whose eigenvalue falls below \(\theta/2 = 0.4\), and the rank of \(K^*\) falls to two.

The combinations he measures are the columns of \(\Sigma^{-1/2} U\), which are orthogonal in the whitened coordinates but not in the coordinates of \(z\).

Exercise 46.3 works out the two cases in which they reduce to the eigenvectors of \(\Sigma\) or of \(Q\), and Exercise 46.4 prices the restriction to the coordinates of \(z\) themselves.

unit = dirs / np.linalg.norm(dirs, axis=0)
print("measured combinations (columns), normalized:")
print(np.round(unit, 4))
print(f"\ntheir Gram matrix:\n{np.round(unit.T @ unit, 4)}")
print(f"\nrank of the chosen precision matrix: {np.linalg.matrix_rank(K, tol=1e-8)}")

d = np.maximum(0.0, 2 * λ / θ - 1)
K_rows = sum(d[i] * np.outer(dirs[:, i], dirs[:, i]) for i in range(3))
print(f"K rebuilt from its rank-one terms matches: {np.allclose(K, K_rows)}")
measured combinations (columns), normalized:
[[ 0.5988 -0.0565 -0.7262]
 [ 0.8008 -0.0101  0.5606]
 [-0.0121  0.9984 -0.398 ]]

their Gram matrix:
[[ 1.     -0.054   0.0189]
 [-0.054   1.     -0.3619]
 [ 0.0189 -0.3619  1.    ]]

rank of the chosen precision matrix: 2
K rebuilt from its rank-one terms matches: True

46.10. The frontier#

Varying \(\theta\) traces a frontier between the nats the decision maker buys and the loss he bears.

θ_f = np.exp(np.linspace(np.log(0.02), np.log(20.0), 500))
rows = [water_fill(σ2, q, t) for t in θ_f]
nats_tot = np.array([r[1].sum() for r in rows])
loss_tot = np.array([(q * r[0]).sum() for r in rows])

fig, ax = plt.subplots()
ax.plot(nats_tot, loss_tot, lw=2)
for t in (0.2, 1.0, 4.0):
    post_t, r_t = water_fill(σ2, q, t)
    ax.plot(r_t.sum(), (q * post_t).sum(), "o", ms=7)
    ax.annotate(rf"$\theta={t}$", (r_t.sum(), (q * post_t).sum()),
                textcoords="offset points", xytext=(8, 6))
ax.set_xlabel("nats bought")
ax.set_ylabel(r"loss $\operatorname{tr}(Q \hat\Sigma)$")
plt.tight_layout()
plt.show()
_images/60f1454d8ad974044a7afb34c6ac43474942da356ad8921ab4b95422a966a407.png

Fig. 46.2 Information bought against loss borne#

Fig. 46.2 draws it, and rate-distortion theory calls it the rate-distortion function.

Information Projections traces the same curve for its entropy-regularized transport problem, where a dispatcher who pays a price per nat faces a convex frontier between expected shipping cost and the mutual information of his plan, with slope the negative of that price.

Blackwell’s Theorem on Comparing Experiments describes the information bottleneck, which trades one mutual information against another, the information a representation carries about an input against the information it carries about a target, so its vertical axis measures information rather than loss.

The frontier falls with slope \(-\theta\) at the allocation that the price \(\theta\) selects.

Both \(\sum_i r_i\) and \(\sum_i q_i \hat\sigma_i^2\) move with \(\theta\) only through the directions the decision maker measures, and (46.17) gives each measured direction \(\partial (q_i \hat\sigma_i^2) / \partial\theta = 1/2\) and \(\partial r_i / \partial\theta = -1/(2\theta)\).

h = 1e-6
total_loss = lambda t: (q * water_fill(σ2, q, t)[0]).sum()
total_nats = lambda t: water_fill(σ2, q, t)[1].sum()

print(f"{'θ':>7}{'nats':>9}{'loss':>9}{'slope':>11}{'-θ':>9}")
for t in (0.3, 0.9, 1.0, 2.5):
    slope = (total_loss(t + h) - total_loss(t - h)) / (total_nats(t + h) - total_nats(t - h))
    print(f"{t:>7.2f}{total_nats(t):>9.4f}{total_loss(t):>9.4f}{slope:>11.6f}{-t:>9.4f}")
      θ     nats     loss      slope       -θ
   0.30   3.7738   0.6000  -0.300000  -0.3000
   0.90   2.0410   1.5000  -0.900000  -0.9000
   1.00   1.9356   1.6000  -1.000000  -1.0000
   2.50   1.0193   3.1000  -2.500000  -2.5000

46.11. The dynamic problem#

Precision bought at \(t\) lowers the prior covariance at \(t+1\) through (46.7), so a decision maker who looks ahead buys more of it than the static rule (46.17) prescribes.

Take \(A = \operatorname{diag}(a_1, \ldots, a_n)\), \(CC^\top = \operatorname{diag}(c_1^2, \ldots, c_n^2)\), and \(Q = \operatorname{diag}(q_1, \ldots, q_n)\).

The components of \(z\) then evolve independently, the covariances stay diagonal, and the problem separates into \(n\) scalar problems.

The three assumptions restrict the problem rather than normalize it.

Equation (46.14) builds \(Q\) from \(A^\top P B (H + \beta B^\top PB)^{-1} B^\top P A\), which is not diagonal for a generic \(B\) even when \(R\) and \(A\) are, so a decision maker who faces (46.10) usually solves a matrix problem in \(\hat\Sigma_t\) rather than \(n\) scalar problems.

We take the separable case to isolate the effect of persistence.

Fix one component, drop its subscript, and write \(h_t\) for its posterior variance and \(\sigma_t^2 = a^2 h_{t-1} + c^2\) for its prior variance.

The decision maker solves

(46.21)#\[V(\sigma^2) = \min_{0 < h \leq \sigma^2} \ q h + \tfrac{\theta}{2} \bigl( \log \sigma^2 - \log h \bigr) + \beta V(a^2 h + c^2) .\]

Where the constraint \(h \leq \sigma^2\) slackens at every date, \(\sigma^2\) enters (46.21) only through \(\tfrac{\theta}{2}\log\sigma^2\), so the envelope condition gives \(V'(\sigma^2) = \theta / (2 \sigma^2)\).

Where the constraint binds, \(\sigma^2\) also enters through the choice set and \(V'(\sigma^2) = q + \beta a^2 V'(a^2 \sigma^2 + c^2)\) instead.

Differentiating (46.21) at an interior \(h\) and using the envelope condition gives the Euler equation

(46.22)#\[q - \frac{\theta}{2 h_t} + \frac{\beta \theta a^2}{2 (a^2 h_t + c^2)} = 0 .\]

The third term is the saving that precision today delivers tomorrow, and it rises with \(a^2\).

Equation (46.22) is a quadratic in \(h_t\) that does not involve \(t\), so the decision maker holds the posterior variance at

(46.23)#\[2 q a^2 (h^*)^2 + \bigl[ 2 q c^2 - \theta a^2 (1 - \beta) \bigr] h^* - \theta c^2 = 0\]

from the first period in which \(\sigma_t^2 \geq h^*\).

The quadratic has one positive root, because \(c^2 > 0\) makes its leading coefficient positive and its constant term negative.

Setting \(\beta = 0\) or \(a = 0\) in (46.22) returns the static rule \(h = \theta / 2q\).

def steady_state(a, c2, q, θ, β):
    """Posterior variance that the Euler equation holds fixed."""
    if a == 0:
        return min(c2, θ / (2 * q))
    k2 = 2 * q * a**2                             # coefficients of the quadratic
    k1 = 2 * q * c2 - θ * a**2 * (1 - β)
    k0 = -θ * c2
    h = (-k1 + np.sqrt(k1 * k1 - 4 * k2 * k0)) / (2 * k2)
    return min(h, c2 / (1 - a**2)) if a**2 < 1 else h

c2, q, θ, β = 1.0, 1.0, 1.0, 0.95
for a in (0.0, 0.5, 0.9, 0.99):
    h = steady_state(a, c2, q, θ, β)
    prior = a**2 * h + c2
    print(f"a = {a:4.2f}:  prior {prior:.5f}   posterior {h:.5f}   "
          f"nats {0.5*np.log(prior/h):.5f}   static rule would give {min(prior, θ/(2*q)):.5f}")
a = 0.00:  prior 1.00000   posterior 0.50000   nats 0.34657   static rule would give 0.50000
a = 0.50:  prior 1.11295   posterior 0.45179   nats 0.45077   static rule would give 0.50000
a = 0.90:  prior 1.31323   posterior 0.38670   nats 0.61129   static rule would give 0.50000
a = 0.99:  prior 1.36545   posterior 0.37287   nats 0.64900   static rule would give 0.50000

A decision maker facing a nearly permanent component spends almost twice the nats that a decision maker facing a serially independent component spends, and he holds its conditional variance a quarter lower.

Value iteration on (46.21) confirms the steady state and delivers the policy function.

def solve_scalar(a, c2, q, θ, β, n_grid=600, tol=1e-12, max_iter=5000):
    """Value iteration for the dynamic program on a log grid of prior variances."""
    lo, hi = 0.05 * c2, 40.0 * c2 / max(1e-3, 1 - min(a**2, 0.999))
    grid = np.exp(np.linspace(np.log(lo), np.log(hi), n_grid))
    V = np.zeros(n_grid)
    choice = np.empty(n_grid)
    for _ in range(max_iter):
        V_new = np.empty(n_grid)
        for j, σ2 in enumerate(grid):
            cand = grid[grid <= σ2]
            if cand.size == 0:
                cand = np.array([σ2])
            nxt = np.interp(a**2 * cand + c2, grid, V)
            vals = q * cand + 0.5 * θ * (np.log(σ2) - np.log(cand)) + β * nxt
            k = int(np.argmin(vals))
            V_new[j], choice[j] = vals[k], cand[k]
        if np.max(np.abs(V_new - V)) < tol:
            V = V_new
            break
        V = V_new
    return grid, V, choice

grid, V, policy = solve_scalar(0.9, c2, q, θ, β)
h_closed = steady_state(0.9, c2, q, θ, β)
σ2_closed = 0.9**2 * h_closed + c2
print(f"closed-form steady state:        posterior {h_closed:.5f}, prior {σ2_closed:.5f}")
print(f"policy at the closed-form prior: posterior {np.interp(σ2_closed, grid, policy):.5f}")
closed-form steady state:        posterior 0.38670, prior 1.31323
policy at the closed-form prior: posterior 0.38763

The grid search lands within a grid spacing of the closed form.

a_grid = np.linspace(0.0, 0.995, 300)
rows = np.array([[steady_state(a, c2, q, θ, β) for a in a_grid],
                 [steady_state(a, c2, q, θ, 0.0) for a in a_grid]])
priors = a_grid**2 * rows + c2

fig, axes = plt.subplots(1, 2, figsize=(11, 4))
for k, (lab, style) in enumerate(((rf"$\beta={β}$", "-"), (r"$\beta=0$", "--"))):
    axes[0].plot(a_grid, rows[k], style, lw=2, label=lab)
    axes[1].plot(a_grid, 0.5 * np.log(priors[k] / rows[k]), style, lw=2, label=lab)
axes[0].set_xlabel(r"persistence $a$")
axes[0].set_ylabel("conditional variance")
axes[0].legend()
axes[1].set_xlabel(r"persistence $a$")
axes[1].set_ylabel("nats per period")
plt.tight_layout()
plt.show()
_images/da8326cd548b842e2cdd0de026b1d81bde11f51bd7f25d044ae5dcfc05fd2244.png

Fig. 46.3 Attention and persistence#

Fig. 46.3 compares two discount factors.

A decision maker who discounts the future completely, at \(\beta = 0\), holds the conditional variance at \(\theta/2q\) whatever the persistence, and spends more nats on a persistent component only because its prior variance is larger.

A decision maker who does not discount completely holds a persistent component’s conditional variance below \(\theta/2q\).

Persistence, the weight \(q\), and the shock variance \(c^2\) each move the attention that a component receives.

specs = [("transitory", 0.2, 1.0, 1.0), ("persistent", 0.95, 1.0, 1.0),
         ("transitory, weighted", 0.2, 1.0, 4.0), ("persistent, small shock", 0.95, 0.2, 1.0)]
print(f"{'component':<24}{'a':>6}{'c2':>7}{'q':>6}{'prior':>9}{'posterior':>11}{'nats':>8}")
for name, a, cc, qq in specs:
    h = steady_state(a, cc, qq, θ, β)
    pr = a**2 * h + cc
    print(f"{name:<24}{a:>6.2f}{cc:>7.2f}{qq:>6.2f}{pr:>9.4f}{h:>11.4f}{0.5*np.log(pr/h):>8.4f}")
component                    a     c2     q    prior  posterior    nats
transitory                0.20   1.00  1.00   1.0196     0.4909  0.3655
persistent                0.95   1.00  1.00   1.3420     0.3789  0.6323
transitory, weighted      0.20   1.00  4.00   1.0050     0.1244  1.0446
persistent, small shock   0.95   0.20  1.00   0.4245     0.2488  0.2672

46.12. Turmuhambetova’s continuous-time rate#

Turmuhambetova [2005] works in continuous time, where the hidden state follows \(dz_t = (A_{11} z_t + A_{12}) dt + \sigma^z dB_t^z\) and the endogenous signal follows \(dy_t = G_t z_t \, dt + dB_t^y\).

Her Riccati equation for the conditional covariance \(\gamma_t\) carries the term \(-\gamma_t G_t^\top G_t \gamma_t\), and her Appendix B shows that the signal adds

(46.24)#\[\frac{d \mathcal{I}_t}{dt} = \tfrac{1}{2} \operatorname{tr} \bigl( G_t^\top G_t \gamma_t \bigr)\]

to the rate at which the decision maker acquires information.

A trace replaces the log determinant of (46.8).

The replacement is the small-increment limit.

A period of length \(\Delta\) contributes precision \(K \Delta\), so

\[ \frac{1}{\Delta} \cdot \tfrac{1}{2} \log \det ( I + \Sigma K \Delta ) = \tfrac{1}{2} \operatorname{tr}(\Sigma K) + O(\Delta) , \]

because \(\log \det (I + \epsilon M) = \epsilon \operatorname{tr}(M) + O(\epsilon^2)\).

Turmuhambetova [2005] calls this the simplicity induced by local normality, which lets her avoid linear-quadratic specifications.

rng = np.random.default_rng(1)
root = rng.normal(size=(3, 3))
Σ = root @ root.T + 0.3 * np.eye(3)
K = np.diag([0.7, 0.2, 1.3])

print(f"trace rate (1/2) tr(K Σ) = {0.5 * np.trace(K @ Σ):.8f}")
for Δ in (1e-1, 1e-2, 1e-3, 1e-4):
    rate = 0.5 * np.linalg.slogdet(np.eye(3) + Σ @ K * Δ)[1] / Δ
    print(f"  Δ = {Δ:7.0e}   (1/2) log det(I + Σ K Δ) / Δ = {rate:.8f}")
trace rate (1/2) tr(K Σ) = 1.41130408
  Δ =   1e-01   (1/2) log det(I + Σ K Δ) / Δ = 1.31434572
  Δ =   1e-02   (1/2) log det(I + Σ K Δ) / Δ = 1.40059349
  Δ =   1e-03   (1/2) log det(I + Σ K Δ) / Δ = 1.41022146
  Δ =   1e-04   (1/2) log det(I + Σ K Δ) / Δ = 1.41119570

In continuous time the decision maker minimizes \(\int_0^\infty e^{-\delta t} \bigl[ q \gamma_t + \tfrac{\theta}{2} k_t \gamma_t \bigr] dt\) subject to \(\dot\gamma_t = 2 \bar a \gamma_t + \sigma^2 - k_t \gamma_t^2\) and \(k_t \geq 0\).

The costate of \(\gamma\) equals \(\theta / 2\gamma\) at an interior \(k\), and the stationary costate equation reduces to

(46.25)#\[2 q \gamma^2 - \delta \theta \gamma - \theta \sigma^2 = 0 , \qquad \gamma^* = \frac{\delta \theta + \sqrt{\delta^2 \theta^2 + 8 q \theta \sigma^2}}{4 q} .\]

At \(\delta = 0\) the steady state is \(\gamma^* = \sigma \sqrt{\theta / 2q}\), proportional to the square root of the price rather than to the price itself.

Over an interval of length \(\Delta\) every component of \(z\) is equally persistent to order \(\Delta\), so the persistence effect of (46.23) vanishes as \(\Delta \to 0\).

A hidden state with \(\bar a < 0\) has unconditional variance \(\sigma^2 / (-2\bar a)\), which no steady-state conditional variance can exceed, though a transient \(\gamma_0\) can.

A decision maker whose \(\gamma^*\) exceeds that bound buys nothing and carries the unconditional variance.

The discrete-time steady state (46.23) converges to (46.25) under the mapping \(a = e^{\bar a \Delta}\), \(c^2 = \sigma^2 \Delta\), \(q \mapsto q \Delta\), \(\beta = e^{-\delta \Delta}\).

q_c, θ_c, σ2_c, δ, ā = 2.0, 1.0, 3.0, 0.05, -0.4
γ_star = (δ * θ_c + np.sqrt(δ**2 * θ_c**2 + 8 * q_c * θ_c * σ2_c)) / (4 * q_c)
print(f"continuous-time steady state γ* = {γ_star:.6f}")
print(f"  at δ = 0, σ sqrt(θ/2q)        = {np.sqrt(σ2_c * θ_c / (2 * q_c)):.6f}")
print("\ndiscrete-time steady state as Δ → 0:")
for Δ in (0.5, 0.1, 0.02, 0.005, 0.001, 0.0001):
    h = steady_state(np.exp(ā * Δ), σ2_c * Δ, q_c * Δ, θ_c, np.exp(-δ * Δ))
    print(f"  Δ = {Δ:8.4f}   h = {h:.6f}")
continuous-time steady state γ* = 0.872298
  at δ = 0, σ sqrt(θ/2q)        = 0.866025

discrete-time steady state as Δ → 0:
  Δ =   0.5000   h = 0.422544
  Δ =   0.1000   h = 0.758554
  Δ =   0.0200   h = 0.849081
  Δ =   0.0050   h = 0.866479
  Δ =   0.0010   h = 0.871134
  Δ =   0.0001   h = 0.872181

Exercise 46.2 derives the price above which the decision maker stops buying, and the drift drops out wherever (46.25) is feasible.

Δ = 1e-4
print(f"γ* = {γ_star:.6f}\n")
print(f"{'ā':>7}{'uncond var':>13}{'h':>11}")
for ā_try in (-2.0, -1.0, -0.5, -0.4, -0.2):
    h = steady_state(np.exp(ā_try * Δ), σ2_c * Δ, q_c * Δ, θ_c, np.exp(-δ * Δ))
    print(f"{ā_try:>7.2f}{σ2_c / (-2 * ā_try):>13.6f}{h:>11.6f}")
γ* = 0.872298

      ā   uncond var          h
  -2.00     0.750000   0.750150
  -1.00     1.500000   0.872233
  -0.50     3.000000   0.872190
  -0.40     3.750000   0.872181
  -0.20     7.500000   0.872164

Every drift from \(-1\) to \(-0.2\) delivers \(\gamma^*\).

The drift \(\bar a = -2\) gives the hidden state an unconditional variance of \(0.75\), below \(\gamma^* = 0.872\), so the decision maker measures nothing and sits at \(0.75\).

46.13. Turmuhambetova’s applications#

Under a quadratic \(U\) and Gaussian shocks, (46.13) separates the attention plan from the realized state: the matrix \(Q\) comes from a Riccati equation that the data do not enter, and the decision maker fixes his attention plan at date zero.

Turmuhambetova [2005] wanted attention to depend on the state, so she gave her decision makers constant relative risk aversion.

Her separation theorem permits that, because it requires linear state evolution and Gaussian conditional distributions and not a quadratic return.

She also charges a convex cost rather than the linear price \(\theta\) of this lecture.

Her Definition 2.3 penalizes an unspecified function of the information rate \(\kappa_t\), her Section 8 charges \(\kappa_t^2 / \vartheta\), and her Section 9 charges a power of \(\kappa_t\) with exponent above one.

We write \(\vartheta\) for her cost scale, which runs the opposite way to the price \(\theta\): her \(\vartheta = 0\) makes information infinitely expensive.

A strictly convex cost gives her interior first-order conditions, where a linear price would send the rate to a corner.

In her permanent income model of Section 8 the decision maker does not observe his wealth \(W_t\), which follows \(dW_t = (\rho W_t - C_t) dt + \sigma dB_t\), and he chooses the precision \(\nu_t\) of a signal \(dy_t = \nu_t W_t dt + dB_t^y\).

Buying precision raises the volatility of his own wealth estimate, which carries the diffusion coefficient \(\sqrt{2 \kappa_t \gamma_t}\) in her filtered equation.

Expanding around \(\vartheta = 0\), she reports in her Section 8.1 that he buys nothing below a threshold wealth \(W_1\) and a positive amount above it, and that his purchases rise with wealth on an interval \((W_1, W_2)\) and fall with wealth above \(W_2\).

Her first-order condition sets \(\kappa^* = \vartheta \gamma (\tfrac{1}{2} V_{\hat W \hat W} - V_\gamma)\), and her value function \(V = f(\gamma, t) \hat W^\lambda / \lambda\) makes \(V_{\hat W \hat W}\) diverge as \(\hat W\) falls to zero.

A decision maker who estimates his wealth to be low is therefore the one least willing to pay for a more volatile estimate of it, and he buys nothing.

Turmuhambetova [2005] reads the shape differently, in terms of levels rather than second derivatives: she writes that at low wealth the value function is so small that a large \(\gamma\) does not hurt much, and that at high wealth it approaches zero so a large \(\gamma\) again does little harm.

The consumption share \(C_t / W_t\) then falls with wealth, and the response to income shocks becomes asymmetric: a bad shock raises the consumption share, and above \(W_2\) it raises the attention the decision maker buys as well.

In her fixed-capacity model of Section 8.2 the decision maker receives the same information every period, the conditional variance evolves deterministically, the consumption share rises with wealth, and the asymmetry reverses.

In her portfolio model of Section 9 the decision maker does not observe the drift \(\mu_t\) of the risky return and pays for the channel out of wealth.

Expanding again around \(\vartheta = 0\), she finds that wealthier investors buy more capacity when relative risk aversion exceeds one.

Her maintained restriction on the cost exponent, \(\nu < 1 - 1/\lambda\) together with \(\nu > 1\), confines her to that case, so her statement of the opposite sign for risk aversion below one lies outside the parameters she maintains.

Where they buy more, they estimate the drift more accurately and hold a larger share of the risky asset, and their consumption share falls with wealth.

Gennotte [1986] had derived the hedging demand that imperfect knowledge of \(\mu\) creates under an exogenous signal, and had found portfolio shares independent of wealth.

An endogenous signal makes the shares depend on wealth.

46.14. Attention and robustness#

A malevolent nature in Robust Consumption Smoothing and Precautionary Savings and Robust Permanent Income and Pricing pays for its distortion, and Information Projections shows that the resulting worst-case model is an e-projection.

In robust control a malevolent nature chooses a distortion \(\tilde\pi\) of the decision maker’s model \(\pi\) and pays \(\theta D(\tilde\pi \| \pi)\) for it, and the distortion makes the decision maker’s beliefs worse than his model.

Under rational inattention the decision maker chooses a signal and pays \(\theta I(z; y)\) for it, and the signal makes his beliefs better than his prior.

Both problems recover a benchmark as \(\theta \to \infty\), and the benchmarks differ.

As \(\theta \to \infty\) the robust decision maker trusts his model and behaves as in LQ Control: Foundations, and Robust Permanent Income and Pricing parameterizes the same concern by \(\sigma\) and reserves \(\theta\) for another object.

As \(\theta \to \infty\) the inattentive decision maker buys nothing and acts on his prior, and it is the case \(\vartheta = 0\) around which Turmuhambetova [2005] expands.

Both problems also admit a constraint formulation whose multiplier is \(\theta\), and Exercise 46.1 works out the constraint formulation for attention.

Neither problem says where \(\theta\) comes from.

The Design and Price of Information studies the seller: a monopolist who owns the data designs a menu of experiments and charges most to the buyers whose own information leaves them closest to indifference between their actions.

She sets a price for each experiment on the menu rather than a price per nat, and the symbol \(\theta\) there denotes a buyer’s type rather than a price.

θ_range = np.array([0.05, 0.2, 1.0, 5.0, 50.0])
print(f"{'θ':>8}{'posterior':>12}{'nats':>9}{'loss':>9}")
for t in θ_range:
    post, nats_t = water_fill(np.array([4.0]), np.array([1.0]), t)
    print(f"{t:>8.2f}{post[0]:>12.4f}{nats_t[0]:>9.4f}{post[0] + t*nats_t[0]:>9.4f}")
       θ   posterior     nats     loss
    0.05      0.0250   2.5376   0.1519
    0.20      0.1000   1.8444   0.4689
    1.00      0.5000   1.0397   1.5397
    5.00      2.5000   0.2350   3.6750
   50.00      4.0000   0.0000   4.0000

At \(\theta = 50\) the decision maker measures nothing and carries his prior variance of \(4\) into his decision.

46.15. Concluding remarks#

Sims [2003] proposed that a decision maker chooses how much to learn about a state and pays for the choice in units of Shannon’s mutual information.

Turmuhambetova [2005] wrote that choice as a control problem, proved that the conditional mean and covariance remain sufficient statistics for it, and derived the rate at which a Gaussian channel delivers information.

Separation reduces her problem to a deterministic control problem in the conditional covariance.

The solution tells the decision maker to whiten the state by its prior covariance, to drive the conditional variance of the \(i\)th eigenvector of \(\Sigma^{1/2} Q \Sigma^{1/2}\) to \(\theta / 2\lambda_i\), and to ignore the eigenvectors whose eigenvalues fall below \(\theta/2\).

A decision maker who looks ahead buys more precision about persistent components than the static rule prescribes, because precision today lowers tomorrow’s prior variance and so lowers tomorrow’s bill.

A decision maker who cannot act on what he learns buys nothing, because (46.14) sets \(Q = 0\) when \(B = 0\).

Two limitations bound these results.

Gaussian channels are a restriction whose cost nobody has measured, because the channel that would be optimal among all channels depends on the shape of \(U\).

Matching a Ramsey Model to a Descriptive Model shows how to put a number on a restriction of this kind: it reports the divergence that no parameter value of its structural model removes, and attributes \(94\) percent of what remains for China to a single restriction at the boundary of the descriptive family.

The quadratic loss function that makes the problem computable also makes attention independent of the realized state, and her wealth-dependent attention requires a return function that is not quadratic.

Matějka and McKay [2015] solve a discrete-choice problem under the same information price and obtain the multinomial logit, whose exponential form Exponential Family and Maximum Entropy derives.

Csiszár and Tusnády [1984] analyzed the alternating minimization that computes their solution.

Information Projections builds the same alternating scheme from repeated e-projections and applies it to entropy-regularized transport and to the RAS updating of input-output tables.

46.16. Exercises#

Exercise 46.1

Turmuhambetova [2005] studies two problems in her Sections 8.1 and 8.2.

In the first, the decision maker pays for information, at a cost she takes to be convex in the rate.

In the second, he receives a fixed capacity \(\kappa\) and pays nothing.

We replace her convex cost with the linear price \(\theta\) of this lecture, which turns the comparison into one between a price and a quantity.

Consider the static problem of this lecture in both forms, with \(\Sigma = \operatorname{diag}(\sigma_i^2)\) and \(Q = \operatorname{diag}(q_i)\):

\[ \text{(price)} \quad \min_{r \geq 0} \ \sum_i q_i \sigma_i^2 e^{-2 r_i} + \theta \sum_i r_i , \qquad \text{(capacity)} \quad \min_{r \geq 0} \ \sum_i q_i \sigma_i^2 e^{-2 r_i} \ \text{ subject to } \sum_i r_i \leq \kappa . \]
  1. Show that if \(\theta\) solves \(\sum_i r_i(\theta) = \kappa\), where \(r(\theta)\) is the rule (46.17), then \(r(\theta)\) solves the capacity problem and \(\theta\) is the multiplier on its constraint.

  2. For \(\sigma^2 = (5, 2, 1, 0.3)\) and \(q = (1, 2, 0.5, 4)\), find the \(\theta\) that corresponds to each of \(\kappa \in \{0.5, 1.5, 3.0\}\) and report the allocation.

  3. Check each answer against a constrained optimizer applied to the capacity problem.

  4. Report the capacity at which the decision maker begins to measure a third direction.

Exercise 46.2

The continuous-time steady state (46.25) holds only where the decision maker buys something.

  1. A hidden state with \(\bar a < 0\) has unconditional variance \(\sigma^2 / (-2\bar a)\). Show that the decision maker buys nothing in the steady state exactly when

\[ q \sigma^2 \leq \theta \bigl( 2 \bar a^2 - \delta \bar a \bigr) , \]

and report the threshold price \(\theta^*\) above which he stops buying.

  1. Explain why a decision maker facing a more mean-reverting state stops buying at a lower price, and say what that implies about which components of a multidimensional state a continuous-time decision maker attends to.

  2. A decision maker whose conditional variance starts at \(\gamma_0 > \gamma^*\) drives it to \(\gamma^*\) at once, by taking \(k_t\) large for an instant. Show that the instant costs him \(\tfrac{\theta}{2} \log (\gamma_0 / \gamma^*)\), a finite amount, and that this is \(\theta\) times the mutual information of a single Gaussian observation that cuts the variance from \(\gamma_0\) to \(\gamma^*\).

  3. Check parts 1 and 3 numerically.

Exercise 46.3

The decision maker measures the combinations \((\Sigma^{-1/2} u_i)^\top z\), where \(u_i\) are the eigenvectors of \(\tilde Q = \Sigma^{1/2} Q \Sigma^{1/2}\), by (46.19) and (46.20).

  1. Show that he measures the eigenvectors of \(\Sigma\) when \(Q = I\), and the eigenvectors of \(Q\) when \(\Sigma = I\).

  2. Let \(n = 2\), let \(\Sigma\) have unit variances and correlation \(\varrho\), and let \(Q = e e^\top\) with \(e = (1, 1)^\top / \sqrt{2}\), so that the decision maker cares only about the sum of the two components. Compute the direction he measures and the nats he spends as \(\varrho\) ranges over \((-1, 1)\), and explain the behavior at \(\varrho\) near \(-1\).

  3. Construct a \(3 \times 3\) example in which the leading measured direction is close to neither the leading eigenvector of \(\Sigma\) nor the leading eigenvector of \(Q\), and report the angles.

Exercise 46.4

A decision maker who buys one instrument per component of \(z\), each with an independent measurement error, achieves a diagonal \(K\).

  1. Show that every diagonal \(K \succeq 0\) is achieved that way, and that (46.19) already delivers a diagonal \(K^*\) when \(\Sigma\) and \(Q\) are both diagonal, so the restriction binds only when they are not.

  2. For the \(\Sigma\), \(Q\), and \(\theta = 0.8\) of What to measure, compute the loss under (46.19) and under the best diagonal \(K\), and report the gap.

  3. Hold \(G\) fixed and stack the measurement errors into the state, so that what the decision maker reads is a noiseless linear combination of \((z_t, v_t)\), with state matrix \(\operatorname{diag}(A, 0)\) and observation matrix \([\,G \ \ I\,]\). Vector Autoregressions for Subsets of Variables shows that such a combination obeys a vector autoregression of infinite order, whose coefficients it builds from the steady-state Kalman gain. Say why the decision maker nevertheless carries only \(\hat z_t\) and \(\hat\Sigma_t\), and what the infinite-order representation costs an econometrician who watches his readings and does not know the gain.