65. Rational Expectations Equilibrium#
Contents
“If you’re so smart, why aren’t you rich?”
In addition to what’s in Anaconda, this lecture will need the following libraries:
!pip install quantecon
Show code cell output
Requirement already satisfied: quantecon in /home/runner/miniconda3/envs/quantecon/lib/python3.12/site-packages (0.8.1)
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.14.0)
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)
65.1. Overview#
This lecture introduces the concept of a rational expectations equilibrium.
To illustrate it, we describe a linear quadratic version of a model due to Lucas and Prescott [Lucas and Prescott, 1971].
That 1971 paper is one of a small number of research articles that ignited a rational expectations revolution.
We follow Lucas and Prescott by employing a setting that is readily “Bellmanized” (i.e., susceptible to being formulated as a dynamic programming problems.
Because we use linear quadratic setups for demand and costs, we can deploy the LQ programming techniques described in this lecture.
We will learn about how a representative agent’s problem differs from a planner’s, and how a planning problem can be used to compute quantities and prices in a rational expectations equilibrium.
We will also learn about how a rational expectations equilibrium can be characterized as a fixed point of a mapping from a perceived law of motion to an actual law of motion.
Equality between a perceived and an actual law of motion for endogenous market-wide objects captures in a nutshell what the rational expectations equilibrium concept is all about.
Finally, we will learn about the important “Big
Except that for us
Instead of “Big
” it will be “Big ”.Instead of “little
” it will be “little ”.
Let’s start with some standard imports:
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
import numpy as np
We’ll also use the LQ class from QuantEcon.py
.
from quantecon import LQ
65.1.1. The Big Y, little y Trick#
This widely used method applies in contexts in which a representative firm or agent is a “price taker” operating within a competitive equilibrium.
The following setting justifies the concept of a representative firm that stands in for a large number of other firms too.
There is a uniform unit measure of identical firms named
The output of firm
The output of all firms is
All firms end up choosing to produce the same output, so that at the end of the day
This setting allows us to speak of a representative firm that chooses to produce
We want to impose that
The representative firm or individual firm takes aggregate
as given when it chooses individual , but .At the end of the day,
, so that the representative firm is indeed representative.
The Big
Taking
as beyond control when posing the choice problem of who chooses ; but .Imposing
after having solved the individual’s optimization problem.
Please watch for how this strategy is applied as the lecture unfolds.
We begin by applying the Big
65.1.1.1. A Simple Static Example of the Big Y, little y Trick#
Consider a static model in which a unit measure of firms produce a homogeneous good that is sold in a competitive market.
Each of these firms ends up producing and selling output
The price
where
for is the market-wide level of output
For convenience, we’ll often just write
Each firm has a total cost function
The profits of a representative firm are
Using (65.1), we can express the problem of the representative firm as
In posing problem (65.2), we want the firm to be a price taker.
We do that by regarding
The essence of the Big
This assures that the firm is a price taker.
The first-order condition for problem (65.2) is
At this point, but not before, we substitute
to be solved for the competitive equilibrium market-wide output
After solving for
65.1.3. Further Reading#
References for this lecture include
[Sargent, 1987], chapter XIV
[Ljungqvist and Sargent, 2018], chapter 7
65.2. Rational Expectations Equilibrium#
Our first illustration of a rational expectations equilibrium involves a market with a unit measure of identical firms, each of which seeks to maximize the discounted present value of profits in the face of adjustment costs.
The adjustment costs induce the firms to make gradual adjustments, which in turn requires consideration of future prices.
Individual firms understand that, via the inverse demand curve, the price is determined by the amounts supplied by other firms.
Hence each firm wants to forecast future total industry output.
In our context, a forecast is generated by a belief about the law of motion for the aggregate state.
Rational expectations equilibrium prevails when this belief coincides with the actual law of motion generated by production choices induced by this belief.
We formulate a rational expectations equilibrium in terms of a fixed point of an operator that maps beliefs into optimal beliefs.
65.2.1. Competitive Equilibrium with Adjustment Costs#
To illustrate, consider a collection of
Each firm sell output
The price
where
for is the market-wide level of output
65.2.1.1. The Firm’s Problem#
Each firm is a price taker.
While it faces no uncertainty, it does face adjustment costs
In particular, it chooses a production plan to maximize
where
Regarding the parameters,
is a discount factor measures the cost of adjusting the rate of output
Regarding timing, the firm observes
To state the firm’s optimization problem completely requires that we specify dynamics for all state variables.
This includes ones that the firm cares about but does not control like
We turn to this problem now.
65.2.1.2. Prices and Aggregate Output#
In view of (65.5), the firm’s incentive to forecast the market price translates into an incentive to forecast aggregate output
Aggregate output depends on the choices of other firms.
The output
That justifies firms in regarding their forecasts of aggregate output as being unaffected by their own output decisions.
65.2.1.3. Representative Firm’s Beliefs#
We suppose the firm believes that market-wide output
where
The belief function
65.2.1.4. Optimal Behavior Given Beliefs#
For now, let’s fix a particular belief
Let
The value function satisfies the Bellman equation
Let’s denote the firm’s optimal policy function by
where
Evidently
65.2.1.5. Characterization with First-Order Necessary Conditions#
In what follows it will be helpful to have a second characterization of
The first-order necessary condition for choosing
An important useful envelope result of Benveniste-Scheinkman [Benveniste and Scheinkman, 1979] implies that to
differentiate
Substituting this equation into (65.12) gives the Euler equation
The firm optimally sets an output path that satisfies (65.13), taking (65.8) as given, and subject to
the initial conditions for
.the terminal condition
.
This last condition is called the transversality condition, and acts as a first-order necessary condition “at infinity”.
A representative firm’s decision rule solves the difference equation (65.13) subject to the given initial condition
Note that solving the Bellman equation (65.9) for
65.2.1.6. The Actual Law of Motion for Output#
As we’ve seen, a given belief translates into a particular decision rule
Recalling that in equilbrium
Thus, when firms believe that the law of motion for market-wide output is (65.8), their optimizing behavior makes the actual law of motion be (65.14).
65.2.2. Definition of Rational Expectations Equilibrium#
A rational expectations equilibrium or recursive competitive equilibrium of the model with adjustment costs is a decision rule
Given belief
, the map is the firm’s optimal policy function.The law of motion
satisfies for all .
Thus, a rational expectations equilibrium equates the perceived and actual laws of motion (65.8) and (65.14).
65.2.2.1. Fixed Point Characterization#
As we’ve seen, the firm’s optimum problem induces a mapping
The mapping
The
65.3. Computing an Equilibrium#
Now let’s compute a rational expectations equilibrium.
65.3.1. Failure of Contractivity#
Readers accustomed to dynamic programming arguments might try to address this problem by choosing some guess
Unfortunately, the mapping
Indeed, there is no guarantee that direct iterations on
There are examples in which these iterations diverge.
Fortunately, another method works here.
The method exploits a connection between equilibrium and Pareto optimality expressed in the fundamental theorems of welfare economics (see, e.g, [Mas-Colell et al., 1995]).
Lucas and Prescott [Lucas and Prescott, 1971] used this method to construct a rational expectations equilibrium.
Some details follow.
65.3.2. A Planning Problem Approach#
Our plan of attack is to match the Euler equations of the market problem with those for a single-agent choice problem.
As we’ll see, this planning problem can be solved by LQ control (linear regulator).
Optimal quantities from the planning problem are rational expectations equilibrium quantities.
The rational expectations equilibrium price can be obtained as a shadow price in the planning problem.
We first compute a sum of consumer and producer surplus at time
The first term is the area under the demand curve, while the second measures the social costs of changing output.
The planning problem is to choose a production plan
subject to an initial condition for
65.3.3. Solution of Planning Problem#
Evaluating the integral in (65.15) yields the quadratic form
As a result, the Bellman equation for the planning problem is
The associated first-order condition is
Applying the same Benveniste-Scheinkman formula gives
Substituting this into equation (65.17) and rearranging leads to the Euler equation
65.3.4. Key Insight#
Return to equation (65.13) and set
A small amount of algebra will convince you that when
Thus, the Euler equation for the planning problem matches the second-order difference equation that we derived by
finding the Euler equation of the representative firm and
substituting into it the expression
that “makes the representative firm be representative”.
If it is appropriate to apply the same terminal conditions for these two difference equations, which it is, then we have verified that a solution of the planning problem is also a rational expectations equilibrium quantity sequence.
It follows that for this example we can compute equilibrium quantities by forming the optimal linear regulator problem corresponding to the Bellman equation (65.16).
The optimal policy function for the planning problem is the aggregate law of motion
65.3.4.1. Structure of the Law of Motion#
As you are asked to show in the exercises, the fact that the planner’s problem is an LQ control problem implies an optimal policy — and hence aggregate law of motion — taking the form
for some parameter pair
Now that we know the aggregate law of motion is linear, we can see from the firm’s Bellman equation (65.9) that the firm’s problem can also be framed as an LQ problem.
As you’re asked to show in the exercises, the LQ formulation of the firm’s problem implies a law of motion that looks as follows
Hence a rational expectations equilibrium will be defined by the parameters
65.4. Exercises#
Exercise 65.1
Consider the firm problem described above.
Let the firm’s belief function
Formulate the firm’s problem as a discounted optimal linear regulator problem, being careful to describe all of the objects needed.
Use the class LQ
from the QuantEcon.py package to solve the firm’s problem for the following parameter values:
Express the solution of the firm’s problem in the form (65.20) and give the values for each
If there were a unit measure of identical competitive firms all behaving according to (65.20), what would (65.20) imply for the actual law of motion (65.8) for market supply.
Solution to Exercise 65.1
To map a problem into a discounted optimal linear control problem, we need to define
state vector
and control vectormatrices
that define preferences and the law of motion for the state
For the state and control vectors, we choose
For
By multiplying out you can confirm that
We’ll use the module lqcontrol.py
to solve the firm’s problem at the
stated parameter values.
This will return an LQ policy
Matching parameters with
Here’s our solution
# Model parameters
a0 = 100
a1 = 0.05
β = 0.95
γ = 10.0
# Beliefs
κ0 = 95.5
κ1 = 0.95
# Formulate the LQ problem
A = np.array([[1, 0, 0], [0, κ1, κ0], [0, 0, 1]])
B = np.array([1, 0, 0])
B.shape = 3, 1
R = np.array([[0, a1/2, -a0/2], [a1/2, 0, 0], [-a0/2, 0, 0]])
Q = 0.5 * γ
# Solve for the optimal policy
lq = LQ(Q, R, A, B, beta=β)
P, F, d = lq.stationary_values()
F = F.flatten()
out1 = f"F = [{F[0]:.3f}, {F[1]:.3f}, {F[2]:.3f}]"
h0, h1, h2 = -F[2], 1 - F[0], -F[1]
out2 = f"(h0, h1, h2) = ({h0:.3f}, {h1:.3f}, {h2:.3f})"
print(out1)
print(out2)
F = [-0.000, 0.046, -96.949]
(h0, h1, h2) = (96.949, 1.000, -0.046)
The implication is that
For the case
Exercise 65.2
Consider the following
Extending the program that you wrote for Exercise 65.1, determine which if any satisfy the definition of a rational expectations equilibrium
(94.0886298678, 0.923409232937)
(93.2119845412, 0.984323478873)
(95.0818452486, 0.952459076301)
Describe an iterative algorithm that uses the program that you wrote for Exercise 65.1 to compute a rational expectations equilibrium.
(You are not being asked actually to use the algorithm you are suggesting)
Solution to Exercise 65.2
To determine whether a
Determine the corresponding firm law of motion
.Test whether the associated aggregate law :
evaluates to .
In the second step, we can use
Hence to test the second step we can test
The following code implements this test
candidates = ((94.0886298678, 0.923409232937),
(93.2119845412, 0.984323478873),
(95.0818452486, 0.952459076301))
for κ0, κ1 in candidates:
# Form the associated law of motion
A = np.array([[1, 0, 0], [0, κ1, κ0], [0, 0, 1]])
# Solve the LQ problem for the firm
lq = LQ(Q, R, A, B, beta=β)
P, F, d = lq.stationary_values()
F = F.flatten()
h0, h1, h2 = -F[2], 1 - F[0], -F[1]
# Test the equilibrium condition
if np.allclose((κ0, κ1), (h0, h1 + h2)):
print(f'Equilibrium pair = {κ0}, {κ1}')
print('f(h0, h1, h2) = {h0}, {h1}, {h2}')
break
Equilibrium pair = 95.0818452486, 0.952459076301
f(h0, h1, h2) = {h0}, {h1}, {h2}
The output tells us that the answer is pair (iii), which implies
(Notice we use np.allclose
to test equality of floating-point
numbers, since exact equality is too strict).
Regarding the iterative algorithm, one could loop from a given
This amounts to implementing the operator
(There is in general no guarantee that this iterative process will converge to a rational expectations equilibrium)
Exercise 65.3
Recall the planner’s problem described above
Formulate the planner’s problem as an LQ problem.
Solve it using the same parameter values in exercise 1
Represent the solution in the form
.Compare your answer with the results from exercise 2.
Solution to Exercise 65.3
We are asked to write the planner problem as an LQ problem.
For the state and control vectors, we choose
For the LQ matrices, we set
By multiplying out you can confirm that
By obtaining the optimal policy and using
we can obtain the implied aggregate law of motion via
The Python code to solve this problem is below:
# Formulate the planner's LQ problem
A = np.array([[1, 0], [0, 1]])
B = np.array([[1], [0]])
R = np.array([[a1 / 2, -a0 / 2], [-a0 / 2, 0]])
Q = γ / 2
# Solve for the optimal policy
lq = LQ(Q, R, A, B, beta=β)
P, F, d = lq.stationary_values()
# Print the results
F = F.flatten()
κ0, κ1 = -F[1], 1 - F[0]
print(κ0, κ1)
95.08187459215002 0.9524590627039248
The output yields the same
Exercise 65.4
A monopolist faces the industry demand curve (65.5) and chooses
Formulate this problem as an LQ problem.
Compute the optimal policy using the same parameters as Exercise 65.2.
In particular, solve for the parameters in
Compare your results with Exercise 65.2 – comment.
Solution to Exercise 65.4
The monopolist’s LQ problem is almost identical to the planner’s problem from the previous exercise, except that
The problem can be solved as follows
A = np.array([[1, 0], [0, 1]])
B = np.array([[1], [0]])
R = np.array([[a1, -a0 / 2], [-a0 / 2, 0]])
Q = γ / 2
lq = LQ(Q, R, A, B, beta=β)
P, F, d = lq.stationary_values()
F = F.flatten()
m0, m1 = -F[1], 1 - F[0]
print(m0, m1)
73.47294403502818 0.9265270559649701
We see that the law of motion for the monopolist is approximately
In the rational expectations case, the law of motion was approximately
One way to compare these two laws of motion is by their fixed points, which give long-run equilibrium output in each case.
For laws of the form
If you crunch the numbers, you will see that the monopolist adopts a lower long-run quantity than obtained by the competitive market, implying a higher market price.
This is analogous to the elementary static-case results
- 1
A literature that studies whether models populated with agents who learn can converge to rational expectations equilibria features iterations on a modification of the mapping
that can be approximated as . Here is the identity operator and is a relaxation parameter. See [Marcet and Sargent, 1989] and [Evans and Honkapohja, 2001] for statements and applications of this approach to establish conditions under which collections of adaptive agents who use least squares learning to converge to a rational expectations equilibrium.