34. Knowing the Forecasts of Others#
In addition to what’s in Anaconda, this lecture will need the following libraries:
!pip install --upgrade quantecon
!conda install -y -c plotly plotly plotly-orca
Show code cell output
Requirement already satisfied: quantecon in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (0.8.0)
Requirement already satisfied: numba>=0.49.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (0.60.0)
Requirement already satisfied: numpy>=1.17.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (1.26.4)
Requirement already satisfied: requests in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (2.32.3)
Requirement already satisfied: scipy>=1.5.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (1.13.1)
Requirement already satisfied: sympy in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from quantecon) (1.13.2)
Requirement already satisfied: llvmlite<0.44,>=0.43.0dev0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from numba>=0.49.0->quantecon) (0.43.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (2.2.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from requests->quantecon) (2024.8.30)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (from sympy->quantecon) (1.3.0)
Channels:
- plotly
- default
- defaults
Platform: linux-64
Collecting package metadata (repodata.json): -
\
|
/
-
\
done
Solving environment: /
-
\
|
/
-
\
|
/
-
\
done
# All requested packages already installed.
34.1. Introduction#
Robert E. Lucas, Jr. [Robert E. Lucas, 1975], Kenneth Kasa [Kasa, 2000], and Robert Townsend [Townsend, 1983] showed that putting decision makers into environments in which they want to infer persistent hidden state variables from equilibrium prices and quantities can elongate and amplify impulse responses to aggregate shocks.
This provides a promising way to think about amplification mechanisms in business cycle models.
Townsend [Townsend, 1983] noted that living in such environments makes decision makers want to forecast forecasts of others.
This theme has been pursued for situations in which decision makers’ imperfect information forces them to pursue an infinite recursion that involves forming beliefs about the beliefs of others (e.g., [Allen et al., 2002]).
Lucas [Robert E. Lucas, 1975] side stepped having decision makers forecast the forecasts of other decision makers by assuming that they simply pool their information before forecasting.
A pooling equilibrium like Lucas’s plays a prominent role in this lecture.
Because he didn’t assume such pooling, [Townsend, 1983] confronted the forecasting the forecasts of others problem.
To formulate the problem recursively required that Townsend define a decision maker’s state vector.
Townsend concluded that his original model required an intractable infinite dimensional state space.
Therefore, he constructed a more manageable approximating model in which a hidden Markov component of a demand shock is revealed to all firms after a fixed, finite number of periods.
In this lecture, we illustrate again the theme that finding the state is an art by showing how to formulate Townsend’s original model in terms of a low-dimensional state space.
We show that Townsend’s model shares equilibrium prices and quantities with those that prevail in a pooling equilibrium.
That finding emerged from a line of research about Townsend’s model that built on [Pearlman et al., 1986] and that culminated in [Pearlman and Sargent, 2005] .
Rather than directly deploying the [Pearlman et al., 1986] machinery here, we shall instead implement a sneaky guess-and-verify tactic.
We first compute a pooling equilibrium and represent it as an instance of a linear state-space system provided by the Python class
quantecon.LinearStateSpace
.Leaving the state-transition equation for the pooling equilibrium unaltered, we alter the observation vector for a firm to match what it is in Townsend’s original model. So rather than directly observing the signal received by firms in the other industry, a firm sees the equilibrium price of the good produced by the other industry.
We compute a population linear least squares regression of the noisy signal at time
that firms in the other industry would receive in a pooling equilibrium on time information that a firm receives in Townsend’s original model.The
in this regression equals .That verifies that a firm’s information set in Townsend’s original model equals its information set in a pooling equilibrium.
Therefore, equilibrium prices and quantities in Townsend’s original model equal those in a pooling equilibrium.
34.1.1. A Sequence of Models#
We proceed by describing a sequence of models of two industries that are linked in a single way:
shocks to the demand curves for their products have a common component.
The models are simplified versions of Townsend’s [Townsend, 1983].
Townsend’s is a model of a rational expectations equilibrium in which firms want to forecast forecasts of others.
In Townsend’s model, firms condition their forecasts on observed endogenous variables whose equilibrium laws of motion are determined by their own forecasting functions.
We shall assemble model components progressively in ways that can help us to appreciate the structure of the pooling equilibrium that ultimately interests us.
While keeping all other aspects of the model the same, we shall study consequences of alternative assumptions about what decision makers observe.
Technically, this lecture deploys concepts and tools that appear in First Look at Kalman Filter and Rational Expectations Equilibrium.
34.2. The Setting#
We cast all variables in terms of deviations from means.
Therefore, we omit constants from inverse demand curves and other functions.
Firms in industry
Firms bear quadratic costs of adjusting their capital stocks.
A representative firm in industry
The firm acts as a price taker with
respect to output price
Demand in industry
where
We assume that
where
To simplify notation, we’ll study a special case by setting
Costs of adjusting their capital stocks impart to firms an incentive to forecast the price of the good that they sell.
Throughout, we use the rational expectations equilibrium concept presented in this lecture Rational Expectations Equilibrium.
We let capital letters denote market wide objects and lower case letters denote objects chosen by a representative firm.
In each industry, a competitive equilibrium prevails.
To rationalize the big
In equilibrium,
34.3. Tactics#
We shall compute
equilibrium laws of motion for capital in industry
Successive members of this sequence make a representative firm’s information more and more obscure.
We begin with the most information, then gradually withdraw information in a way that approaches and eventually reaches the Townsend-like information structure that we are ultimately interested in.
Thus, we shall compute equilibria under the following alternative information structures:
Perfect foresight: future values of
are observed in industry .Observed history of stochastic
: are realizations from a stochastic process; current and past values of each are observed at time but future values are not.One noise-ridden observation on
: values of separately are never observed. However, at time , a history of scalar noise-ridden observations on is observed at time .Two noise-ridden observations on
: values of separately are never observed. However, at time , a history of two noise-ridden observations on is observed at time .
Successive computations build one on previous ones.
We proceed by first finding an equilibrium under perfect foresight.
To compute an equilibrium with current and past but not future values of
This provides the equilibrium when
To find an equilibrium when a history
To find an equilibrium when a history
We call the equilibrium with two noise-ridden observations on
It corresponds to an arrangement in which at the beginning of each period firms in industries
and somehow get together and share information about current values of their noisy signals on .
We want ultimately to compare outcomes in a pooling equilibrium
with an equilibrium under the following alternative information structure for a firm
in industry
Firm
’s noise-ridden signal on and the price in industry , a firm in industry observes a history of one noise-ridden signal on and a history of industry ’s price is observed. (Here means ``not ’’.)
With this information structure, a representative firm
That allows it to infer
the total demand shock
However, at time
Nevertheless, it will turn out that equilibrium prices and quantities in this equilibrium equal
their counterparts in a pooling equilibrium because
firms in industry
We shall verify this assertion by using a guess and verify tactic that involves running a least
squares regression and inspecting its
34.4. Equilibrium Conditions#
It is convenient to solve a firm’s problem without uncertainty by forming the Lagrangian:
where
First order conditions for the nonstochastic problem are
Substituting the demand function (34.2) for
where we define
We can write Euler equation (34.4) as:
In addition, we have the law of motion for
In summary, with perfect foresight, equilibrium conditions for industry
Without perfect foresight, the same system prevails except that the following equation replaces the third equation of (34.8):
where
34.4.1. Equilibrium under perfect foresight#
Our first step is to compute the equilibrium law of motion for
Let
Equations (34.7) and (34.5)
imply the second order difference equation in
Factor the polynomial in
where
Therefore, (34.9) can be expressed as
Solving the stable root backwards and the unstable root forwards gives
Recall that we have already set
Thus, under perfect foresight the equilibrium capital stock in industry
Next, we shall investigate consequences of replacing future values of
In particular, we shall compute equilibrium laws of motion for capital
under alternative assumptions about information available to
firms in market
34.5. Equilibrium with stochastic but observed at #
If future
For now, we assume that this information set is
Later we shall give firms less information.
To obtain an appropriate counterpart to (34.10) under our current assumption about information, we apply a certainty equivalence principle.
In particular, it is appropriate to take (34.10) and
replace each term
After using (34.3) and the i.i.d. assumption about
or
where
For our purposes, it is convenient to represent the equilibrium
34.5.1. Filtering#
34.5.1.1. One noisy signal#
We get closer to the original Townsend model that interests us by now
assuming that firms in market
Instead they observe a history
In particular, assume that
where
Define
where
Associated with the state-space representation (34.13) is the time-invariant innovations representation
where
and where
34.5.1.2. State-reconstruction error#
Define the state reconstruction error
Then
Equations (34.13) and (34.14) imply
Notice that we can express
where the first term in braces equals
We can express (34.11) as
An application of a certainty equivalence principle asserts that when
only
Making this substitution and using (34.18) leads to
Simplifying equation (34.18), we also have
Equations (34.20), (34.21) describe
an equilibrium when
34.5.2. A new state variable#
Relative to (34.11), the equilibrium acquires a new
state variable, namely, the
For a subsequent argument, by using (34.15), it is convenient to write (34.20) as
In summary, when decision makers in market
34.5.3. Two Noisy Signals#
We now construct a pooling equilibrium by assuming that at time
To justify that we are constructing is a pooling equilibrium we can assume that
so that a firm in industry
The pertinent innovations representation now becomes
where
Formulas for the Kalman filter imply that
where
Thus, when a representative firm in industry
Below, by using a guess-and-verify tactic, we shall show that outcomes in this pooling equilibrium equal those in an equilibrium under the alternative information structure that interested Townsend [Townsend, 1983] but that originally seemed too challenging to compute. 4
34.6. Guess-and-Verify Tactic#
As a preliminary step we shall take our recursive representation (34.23)
of an equilibrium in industry
Compute
and by posing a root-finding problem and solving it withnumpy.roots
Compute
by forming the appropriate discrete Riccati equation and then solving it usingquantecon.solve_discrete_riccati
Add a measurement equation for
, , and to system (34.23).Write the resulting system in state-space form and encode it using
quantecon.LinearStateSpace
Use methods of the
quantecon.LinearStateSpace
to compute impulse response functions of with respect to shocks .
After analyzing the one-noisy-signal structure in this way, by making appropriate modifications we shall analyze the two-noisy-signal structure.
We proceed to analyze first the one-noisy-signal structure and then the two-noisy-signal structure.
34.7. Equilibrium with One Noisy Signal on #
34.7.1. Step 1: Solve for and #
Cast
as where is a polynomial function of .Use
numpy.roots
to solve for the roots ofVerify
Note that
34.7.2. Step 2: Solve for #
Cast
as a discrete matrix Riccati equation.Use
quantecon.solve_discrete_riccati
to solve forVerify
Note that:
34.7.3. Step 3: Represent the system using quantecon.LinearStateSpace
#
We use the following representation for constructing the
quantecon.LinearStateSpace
instance.
This representation includes extraneous variables such as
We formulate things in this way because
it allows us easily to compute covariances of these variables with other
components of the state vector (step 5 above) by using the stationary_distributions
method of the LinearStateSpace
class.
import numpy as np
import quantecon as qe
import plotly.graph_objects as go
import plotly.offline as pyo
from statsmodels.regression.linear_model import OLS
from IPython.display import display, Latex, Image
pyo.init_notebook_mode(connected=True)
β = 0.9 # Discount factor
ρ = 0.8 # Persistence parameter for the hidden state
b = 1.5 # Demand curve parameter
σ_v = 0.5 # Standard deviation of shock to θ_t
σ_e = 0.6 # Standard deviation of shocks to w_t
# Compute λ
poly = np.array([1, -(1 + β + b) / β, 1 / β])
roots_poly = np.roots(poly)
λ_tilde = roots_poly.min()
λ = roots_poly.max()
# Verify that λ = (βλ_tilde) ^ (-1)
tol = 1e-12
np.max(np.abs(λ - 1 / (β * λ_tilde))) < tol
True
A_ricc = np.array([[ρ]])
B_ricc = np.array([[1.]])
R_ricc = np.array([[σ_e ** 2]])
Q_ricc = np.array([[σ_v ** 2]])
N_ricc = np.zeros((1, 1))
p = qe.solve_discrete_riccati(A_ricc, B_ricc, Q_ricc, R_ricc, N_ricc).item()
p_one = p # Save for comparison later
# Verify that p = σ_v ^ 2 + p * ρ ^ 2 - (ρ * p) ^ 2 / (p + σ_e ** 2)
tol = 1e-12
np.abs(p - (σ_v ** 2 + p * ρ ** 2 - (ρ * p) ** 2 / (p + σ_e ** 2))) < tol
True
κ = ρ * p / (p + σ_e ** 2)
κ_prod = κ * σ_e ** 2 / p
κ_one = κ # Save for comparison later
A_lss = np.array([[0., 0., 0., 0., 0., 0.],
[κ / (λ - ρ), λ_tilde, -κ_prod / (λ - ρ), 0., ρ / (λ - ρ), 0.],
[-κ, 0., κ_prod, 0., 0., 1.],
[b * κ / (λ - ρ) , b * λ_tilde, -b * κ_prod / (λ - ρ), 0., b * ρ / (λ - ρ) + ρ, 1.],
[0., 0., 0., 0., ρ, 1.],
[0., 0., 0., 0., 0., 0.]])
C_lss = np.array([[σ_e, 0.],
[0., 0.],
[0., 0.],
[σ_e, 0.],
[0., 0.],
[0., σ_v]])
G_lss = np.array([[0., 0., 0., 1., 0., 0.],
[1., 0., 0., 0., 1., 0.],
[1., 0., 0., 0., 0., 0.]])
mu_0 = np.array([0., 0., 0., 0., 0., 0.])
lss = qe.LinearStateSpace(A_lss, C_lss, G_lss, mu_0=mu_0)
ts_length = 100_000
x, y = lss.simulate(ts_length, random_state=1)
# Verify that two ways of computing P_t match
np.max(np.abs(np.array([[1., b, 0., 0., 1., 0.]]) @ x - x[3])) < 1e-12
True
34.7.4. Step 4: Compute impulse response functions#
To compute impulse response functions of impulse_response
method of the
quantecon.LinearStateSpace
class and plot outcomes.
xcoef, ycoef = lss.impulse_response(j=21)
data = np.array([xcoef])[0, :, 1, :]
fig = go.Figure(data=go.Scatter(y=data[:-1, 0], name=r'$e_{t+1}$'))
fig.add_trace(go.Scatter(y=data[1:, 1], name=r'$v_{t+1}$'))
fig.update_layout(title=r'Impulse Response Function',
xaxis_title='Time',
yaxis_title=r'$k^{i}_{t}$')
fig1 = fig
# Export to PNG file
Image(fig1.to_image(format="png"))
# fig1.show() will provide interactive plot when running
# notebook locally

34.7.5. Step 5: Compute stationary covariance matrices and population regressions#
We compute stationary covariance matrices by
calling the stationary_distributions
method of
the quantecon.LinearStateSpace
class.
By appropriately decomposing the covariance matrix of the state vector, we obtain ingredients of pertinent population regression coefficients.
Define
where
Regression coefficients are
To verify an instance of a law of large numbers computation, we construct a long simulation of
the state vector and for the resulting sample compute
the ordinary least-squares estimator of
_, _, Σ_x, Σ_y, Σ_yx = lss.stationary_distributions()
Σ_11 = Σ_x[0, 0]
Σ_12 = Σ_x[0, 1:4]
Σ_21 = Σ_x[1:4, 0]
Σ_22 = Σ_x[1:4, 1:4]
reg_coeffs = Σ_12 @ np.linalg.inv(Σ_22)
print('Regression coefficients (e_t on k_t, P_t, \\tilde{\\theta_t})')
print('------------------------------')
print(r'k_t:', reg_coeffs[0])
print(r'\tilde{\theta_t}:', reg_coeffs[1])
print(r'P_t:', reg_coeffs[2])
Regression coefficients (e_t on k_t, P_t, \tilde{\theta_t})
------------------------------
k_t: -3.275556845219769
\tilde{\theta_t}: -0.9649461170475457
P_t: 0.9649461170475457
# Compute R squared
R_squared = reg_coeffs @ Σ_x[1:4, 1:4] @ reg_coeffs / Σ_x[0, 0]
R_squared
0.9649461170475461
# Verify that the computed coefficients are close to least squares estimates
model = OLS(x[0], x[1:4].T)
reg_res = model.fit()
np.max(np.abs(reg_coeffs - reg_res.params)) < 1e-2
True
# Verify that R_squared matches least squares estimate
np.abs(reg_res.rsquared - R_squared) < 1e-2
True
# Verify that θ_t + e_t can be recovered
model = OLS(y[1], x[1:4].T)
reg_res = model.fit()
np.abs(reg_res.rsquared - 1.) < 1e-6
True
34.8. Equilibrium with Two Noisy Signals on #
Steps 1, 4, and 5 are identical to those for the one-noisy-signal structure.
Step 2 requires a straightforward modification.
For step 3, we construct the following state-space representation so that we can get our hands on
all of the random processes that we require in order to compute a regression of the noisy signal about
For this purpose, we include equilibrium goods prices from both industries in the state vector:
A_ricc = np.array([[ρ]])
B_ricc = np.array([[np.sqrt(2)]])
R_ricc = np.array([[σ_e ** 2]])
Q_ricc = np.array([[σ_v ** 2]])
N_ricc = np.zeros((1, 1))
p = qe.solve_discrete_riccati(A_ricc, B_ricc, Q_ricc, R_ricc, N_ricc).item()
p_two = p # Save for comparison later
# Verify that p = σ_v^2 + (pρ^2σ_e^2) / (2p + σ_e^2)
tol = 1e-12
np.abs(p - (σ_v ** 2 + p * ρ ** 2 * σ_e ** 2 / (2 * p + σ_e ** 2))) < tol
True
κ = ρ * p / (2 * p + σ_e ** 2)
κ_prod = κ * σ_e ** 2 / p
κ_two = κ # Save for comparison later
A_lss = np.array([[0., 0., 0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0., 0., 0.],
[κ / (λ - ρ), κ / (λ - ρ), λ_tilde, -κ_prod / (λ - ρ), 0., 0., ρ / (λ - ρ), 0.],
[-κ, -κ, 0., κ_prod, 0., 0., 0., 1.],
[b * κ / (λ - ρ), b * κ / (λ - ρ), b * λ_tilde, -b * κ_prod / (λ - ρ), 0., 0., b * ρ / (λ - ρ) + ρ, 1.],
[b * κ / (λ - ρ), b * κ / (λ - ρ), b * λ_tilde, -b * κ_prod / (λ - ρ), 0., 0., b * ρ / (λ - ρ) + ρ, 1.],
[0., 0., 0., 0., 0., 0., ρ, 1.],
[0., 0., 0., 0., 0., 0., 0., 0.]])
C_lss = np.array([[σ_e, 0., 0.],
[0., σ_e, 0.],
[0., 0., 0.],
[0., 0., 0.],
[σ_e, 0., 0.],
[0., σ_e, 0.],
[0., 0., 0.],
[0., 0., σ_v]])
G_lss = np.array([[0., 0., 0., 0., 1., 0., 0., 0.],
[0., 0, 0, 0., 0., 1., 0., 0.],
[1., 0., 0., 0., 0., 0., 1., 0.],
[0., 1., 0., 0., 0., 0., 1., 0.],
[1., 0., 0., 0., 0., 0., 0., 0.],
[0., 1., 0., 0., 0., 0., 0., 0.]])
mu_0 = np.array([0., 0., 0., 0., 0., 0., 0., 0.])
lss = qe.LinearStateSpace(A_lss, C_lss, G_lss, mu_0=mu_0)
ts_length = 100_000
x, y = lss.simulate(ts_length, random_state=1)
xcoef, ycoef = lss.impulse_response(j=20)
data = np.array([xcoef])[0, :, 2, :]
fig = go.Figure(data=go.Scatter(y=data[:-1, 0], name=r'$e_{1,t+1}$'))
fig.add_trace(go.Scatter(y=data[:-1, 1], name=r'$e_{2,t+1}$'))
fig.add_trace(go.Scatter(y=data[1:, 2], name=r'$v_{t+1}$'))
fig.update_layout(title=r'Impulse Response Function',
xaxis_title='Time',
yaxis_title=r'$k^{i}_{t}$')
fig2=fig
# Export to PNG file
Image(fig2.to_image(format="png"))
# fig2.show() will provide interactive plot when running
# notebook locally

_, _, Σ_x, Σ_y, Σ_yx = lss.stationary_distributions()
Σ_11 = Σ_x[1, 1]
Σ_12 = Σ_x[1, 2:5]
Σ_21 = Σ_x[2:5, 1]
Σ_22 = Σ_x[2:5, 2:5]
reg_coeffs = Σ_12 @ np.linalg.inv(Σ_22)
print('Regression coefficients (e_{2,t} on k_t, P^{1}_t, \\tilde{\\theta_t})')
print('------------------------------')
print(r'k_t:', reg_coeffs[0])
print(r'\tilde{\theta_t}:', reg_coeffs[1])
print(r'P_t:', reg_coeffs[2])
Regression coefficients (e_{2,t} on k_t, P^{1}_t, \tilde{\theta_t})
------------------------------
k_t: 0.0
\tilde{\theta_t}: 0.0
P_t: 0.0
# Compute R squared
R_squared = reg_coeffs @ Σ_x[2:5, 2:5] @ reg_coeffs / Σ_x[1, 1]
R_squared
0.0
# Verify that the computed coefficients are close to least squares estimates
model = OLS(x[1], x[2:5].T)
reg_res = model.fit()
np.max(np.abs(reg_coeffs - reg_res.params)) < 1e-2
True
# Verify that R_squared matches least squares estimate
np.abs(reg_res.rsquared - R_squared) < 1e-2
True
_, _, Σ_x, Σ_y, Σ_yx = lss.stationary_distributions()
Σ_11 = Σ_x[1, 1]
Σ_12 = Σ_x[1, 2:6]
Σ_21 = Σ_x[2:6, 1]
Σ_22 = Σ_x[2:6, 2:6]
reg_coeffs = Σ_12 @ np.linalg.inv(Σ_22)
print('Regression coefficients (e_{2,t} on k_t, P^{1}_t, P^{2}_t, \\tilde{\\theta_t})')
print('------------------------------')
print(r'k_t:', reg_coeffs[0])
print(r'\tilde{\theta_t}:', reg_coeffs[1])
print(r'P^{1}_t:', reg_coeffs[2])
print(r'P^{2}_t:', reg_coeffs[3])
Regression coefficients (e_{2,t} on k_t, P^{1}_t, P^{2}_t, \tilde{\theta_t})
------------------------------
k_t: -3.1373589171035627
\tilde{\theta_t}: -0.9242343967443672
P^{1}_t: -0.037882801627816154
P^{2}_t: 0.9621171983721835
# Compute R squared
R_squared = reg_coeffs @ Σ_x[2:6, 2:6] @ reg_coeffs / Σ_x[1, 1]
R_squared
0.9621171983721837
34.9. Key Step#
Now we come to the key step for verifying that equilibrium outcomes for prices and quantities are identical in the pooling equilibrium original model that led Townsend to deduce an infinite-dimensional state space.
We accomplish this by computing a population linear least squares regression of the noisy signal that firms in the other
industry receive in a pooling equilibrium on time
Let’s compute the regression and stare at the
# Verify that θ_t + e^{2}_t can be recovered
# θ_t + e^{2}_t on k^{i}_t, P^{1}_t, P^{2}_t, \\tilde{\\theta_t}
model = OLS(y[1], x[2:6].T)
reg_res = model.fit()
np.abs(reg_res.rsquared - 1.) < 1e-6
True
reg_res.rsquared
1.0
The
That verifies that a firm’s information set in Townsend’s original model equals its information set in a pooling equilibrium.
Therefore, equilibrium prices and quantities in Townsend’s original model equal those in a pooling equilibrium.
34.10. An observed common shock benchmark#
For purposes of comparison, it is useful to construct a model in which demand disturbance in both industries
still both share have a common persistent component
In this case, firms share the same information immediately and have no need to deploy signal-extraction techniques.
Thus, consider a version of our model in which histories of both
In this case, the firm’s optimal decision rule is described by
where
Thus, the firm’s decision rule can be expressed
Consequently, when a history
where
As usual, the system can be written as
In order once again to use the quantecon class quantecon.LinearStateSpace
, let’s form pertinent state-space matrices
Ao_lss = np.array([[ρ, 0.],
[ρ / (λ - ρ), λ_tilde]])
Co_lss = np.array([[σ_v], [0.]])
Go_lss = np.identity(2)
muo_0 = np.array([0., 0.])
lsso = qe.LinearStateSpace(Ao_lss, Co_lss, Go_lss, mu_0=muo_0)
Now let’s form and plot an impulse response function of
xcoef, ycoef = lsso.impulse_response(j=21)
data = np.array([ycoef])[0, :, 1, :]
fig = go.Figure(data=go.Scatter(y=data[:-1, 0], name=r'$z_{t+1}$'))
fig.update_layout(title=r'Impulse Response Function',
xaxis_title= r'lag $j$',
yaxis_title=r'$k^{i}_{t}$')
fig3 = fig
# Export to PNG file
Image(fig3.to_image(format="png"))
# fig1.show() will provide interactive plot when running
# notebook locally

34.11. Comparison of All Signal Structures#
It is enlightening side by side to plot impulse response functions for capital for the two
noisy-signal information structures and the noiseless signal on
Please remember that the two-signal structure corresponds to the pooling equilibrium and also Townsend’s original model.
fig_comb = go.Figure(data=[
*fig1.data,
*fig2.update_traces(xaxis='x2', yaxis='y2').data,
*fig3.update_traces(xaxis='x3', yaxis='y3').data
]).set_subplots(1, 3,
subplot_titles=("One noisy-signal",
"Two noisy-signal",
"No Noise"),
horizontal_spacing=0.02,
shared_yaxes=True)
# Export to PNG file
Image(fig_comb.to_image(format="png"))
# fig_comb.show() # will provide interactive plot when running
# notebook locally

The three panels in the graph above show that
responses of
to shocks to the hidden Markov demand state process are largest in the no-noisy-signal structure in which the firm observes at timeresponses of
to shocks to the hidden Markov demand state process are smaller in the two-noisy-signal structureresponses of
to shocks to the hidden Markov demand state process are smallest in the one-noisy-signal structure
With respect to the iid demand shocks
responses of
to shocks to the hidden Markov demand state process are smallest (i.e., nonexistent) in the no-noisy-signal structure in which the firm observes at timeresponses of
to shocks to the hidden Markov demand state process are larger in the two-noisy-signal structureresponses of
to idiosyncratic own-market noise-shocks are largest in the one-noisy-signal structure
Among other things, these findings indicate that time series correlations and coherences between outputs in the two industries are higher in the two-noisy-signals or pooling model than they are in the one-noisy signal model.
The enhanced influence of the shocks
display(Latex('$\\textbf{Reconstruction error variances}$'))
display(Latex(f'One-noise structure: {round(p_one, 6)}'))
display(Latex(f'Two-noise structure: {round(p_two, 6)}'))
Kalman gains for the two structures are
display(Latex('$\\textbf{Kalman Gains}$'))
display(Latex(f'One noisy-signal structure: {round(κ_one, 6)}'))
display(Latex(f'Two noisy-signals structure: {round(κ_two, 6)}'))
Another lesson that comes from the preceding three-panel graph is that the presence of iid noise
34.12. Notes on History of the Problem#
To truncate what he saw as an intractable, infinite dimensional state space, Townsend constructed an approximating model in which the common hidden Markov demand shock is revealed to all firms after a fixed number of periods.
Thus,
Townsend wanted to assume that at time
firms in industry observe , where is the history of prices in the other market up to time .Because that turned out to be too challenging, Townsend made a sensible alternative assumption that eased his calculations: that after a large number
of periods, firms in industry observe the hidden Markov component of the demand shock .
Townsend argued that the more manageable model could do a good job of approximating the intractable model in which the Markov component of the demand shock remains unobserved for ever.
By applying technical machinery of [Pearlman et al., 1986], [Pearlman and Sargent, 2005] showed that there is a recursive representation of the equilibrium of the perpetually and symmetrically uninformed model that Townsend wanted to solve [Townsend, 1983].
A reader of [Pearlman and Sargent, 2005] will notice that their representation of the equilibrium of Townsend’s model exactly matches that of the pooling equilibrium presented here.
We have structured our notation in this lecture to faciliate comparison of the pooling equilibrium constructed here with the equilibrium of Townsend’s model reported in [Pearlman and Sargent, 2005].
The computational method of [Pearlman and Sargent, 2005] is recursive: it enlists the Kalman filter and invariant subspace methods for solving systems of Euler equations 5 .
As [Singleton, 1987], [Kasa, 2000], and [Sargent, 1991] also
found, the equilibrium is fully revealing: observed prices tell
participants in industry
This means that higher-order beliefs play no role: observing equilibrium prices in effect lets decision makers pool their information sets 6 .
The disappearance of higher order beliefs means that decision makers in this model do not really face a problem of forecasting the forecasts of others.
Because those forecasts are the same as their own, they know them.
34.12.1. Further historical remarks#
Sargent [Sargent, 1991] proposed a way to compute an equilibrium without making Townsend’s approximation.
Extending the reasoning of [Muth, 1960], Sargent noticed that it is possible to summarize the relevant history with a low dimensional object, namely, a small number of current and lagged forecasting errors.
Positing an equilibrium in a space of perceived laws of motion for endogenous variables that takes the form of a vector autoregressive, moving average, Sargent described an equilibrium as a fixed point of a mapping from the perceived law of motion to the actual law of motion of that form.
Sargent worked in the time domain and proceeded to guess and verify the appropriate orders of the autoregressive and moving average pieces of the equilibrium representation.
By working in the frequency domain [Kasa, 2000] showed how to discover the appropriate orders of the autoregressive and moving average parts, and also how to compute an equilibrium.
The [Pearlman and Sargent, 2005] recursive computational method, which stays in the time domain, also discovered appropriate orders of the autoregressive and moving average pieces.
In addition, by displaying equilibrium representations in the form of [Pearlman et al., 1986], [Pearlman and Sargent, 2005] showed how the moving average piece is linked to the innovation process of the hidden persistent component of the demand shock.
That scalar innovation process is the additional state variable contributed by the problem of extracting a signal from equilibrium prices that decision makers face in Townsend’s model.
- 1
[Pearlman and Sargent, 2005] verified this assertion using a different tactic, namely, by constructing analytic formulas for an equilibrium under the incomplete information structure and confirming that they match the pooling equilibrium formulas derived here.
- 2
See [Sargent, 1987], especially chapters IX and XIV, for principles that guide solving some roots backwards and others forwards.
- 3
As noted by [Sargent, 1987], this difference equation is the Euler equation for a planning problem that maximizes the discounted sum of consumer plus producer surplus.
- 4
[Pearlman and Sargent, 2005] verify the same claim by applying machinery of [Pearlman et al., 1986].
- 5
See [Anderson et al., 1996] for an account of invariant subspace methods.
- 6
See [Allen et al., 2002] for a discussion of information assumptions needed to create a situation in which higher order beliefs appear in equilibrium decision rules. A way to read our findings in light of [Allen et al., 2002] is that, relative to the number of signals agents observe, Townsend’s section 8 model has too few random shocks to get higher order beliefs to play a role.