<p>One confusion that might have arisen is the fact that the paper &quot;overuses&quot; the index <span class="math-container">$t$</span>. It uses it both for the index of the variable <span class="math-container">$y_t$</span> to take the derivative with, and for the summation index in the definition of <span class="math-container">$L$</span>. I think this is not good. So let's use index <span class="math-container">$i$</span> for the summation.</p>
<p>To check that the formula makes sense, let's take an example with <span class="math-container">$m = 2$</span> and <span class="math-container">$N = 5$</span>. Then,
<span class="math-container">$$
L = \sum_{i = 0}^5 (d_0 y_i + d_1 y_{i-1} d_2 y_{i-2})^2 
$$</span>
Or writing it out explicitly:
<span class="math-container">$$
\begin{align*}
L = &amp;(d_0 y_0 + d_1 y_{-1}+ d_2 y_{-2})^2 + \beta(d_0 y_1 + d_1 y_0 + d_2 y_{-1})^2 + \beta^2(d_0 y_2 + d_1 y_1 + d_2 y_0)^2,\\
&amp;+ \beta^3(d_0 y_3 + d_1 y_2 + d_2 y_1)^2 + \beta^4(d_0 y_4 + d_1 y_3 + d_2 y_2)^2 + \beta^5(d_0 y_5 + d_1 y_4 + d_2 y_3)^2
\end{align*}
$$</span>
Let's take the derivative with respect to <span class="math-container">$y_3$</span> This gives:
<span class="math-container">$$
\begin{align*}
\frac{\partial L}{\partial y_3} =&amp; 2\beta^3 d_0(d_0 y_3 + d_1 y_2 + d_2 y_1) + 2 \beta^4 d_1(d_0 y_4 + d_1 y_3 + d_2 y_2),\\
&amp; + 2 \beta^5 d_2(d_0 y_5 + d_1 y_4 + d_2 y_3)
\end{align*}
$$</span>
Taking out <span class="math-container">$\beta^3$</span> and introducing the lag operator, this can be rewritten as:
<span class="math-container">$$
\begin{align*}
\frac{\partial L}{\partial y_3} = 2 \beta^3 \left[\begin{array}{l}d_0 (d_0 y_3 + d_1 y_2 + d_0 y_0) + \beta d_1 (d_0 L^{-1} y_3 + d_1 L^{-1} y_2 + d_2 L^{-1} y_1)\\ + \beta^2 d_2 (d_0 L^{-2} y_3 + d_1 L^{-2} y_2 + d_2 L^{-2} y_1)\end{array}\right]
\end{align*}
$$</span>
Taking out the lag operators and gathering terms gives,
<span class="math-container">$$
\begin{align*}
\frac{\partial L}{\partial y_3} &amp;= 2 \beta^3 \left[\begin{array}{l}d_0 (d_0 y_3 + d_1 y_2 + d_0 y_0) + \beta d_1 L^{-1} (d_0 y_3 + d_1 y_2 + d_2 y_1) + \\\beta^2 d_2 L^{-2} (d_0  y_3 + d_1 y_2 + d_2 y_1)\end{array}\right],\\
&amp;= 2 \beta^3(d_0 + \beta d_1 L^{-1} + \beta^2 d_2 L^{-2})(d_0 y_3 + d_1 y_2 + d_0 y_1),\\
&amp;= 2 \beta^3 d(\beta L^{-1}) d(L) y_3
\end{align*}
$$</span>
So we do get to the correct answer.</p>
<p>Now let's go to the general case.</p>
<p>We have:
<span class="math-container">$$
L = \sum_{i = 0}^N \beta^i (d(L)y_i)(d(L)y_i)
$$</span>
Let's write out the laggs:
<span class="math-container">$$
L = \sum_{i = 0}^N \beta^i \left(\sum_{j = 0}^m d_j y_{i-j}\right)\left(\sum_{k = 0}^m d_k y_{i-k}\right)
$$</span>
If we take the derivative with respect to <span class="math-container">$y_t$</span> then there are two occurences of <span class="math-container">$y_t$</span> once where <span class="math-container">$i-j = t$</span> and once where <span class="math-container">$i -k = t$</span>. Also, notice that <span class="math-container">$d_j$</span> is only defined for <span class="math-container">$0 \le j \le m$</span> which means that <span class="math-container">$y_t$</span> in these terms only occurs when the summation index <span class="math-container">$i$</span> is between <span class="math-container">$t$</span> and <span class="math-container">$m+t$</span> (as such, the summation bounds can be reduced to go from <span class="math-container">$t$</span> to <span class="math-container">$m+t$</span>).</p>
<p>This gives:
<span class="math-container">$$
\dfrac{\partial L}{\partial y_t} = \sum_{i = t}^{m+t} \beta^i d_{i-t} \left(\sum_{k = 0}^m d_{k} y_{i-k}\right) + \sum_{i = t}^{m+t} \beta^i \left(d_{i-t} \sum_{j = 0}^m d_j y_{i - j}\right) 
$$</span>
These two terms are the same (replace the counter <span class="math-container">$k$</span> with <span class="math-container">$j$</span>). So:
<span class="math-container">$$
\dfrac{\partial L}{\partial y_t} = 2\sum_{i = t}^{m+t} \beta^i d_{i-t} \left(\sum_{k = 0}^m  d_{k} y_{i-k}\right)
$$</span>
Now, we can take <span class="math-container">$\beta^t$</span> out of the summation to get:
<span class="math-container">$$
\dfrac{\partial L}{\partial y_t} = 2 \beta^t \sum_{i = t}^{m-t} \beta^{i-t} d_{i-t} \left(\sum_{k = 0}^m  d_{k} y_{i-k}\right)
$$</span>
Now, make a change of indices <span class="math-container">$r = i-t$</span> to substitute out <span class="math-container">$i$</span>. This gives:
<span class="math-container">$$
\dfrac{\partial L}{\partial y_t} = 2 \beta^t \sum_{r = 0}^{m} \beta^{r} d_{r} \left(\sum_{k = 0}^m  d_{k} y_{r+t-k}\right)
$$</span>
We can introduce the lag operator:
<span class="math-container">$$
\begin{align*}
\dfrac{\partial L}{\partial y_t} &amp;= 2 \beta^t \sum_{r = 0}^{m} \beta^{r} d_{r} \left(\sum_{k = 0}^m  d_{k} L^{-r} y_{t-k}\right)\\
 &amp;= 2 \beta^t \sum_{r = 0}^{m} \beta^r d_r L^{-r} \underbrace{\left(\sum_{k = 0} d_k y_{t-k}\right)}_{d(L)y_t}
\end{align*}
$$</span>
So we obtain:
<span class="math-container">$$
\dfrac{\partial L}{\partial y_t} = 2 \beta^t \sum_{r = 0}^{m} \beta^{r} d_{r} L^{-r} d(L)y_t = 2 \beta^t d(\beta L^{-1}) d(L) y_t
$$</span></p>

CC BY-SA 4.0
2023-08-24T05:39:44.647Z
wow. thank you for going into so much detail. I will print out and go over it carefully. It's really generous of you. and it's impressive too. thanks again.
mark leeds
CC BY-SA 4.0
2023-08-24T05:40:32.070Z
oh, once I go over it and hopefully follow it, I'll give a check or a number or whatever.
mark leeds
CC BY-SA 4.0
2023-08-24T16:46:31.353Z
I'm only halfway through your answer but it's TREMENDOUS and so much clearer than the original text.  I checked it and added a number. Thanks. Oh, one suggestion is to put $\beta$ in the initial L expression for your toy example. It's just a typo. I hope that your students appreciate your talent and clarity.
mark leeds
CC BY-SA 4.0
2023-08-25T02:58:10.300Z
I did follow most of your steps. It's really great and then how you explain everything at each step is so helpful. The one part I can't get is what justifies the extra $d_{t-i}$ values that get put in the line starting with "this gives".  I followed what you said about the counters being non-zero only in certain regions but I still don't see the emergence of those $d_{t-i}$. The first one is on the outside in the first term and second one is on the inside in the second term. That's not my problem ( atleast right now ). My question is how do they exist from seemingly nowhere ? Thanks.
mark leeds
CC BY-SA 4.0
2023-08-25T05:47:02.080Z
To see the index, consider the first $y_t$, which occurs when $i-j = t$, or equivalently $j = i - t$. As such, the $d_j$ associated to this $y_{i-j}$ takes the value $d_{i-t}$ (substitute the $j$ index with an $i-t$ index).
tdm
CC BY-SA 4.0
2023-08-25T16:10:44.250Z
I get it now. all I can say is that it's a really nice derivation. I wonder if sargent does this in his head because he makes no reference to it being complicated.
mark leeds
CC BY-SA 4.0
2023-08-23T09:25:05.693Z
2023-08-23T09:25:05.693Z
tdm
<p>Hi: The link below provides the pdf that I'm referring to. On page 2 of the document, it says</p>
<p>&quot;Differentiating L with respect to <span class="math-container">$y_t$</span> for <span class="math-container">$ t = 0,1,\ldots, (N-m) $</span> gives.&quot;</p>
<p>and then he writes what it is. I know it's a lot to ask but if someone could check it out ( page 1 and the top of page 2 make sense !!!!!! LOL ) and explain where his result comes about, I would be grateful. I often don't follow the author's expressions ( this one is
relatively low on his complexity scale which is why I'm asking ) but sometimes they annoy me too much to not ask. Thanks a lot.</p>
<pre><code>                                                            Mark
</code></pre>
<p><a href="https://www.minneapolisfed.org/research/working-papers/linear-optimal-control-filtering-and-rational-expectations" rel="nofollow noreferrer">https://www.minneapolisfed.org/research/working-papers/linear-optimal-control-filtering-and-rational-expectations</a></p>

<recursive-macroeconomics>
can someone show more steps in one of Sargent's equations?
mark leeds
# can someone show more steps in one of Sargent's equations?

(Asked by: username_0 on 2023-08-23)

Hi: The link below provides the pdf that I'm referring to. On page 2 of the document, it says
"Differentiating L with respect to $y_t$ for $ t = 0,1,\ldots, (N-m) $ gives."
and then he writes what it is. I know it's a lot to ask but if someone could check it out ( page 1 and the top of page 2 make sense !!!!!! LOL ) and explain where his result comes about, I would be grateful. I often don't follow the author's expressions ( this one is
relatively low on his complexity scale which is why I'm asking ) but sometimes they annoy me too much to not ask. Thanks a lot.
                                                            Mark

https://www.minneapolisfed.org/research/working-papers/linear-optimal-control-filtering-and-rational-expectations

**Tags:** recursive-macroeconomics

---

## 1 answers

### Answer by username_1 on 2023-08-23. Score: 5 | Accepted answer

One confusion that might have arisen is the fact that the paper "overuses" the index $t$. It uses it both for the index of the variable $y\_t$ to take the derivative with, and for the summation index in the definition of $L$. I think this is not good. So let's use index $i$ for the summation.

To check that the formula makes sense, let's take an example with $m = 2$ and $N = 5$. Then,
$$
L = \sum\_{i = 0}^5 (d\_0 y\_i + d\_1 y\_{i-1} d\_2 y\_{i-2})^2
$$
Or writing it out explicitly:
$$
\begin{align\*}
L = &(d\_0 y\_0 + d\_1 y\_{-1}+ d\_2 y\_{-2})^2 + \beta(d\_0 y\_1 + d\_1 y\_0 + d\_2 y\_{-1})^2 + \beta^2(d\_0 y\_2 + d\_1 y\_1 + d\_2 y\_0)^2,\\
&+ \beta^3(d\_0 y\_3 + d\_1 y\_2 + d\_2 y\_1)^2 + \beta^4(d\_0 y\_4 + d\_1 y\_3 + d\_2 y\_2)^2 + \beta^5(d\_0 y\_5 + d\_1 y\_4 + d\_2 y\_3)^2
\end{align\*}
$$
Let's take the derivative with respect to $y\_3$ This gives:
$$
\begin{align\*}
\frac{\partial L}{\partial y\_3} =& 2\beta^3 d\_0(d\_0 y\_3 + d\_1 y\_2 + d\_2 y\_1) + 2 \beta^4 d\_1(d\_0 y\_4 + d\_1 y\_3 + d\_2 y\_2),\\
& + 2 \beta^5 d\_2(d\_0 y\_5 + d\_1 y\_4 + d\_2 y\_3)
\end{align\*}
$$
Taking out $\beta^3$ and introducing the lag operator, this can be rewritten as:
$$
\begin{align\*}
\frac{\partial L}{\partial y\_3} = 2 \beta^3 \left[\begin{array}{l}d\_0 (d\_0 y\_3 + d\_1 y\_2 + d\_0 y\_0) + \beta d\_1 (d\_0 L^{-1} y\_3 + d\_1 L^{-1} y\_2 + d\_2 L^{-1} y\_1)\\ + \beta^2 d\_2 (d\_0 L^{-2} y\_3 + d\_1 L^{-2} y\_2 + d\_2 L^{-2} y\_1)\end{array}\right]
\end{align\*}
$$
Taking out the lag operators and gathering terms gives,
$$
\begin{align\*}
\frac{\partial L}{\partial y\_3} &= 2 \beta^3 \left[\begin{array}{l}d\_0 (d\_0 y\_3 + d\_1 y\_2 + d\_0 y\_0) + \beta d\_1 L^{-1} (d\_0 y\_3 + d\_1 y\_2 + d\_2 y\_1) + \\\beta^2 d\_2 L^{-2} (d\_0 y\_3 + d\_1 y\_2 + d\_2 y\_1)\end{array}\right],\\
&= 2 \beta^3(d\_0 + \beta d\_1 L^{-1} + \beta^2 d\_2 L^{-2})(d\_0 y\_3 + d\_1 y\_2 + d\_0 y\_1),\\
&= 2 \beta^3 d(\beta L^{-1}) d(L) y\_3
\end{align\*}
$$
So we do get to the correct answer.

Now let's go to the general case.

We have:
$$
L = \sum\_{i = 0}^N \beta^i (d(L)y\_i)(d(L)y\_i)
$$
Let's write out the laggs:
$$
L = \sum\_{i = 0}^N \beta^i \left(\sum\_{j = 0}^m d\_j y\_{i-j}\right)\left(\sum\_{k = 0}^m d\_k y\_{i-k}\right)
$$
If we take the derivative with respect to $y\_t$ then there are two occurences of $y\_t$ once where $i-j = t$ and once where $i -k = t$. Also, notice that $d\_j$ is only defined for $0 \le j \le m$ which means that $y\_t$ in these terms only occurs when the summation index $i$ is between $t$ and $m+t$ (as such, the summation bounds can be reduced to go from $t$ to $m+t$).

This gives:
$$
\dfrac{\partial L}{\partial y\_t} = \sum\_{i = t}^{m+t} \beta^i d\_{i-t} \left(\sum\_{k = 0}^m d\_{k} y\_{i-k}\right) + \sum\_{i = t}^{m+t} \beta^i \left(d\_{i-t} \sum\_{j = 0}^m d\_j y\_{i - j}\right)
$$
These two terms are the same (replace the counter $k$ with $j$). So:
$$
\dfrac{\partial L}{\partial y\_t} = 2\sum\_{i = t}^{m+t} \beta^i d\_{i-t} \left(\sum\_{k = 0}^m d\_{k} y\_{i-k}\right)
$$
Now, we can take $\beta^t$ out of the summation to get:
$$
\dfrac{\partial L}{\partial y\_t} = 2 \beta^t \sum\_{i = t}^{m-t} \beta^{i-t} d\_{i-t} \left(\sum\_{k = 0}^m d\_{k} y\_{i-k}\right)
$$
Now, make a change of indices $r = i-t$ to substitute out $i$. This gives:
$$
\dfrac{\partial L}{\partial y\_t} = 2 \beta^t \sum\_{r = 0}^{m} \beta^{r} d\_{r} \left(\sum\_{k = 0}^m d\_{k} y\_{r+t-k}\right)
$$
We can introduce the lag operator:
$$
\begin{align\*}
\dfrac{\partial L}{\partial y\_t} &= 2 \beta^t \sum\_{r = 0}^{m} \beta^{r} d\_{r} \left(\sum\_{k = 0}^m d\_{k} L^{-r} y\_{t-k}\right)\\
&= 2 \beta^t \sum\_{r = 0}^{m} \beta^r d\_r L^{-r} \underbrace{\left(\sum\_{k = 0} d\_k y\_{t-k}\right)}\_{d(L)y\_t}
\end{align\*}
$$
So we obtain:
$$
\dfrac{\partial L}{\partial y\_t} = 2 \beta^t \sum\_{r = 0}^{m} \beta^{r} d\_{r} L^{-r} d(L)y\_t = 2 \beta^t d(\beta L^{-1}) d(L) y\_t
$$

> **Comments:**
> **username_0**: wow. thank you for going into so much detail. I will print out and go over it carefully. It's really generous of you. and it's impressive too. thanks again.  
> **username_0**: oh, once I go over it and hopefully follow it, I'll give a check or a number or whatever.  
> **username_0**: I'm only halfway through your answer but it's TREMENDOUS and so much clearer than the original text.  I checked it and added a number. Thanks. Oh, one suggestion is to put $\beta$ in the initial L expression for your toy example. It's just a typo. I hope that your students appreciate your talent and clarity.  
> **username_0**: I did follow most of your steps. It's really great and then how you explain everything at each step is so helpful. The one part I can't get is what justifies the extra $d_{t-i}$ values that get put in the line starting with "this gives".  I followed what you said about the counters being non-zero only in certain regions but I still don't see the emergence of those $d_{t-i}$. The first one is on the outside in the first term and second one is on the inside in the second term. That's not my problem ( atleast right now ). My question is how do they exist from seemingly nowhere ? Thanks.  
> **username_1**: To see the index, consider the first $y_t$, which occurs when $i-j = t$, or equivalently $j = i - t$. As such, the $d_j$ associated to this $y_{i-j}$ takes the value $d_{i-t}$ (substitute the $j$ index with an $i-t$ index).  
> **username_0**: I get it now. all I can say is that it's a really nice derivation. I wonder if sargent does this in his head because he makes no reference to it being complicated.  

---

