<p>The two approaches specify the linear rational expectations problem somewhat differently, but one can reconcile the solutions they produce.  In addition to the difference in the equation system specification, KW use the "predetermined variables" concept while AM does not.</p>

<p>King and Watson (KW) address a model of the form</p>

<p><span class="math-container">$$
  A E_t y_{t+1} = B y_t + C_0E_t x_t +C_1 x_{t+1}\\
  x_t=Q \delta_t +G \epsilon_t\\
  \delta_t=\rho \delta_{t-1}\\
  y_t=
  \begin{bmatrix}
    \Lambda_t\\k_t
  \end{bmatrix}
$$</span></p>

<p>the <span class="math-container">$k_t$</span> are predetermined variables.</p>

<p>The algorithm produces solutions of the form
<span class="math-container">$$
 y_t=\Pi s_t\\
  s_t=M s_{t-1} + \bar{G} \epsilon_t\\
  s_t=
  \begin{bmatrix}
    k_t\\ \delta_t
  \end{bmatrix}
$$</span></p>

<p>Anderson Moore (AM) cast the problem as</p>

<p><span class="math-container">$$
  H_{-1} w_{t-1} + H_0 w_t + H_{+1} E_t{w_{t+1}} = \psi_{\epsilon} \epsilon_t + \psi_c
$$</span></p>

<p>and produce solutions of the form</p>

<p><span class="math-container">$$
  w_t=R w_{t-1}+ \phi \psi_\epsilon \epsilon_t + (I-F)^{-1}\phi\psi_c
$$</span></p>

<p>where 
<span class="math-container">$$  \phi=(H_0+H_{+1}R)^{-1}\,\, \text{and} \,\, F=-\phi H_{+1}
$$</span></p>

<p>In the AM setup, the <span class="math-container">$w_{t-1} $</span> are given as data and cannot be affected by the <span class="math-container">$\epsilon_t$</span> or
the  current or future values of <span class="math-container">$w_{t+i}\in, \{w_t,w_{t+1},\ldots\}$</span>.
  In KW,  the ``predetermined'' variables at time t depend only on the already realized shocks.  So the
<span class="math-container">$\epsilon_t$</span> only influences future <span class="math-container">$k_{t+i} \in \{k_{t+1},k_{t+2},\ldots\}$</span>  Consequently, to square AM and KW, the dating of some of the model variables
and their time subscripts  will differ.</p>

<p>Set</p>

<p><span class="math-container">$$
 w_t=
  \begin{bmatrix}
\Lambda_{t}\\    k_{t+1}\\x_t\\  \delta_t
  \end{bmatrix}
$$</span></p>

<p>We will need to partition the KW <span class="math-container">$A=
\begin{bmatrix}
  A_1&amp;A_2
\end{bmatrix}
$</span> and <span class="math-container">$B=\begin{bmatrix}
  B_1&amp;B_2
\end{bmatrix}$</span>
 matrices to accomodate  these differences.</p>

<p>Construct the AMA <span class="math-container">$H$</span> as</p>

<p><span class="math-container">$$
H_{-1}=\begin{bmatrix}
  0&amp;-B_1&amp;0&amp;0  \\
  0&amp;0&amp;0&amp;-Q\\
  0&amp;0&amp;0&amp;-\rho
\end{bmatrix}\\
H_{0}=\begin{bmatrix}
  -B_2&amp;A_1&amp;-C_0&amp;0  \\
  0&amp;0&amp;I&amp;0\\
  0&amp;0&amp;0&amp;I
\end{bmatrix}\\
H_{+1}=\begin{bmatrix}
  A_2&amp;0&amp;-C_1&amp;0  \\
  0&amp;0&amp;0&amp;0\\
  0&amp;0&amp;0&amp;0
\end{bmatrix}$$</span> and 
<span class="math-container">$$\psi_c=0 \,\, \psi_\epsilon=
\begin{bmatrix}
0\\  0\\G\\0
\end{bmatrix}
$$</span></p>

<p>Then, we will find that
<span class="math-container">$$
  R=
  \begin{bmatrix}
    0&amp;M_{\Lambda,k}&amp;0&amp;M_{\Lambda,\delta}\\
    0&amp;M_{k,k}&amp;0&amp;M_{k,\delta}\\
    0&amp;0&amp;0&amp;M_{x,\delta}\\
    0&amp;0&amp;0&amp;M_{\delta,\delta}\\
  \end{bmatrix}
$$</span></p>

<p>So that for KW
<span class="math-container">$$
  M=
  \begin{bmatrix}
    M_{k,k}&amp;M_{k,\delta}\\
    0&amp;M_{\delta,\delta}\\
  \end{bmatrix}
$$</span></p>

<p><span class="math-container">$$
\phi \psi_\epsilon=
\begin{bmatrix}
\bar{\bar{G}}\\
  \bar{G}
\end{bmatrix}
$$</span></p>

<p>The KW solution for <span class="math-container">$\Lambda_t$</span>, <span class="math-container">$\Pi_\Lambda$</span> can be found by expressing the first few rows of R as a linear combination of the next few rows of R.</p>

<p><span class="math-container">$$
  \begin{bmatrix}
      M_{\Lambda,k}&amp;M_{\Lambda,\delta} 
  \end{bmatrix}= \Pi_\Lambda
\begin{bmatrix}
      M_{k,k}&amp;M_{k,\delta}\\
\end{bmatrix}
$$</span></p>

<p>See also
Gary Anderson. Solving linear rational expections models: A horse race. Computational Economics, 31:95–113, March 2008.</p>

CC BY-SA 4.0
2019-02-24T04:15:33.883Z
That was beautiful. I  understand RE models when the individual equations  are written out in what I would refer to as "univariate form". For example, most of Lucas's papers write the individual equations out. But I was wondering if there is  something that explains the multivariate notation that is often used in papers for the general case. In other words, I am kind of lost on the origin the  formulation that you use in your horse racing paper . Or possibly, there are different notations for each different RE solution method ? Thanks for any useful references.
mark leeds
CC BY-SA 4.0
2019-02-22T12:45:54.773Z
2019-02-22T16:53:27.713Z
2019-02-22T16:53:27.713Z
Gary Anderson
<p>I have a linear rational expectation model that is in the King-Watson form: </p>

<pre><code>AE_{t}y{t+1} = By_{t} + C_{0}x_{t} + C_{1}x{t+1}  (1)
</code></pre>

<p>with the driving process </p>

<pre><code>x_{t}     = Q \delta_{t}                          (2)
delta_{t} = \rho \delta_{t-1} + G \espilson_{t}   (3)
</code></pre>

<p>I have a fairly large system and would like to solve it using a different algorithm than the King-Watson one, such as the Anderson-Moore algorithm (but am completely open to anything fast). However, I have so far failed in implementing the KW in Anderson-Moore. Any ideas on <strong>(i) how to solve the problem using the Anderson-Moore algo,</strong> or <strong>(ii) a different algorithm that can be used?</strong> </p>

<p>Note, my system of equations in (1) is about 1000 lines.</p>

<p>Here is a toy example for parameterization</p>

<pre><code>A  = [1,0,0,0;0,1,0,0;0,0,-1,-1;0,0,0,0];
B  = [0,0,1,0;0,0,0,1;0,0,-1.1,0;0,-0.7,0,1];
C  = [0,0;0,0;4,1;3,-2];
Q  = [1,0;0,1];
RHO= [0.9,0.1;0.05,0.2];
G  = [1,0;0,1];
</code></pre>

<p>which should yield</p>

<pre><code>\Pi = [1,0,0,0; 0,1,0,0;0,1.225, -21.0857, 3.15714; 0, 0.7, -3, 2];
M   = [0,1.225, -21.0857, 3.15714; 0, 0.7, -3, 2; 0,0,0.9,0.1; 0,0,0.05,0.2];
</code></pre>

<macroeconomics><rational-expectations>
Solving a LRE model in King-Watson form using alternative algorithms
EconRider
# Solving a LRE model in King-Watson form using alternative algorithms

(Asked by: username_0 on 2019-02-18)

I have a linear rational expectation model that is in the King-Watson form: 
AE_{t}y{t+1} = By_{t} + C_{0}x_{t} + C_{1}x{t+1}  (1)

with the driving process 
x_{t}     = Q \delta_{t}                          (2)
delta_{t} = \rho \delta_{t-1} + G \espilson_{t}   (3)

I have a fairly large system and would like to solve it using a different algorithm than the King-Watson one, such as the Anderson-Moore algorithm (but am completely open to anything fast). However, I have so far failed in implementing the KW in Anderson-Moore. Any ideas on (i) how to solve the problem using the Anderson-Moore algo, or (ii) a different algorithm that can be used? 
Note, my system of equations in (1) is about 1000 lines.
Here is a toy example for parameterization
A  = [1,0,0,0;0,1,0,0;0,0,-1,-1;0,0,0,0];
B  = [0,0,1,0;0,0,0,1;0,0,-1.1,0;0,-0.7,0,1];
C  = [0,0;0,0;4,1;3,-2];
Q  = [1,0;0,1];
RHO= [0.9,0.1;0.05,0.2];
G  = [1,0;0,1];

which should yield
\Pi = [1,0,0,0; 0,1,0,0;0,1.225, -21.0857, 3.15714; 0, 0.7, -3, 2];
M   = [0,1.225, -21.0857, 3.15714; 0, 0.7, -3, 2; 0,0,0.9,0.1; 0,0,0.05,0.2];

**Tags:** macroeconomics, rational-expectations

---

## 1 answers

### Answer by username_1 on 2019-02-22. Score: 2 | Accepted answer

The two approaches specify the linear rational expectations problem somewhat differently, but one can reconcile the solutions they produce. In addition to the difference in the equation system specification, KW use the "predetermined variables" concept while AM does not.

King and Watson (KW) address a model of the form

$$
A E\_t y\_{t+1} = B y\_t + C\_0E\_t x\_t +C\_1 x\_{t+1}\\
x\_t=Q \delta\_t +G \epsilon\_t\\
\delta\_t=\rho \delta\_{t-1}\\
y\_t=
\begin{bmatrix}
\Lambda\_t\\k\_t
\end{bmatrix}
$$

the $k\_t$ are predetermined variables.

The algorithm produces solutions of the form
$$
y\_t=\Pi s\_t\\
s\_t=M s\_{t-1} + \bar{G} \epsilon\_t\\
s\_t=
\begin{bmatrix}
k\_t\\ \delta\_t
\end{bmatrix}
$$

Anderson Moore (AM) cast the problem as

$$
H\_{-1} w\_{t-1} + H\_0 w\_t + H\_{+1} E\_t{w\_{t+1}} = \psi\_{\epsilon} \epsilon\_t + \psi\_c
$$

and produce solutions of the form

$$
w\_t=R w\_{t-1}+ \phi \psi\_\epsilon \epsilon\_t + (I-F)^{-1}\phi\psi\_c
$$

where
$$ \phi=(H\_0+H\_{+1}R)^{-1}\,\, \text{and} \,\, F=-\phi H\_{+1}
$$

In the AM setup, the $w\_{t-1} $ are given as data and cannot be affected by the $\epsilon\_t$ or
the current or future values of $w\_{t+i}\in, \{w\_t,w\_{t+1},\ldots\}$.
In KW, the ``predetermined'' variables at time t depend only on the already realized shocks. So the
$\epsilon\_t$ only influences future $k\_{t+i} \in \{k\_{t+1},k\_{t+2},\ldots\}$ Consequently, to square AM and KW, the dating of some of the model variables
and their time subscripts will differ.

Set

$$
w\_t=
\begin{bmatrix}
\Lambda\_{t}\\ k\_{t+1}\\x\_t\\ \delta\_t
\end{bmatrix}
$$

We will need to partition the KW $A=
\begin{bmatrix}
A\_1&A\_2
\end{bmatrix}
$ and $B=\begin{bmatrix}
B\_1&B\_2
\end{bmatrix}$
matrices to accomodate these differences.

Construct the AMA $H$ as

$$
H\_{-1}=\begin{bmatrix}
0&-B\_1&0&0 \\
0&0&0&-Q\\
0&0&0&-\rho
\end{bmatrix}\\
H\_{0}=\begin{bmatrix}
-B\_2&A\_1&-C\_0&0 \\
0&0&I&0\\
0&0&0&I
\end{bmatrix}\\
H\_{+1}=\begin{bmatrix}
A\_2&0&-C\_1&0 \\
0&0&0&0\\
0&0&0&0
\end{bmatrix}$$ and
$$\psi\_c=0 \,\, \psi\_\epsilon=
\begin{bmatrix}
0\\ 0\\G\\0
\end{bmatrix}
$$

Then, we will find that
$$
R=
\begin{bmatrix}
0&M\_{\Lambda,k}&0&M\_{\Lambda,\delta}\\
0&M\_{k,k}&0&M\_{k,\delta}\\
0&0&0&M\_{x,\delta}\\
0&0&0&M\_{\delta,\delta}\\
\end{bmatrix}
$$

So that for KW
$$
M=
\begin{bmatrix}
M\_{k,k}&M\_{k,\delta}\\
0&M\_{\delta,\delta}\\
\end{bmatrix}
$$

$$
\phi \psi\_\epsilon=
\begin{bmatrix}
\bar{\bar{G}}\\
\bar{G}
\end{bmatrix}
$$

The KW solution for $\Lambda\_t$, $\Pi\_\Lambda$ can be found by expressing the first few rows of R as a linear combination of the next few rows of R.

$$
\begin{bmatrix}
M\_{\Lambda,k}&M\_{\Lambda,\delta}
\end{bmatrix}= \Pi\_\Lambda
\begin{bmatrix}
M\_{k,k}&M\_{k,\delta}\\
\end{bmatrix}
$$

See also
Gary Anderson. Solving linear rational expections models: A horse race. Computational Economics, 31:95–113, March 2008.

> **Comments:**
> **username_2**: That was beautiful. I  understand RE models when the individual equations  are written out in what I would refer to as "univariate form". For example, most of Lucas's papers write the individual equations out. But I was wondering if there is  something that explains the multivariate notation that is often used in papers for the general case. In other words, I am kind of lost on the origin the  formulation that you use in your horse racing paper . Or possibly, there are different notations for each different RE solution method ? Thanks for any useful references.  

---

