<p>Charles: I still haven't had time to look carefully at tdm's soluton but I did make my own so, assuming mine is correct, you can have two choices for what to do. I also still plan on going over tdm's solution when I have more time.</p>
<p>The original model is an AR(2): <span class="math-container">$y_{t} = \phi_1 y_{t-1} + \phi_2 y_{t-2}$</span>.</p>
<p>Using the backshift operator, this can be re-written as</p>
<p><span class="math-container">$y_t(1 - \phi_{1} L) = \phi_2 y_{t-2} $</span></p>
<p><span class="math-container">$y_{t} = \frac{\phi_{2}}{(1 - \phi_{1} L)} y_{t-2}$</span></p>
<p>Assuming that <span class="math-container">$|\phi_{1}| &lt; 1$</span>, the denominator in the equation immediately above can be written as an infinite sum so that the expression for <span class="math-container">$y_{t}$</span> becomes:</p>
<p>`<span class="math-container">$y_{t} = \phi_{2} \sum_{i=0}^{\infty} \phi_{1}^{i} y_{t-2-i}$</span></p>
<p>So, given that one is at time <span class="math-container">$t$</span>, an expression for the prediction of <span class="math-container">$y_{t+1}$</span> can be written that is made up of the past <span class="math-container">$y_{t}$</span>. Specifically, if one wants to calculate the prediction of <span class="math-container">$y_{t+1}$</span>, then using the expression derives above but increasing the index by 1, results in:</p>
<p><span class="math-container">$\hat{y}_{t+1} = \phi_{2} \sum_{i=0}^{\infty} \phi_{1}^{i} y_{t - 2 + 1 - i}$</span></p>
<p>Note that the first term in the infinite sum above, is <span class="math-container">$y_{t-1}$</span> so everything in the sum is known at time <span class="math-container">$t$</span>.</p>
<p>Similarly, if one is at time <span class="math-container">$t$</span> and wants to calculate the prediction of  <span class="math-container">$y_{t+2}$</span>, then using the same expression but increasing the index by 2, results in:</p>
<p><span class="math-container">$\hat{y}_{t+2} = \phi_{2} \sum_{i=0}^{\infty} \phi_{1}^{i} y_{t - 2 + 2 -i}$</span></p>
<p>Again note that the first term in the infinite sum above, is <span class="math-container">$y_{t}$</span> so everything in the sum is known at time <span class="math-container">$t$</span>.</p>
<p>Similarly, if one is at time <span class="math-container">$t$</span> and wants to calculate the prediction of <span class="math-container">$y_{t+3}$</span>, then using the
same expression but increasing the index by 3, results in:</p>
<p><span class="math-container">$\hat{y}_{t+3} = \phi_{2} \sum_{i=0}^{\infty} \phi_{1}^{i} y_{t - 2 + 3 -i}$</span></p>
<p>Now notice that the first term in the infinite sum is <span class="math-container">$y_{t+1}$</span> which is not available at time <span class="math-container">$t$</span>. Therefore, for the first term in the sum, the prediction at time <span class="math-container">$t+1$</span>, <span class="math-container">$\hat{y}_{t+1}$</span>, needs to be used in place than the actual value, <span class="math-container">$y_{t+1}$</span>, since it is not known at time <span class="math-container">$t$</span>.</p>
<p>Similarly, for <span class="math-container">$\hat{y}_{t+4}$</span>, the predictions <span class="math-container">$\hat{y}_{t+1}$</span> and <span class="math-container">$\hat{y}_{t+2}$</span> will need to be used in the summation, in place of <span class="math-container">$y_{t+1}$</span> and <span class="math-container">$y_{t+2}$</span> since they are also not available at time <span class="math-container">$t$</span>.</p>
<p>Using the same argument, the same forecasting procedure can to be used all the way upto and including <span class="math-container">$\hat{y}_{t+k}$</span>.</p>
<p><span class="math-container">$\hat{y}_{t+k} = \phi_{2} \sum_{i=0}^{\infty} \phi_{1}^{i} y_{t - 2 + k - i}$</span></p>
<p>Note though that the previous predictions need to be used in place of <span class="math-container">$y_{t+1},y_{t+2},\ldots, y_{t+k-1}$</span> in the expression for the infinite sum. I hope this helps. It seems like there should be an easier way but I could not discern a pattern when I played around so this seemed like the only way.</p>

CC BY-SA 4.0
2021-05-23T16:40:57.957Z
No problem Charles: I hope it helps. one way to test the infinite sum formula is to run it and compare its output to the first couple that you derived. Of course, you need to simulate some AR(2) data in order to do that.
mark leeds
CC BY-SA 4.0
2021-05-17T03:30:57.973Z
2021-05-17T03:30:57.973Z
mark leeds
<p>Let's define <span class="math-container">$C_k$</span> such that:
<span class="math-container">$$
\mathbb{E}(y_{t+k}|y_t) = C_k y_t.
$$</span>
Then:
<span class="math-container">$$
\begin{align*}
\mathbb{E}(y_{t+k+1}|y_t) &amp;= \phi_1 \mathbb{E}(y_{t+k}|y_t) + \phi_2 \mathbb{E}(y_{t+k-1}|y_t),\\
&amp;= \phi_1 C_k y_t + \phi_2 C_{k-1} y_{t},\\
&amp;= (\phi_1 C_k + \phi_2 C_{k-1}) y_t
\end{align*}
$$</span>
This gives us the following recursive second order difference equation:
<span class="math-container">$$
C_{k+1} = \phi_1 C_k + \phi_2 C_{k-1}.
$$</span>
Or, updated one period:
<span class="math-container">$$
C_{k+2}- \phi_1 C_{k+1} - \phi_2 C_k = 0.
$$</span>
This is a second order homogeneous difference equation, which is of the form <span class="math-container">$C_k = \alpha a_1^k + \beta a_2^k$</span>. Computing <span class="math-container">$a_1$</span> and <span class="math-container">$a_2$</span> can be done by solving the following characteristic function:
<span class="math-container">$$
(a^2- \phi_1 a - \phi_2) = 0
$$</span>
This gives the following two roots:
<span class="math-container">$$
a_1 = \frac{\phi_1 + \sqrt{\phi_1^2 + 4 \phi_2}}{2} \text{ and } a_2 = \frac{\phi_1 - \sqrt{\phi_1^2 + 4 \phi_2}}{2}.
$$</span>
So in general we have:
<span class="math-container">$$
C_k = \alpha a_1^k + \beta a_2^k
$$</span>
To find <span class="math-container">$\alpha$</span> and <span class="math-container">$\beta$</span>, we need two starting values, say <span class="math-container">$C_0 = 1$</span> and <span class="math-container">$C_1 = \phi_1$</span>. In other words, we assume that <span class="math-container">$\mathbb{E}(y_t|y_t) = y_t$</span> and <span class="math-container">$\mathbb{E}(y_{t+1}|y_t) = \phi_1 y_t$</span>.</p>
<p>This gives the following two conditions:
<span class="math-container">$$
\alpha + \beta = 1\\
\alpha \left(\frac{\phi_1 + \sqrt{\phi_1^2 + 4 \phi_2}}{2}\right) + \beta \left(\frac{\phi_1 - \sqrt{\phi_1^2 + 4 \phi_2}}{2}\right) = \phi_1.\\
$$</span></p>
<p>Solving this system in terms of <span class="math-container">$\alpha$</span> and <span class="math-container">$\beta$</span> gives:
<span class="math-container">$$
\beta = \frac{\sqrt{\phi_1^2 + 4 \phi_2} - \phi_1}{2 \sqrt{\phi_1^2 + 4 \phi_2}}\\
\alpha = \frac{\phi_1 + \sqrt{\phi_1^2 + 4 \phi_2} }{2 \sqrt{\phi_1^2 + 4 \phi_2}}
$$</span></p>
<p>This gives the following closed form expression condition:
<span class="math-container">$$
\begin{align*}
\mathbb{E}(y_{t+k}|y_t) &amp;= C_k y_t,\\
&amp;=\left[\begin{array}{ll} &amp;\frac{\phi_1 + \sqrt{\phi_1^2 + 4 \phi_2} }{2 \sqrt{\phi_1^2 + 4 \phi_2}}\left(\frac{\phi_1 + \sqrt{\phi_1^2 + 4 \phi_2}}{2}\right)^k\\
+ &amp;\frac{\sqrt{\phi_1^2 + 4 \phi_2} - \phi_1}{2 \sqrt{\phi_1^2 + 4 \phi_2}} \left(\frac{\phi_1 - \sqrt{\phi_1^2 + 4 \phi_2}}{2}\right)^k\end{array}\right] y_t
\end{align*}
$$</span></p>

CC BY-SA 4.0
2021-05-15T01:13:55.720Z
that was n nice derivation but the OP was looking for a general non-recursive formula for the k-step ahead forecast.
mark leeds
CC BY-SA 4.0
2021-05-15T10:41:50.483Z
@mark leeds : The $k$ step ahead should be equal to $\mathbb{E}(y_{t+k}|y_t) = (\alpha a_1^t + \beta a_2^t) y_t$.
tdm
CC BY-SA 4.0
2021-05-15T14:23:55.630Z
Thanks. Did you mean to raise the $a's$ the $k$ and not to the $t$.  Charles: I have to look at it more carefully when I have time ( looks interesting ) but I'm not sure if it was what you were looking for based on what you first wrote in your question ? Also, tdm, why does $\alpha + \beta = 1 $ ?
mark leeds
CC BY-SA 4.0
2021-05-15T15:53:13.847Z
yes sorry , the $t$'s have to be $k$'s I will change it. The values of $\alpha$ and $\beta$ have to be determined based on two values of $C_k$. An example is $C_0$ and $C_1$ but other values are also possible. Have a look at how to solve 2nd order difference equations. Any math book for economists should have a chapter on this.
tdm
CC BY-SA 4.0
2021-05-16T01:37:53.360Z
thanks for correction. I'll definitely look more closely at what you did and do my best to follow it. What I'm not getting right now is that the optimal  k-step ahead prediction should not be random so it doesn't "feel right" that $C_{0}$ and C_{1}$ can have more than one value. But let me check it out more closely before you bother explaining more.
mark leeds
CC BY-SA 4.0
2021-05-14T16:26:21.073Z
2021-05-17T05:53:14.097Z
2021-05-17T05:53:14.097Z
tdm
<p>Given an AR(2) process <span class="math-container">$y_{t}=\phi_{1}y_{t-1}+\phi_2 y_{t-2}$</span>, I understand that the two-step ahead forecast (that is, <span class="math-container">$\mathbb{E}[y_{t+2}|y_t]$</span> is given by <span class="math-container">$(\phi_{1}^2+\phi_{2})y_{t}+\phi_{1}\phi_{2}y_{t-1}$</span>. However, I am unable to derive a general expression for the k-step ahead forecast (that is, for <span class="math-container">$\mathbb{E}[y_{t+k}|y_{t}]$</span>. How might I go about doing this? Thank you.</p>

CC BY-SA 4.0
2021-05-12T15:22:57.857Z
Hi: the only way to do is to assume some values for the error terms in the future. Usually, this is done by assuming that this value is equal to error term's expectation which is assumed to be zero. Once you do this, you can generalize your expression for k steps ahead.
mark leeds
CC BY-SA 4.0
2021-05-12T15:27:45.137Z
So would I keep iterating until I find a discernible pattern?
Charles
CC BY-SA 4.0
2021-05-12T20:51:24.273Z
Hi: yes, If you  do $y_3$, you'll probably see it. If not, let me know and I'll  try to help you out. I can't see it off the top of my head either.
mark leeds
<econometrics>
K-step ahead forecast for an AR(2)
Charles
# K-step ahead forecast for an AR(2)

(Asked by: username_0 on 2021-05-12)

Given an AR(2) process $y\_{t}=\phi\_{1}y\_{t-1}+\phi\_2 y\_{t-2}$, I understand that the two-step ahead forecast (that is, $\mathbb{E}[y\_{t+2}|y\_t]$ is given by $(\phi\_{1}^2+\phi\_{2})y\_{t}+\phi\_{1}\phi\_{2}y\_{t-1}$. However, I am unable to derive a general expression for the k-step ahead forecast (that is, for $\mathbb{E}[y\_{t+k}|y\_{t}]$. How might I go about doing this? Thank you.

**Tags:** econometrics
> **Comments:**
> **username_1**: Hi: the only way to do is to assume some values for the error terms in the future. Usually, this is done by assuming that this value is equal to error term's expectation which is assumed to be zero. Once you do this, you can generalize your expression for k steps ahead.  
> **username_0**: So would I keep iterating until I find a discernible pattern?  
> **username_1**: Hi: yes, If you  do $y_3$, you'll probably see it. If not, let me know and I'll  try to help you out. I can't see it off the top of my head either.  

---

## 2 answers

### Answer by username_1 on 2021-05-17. Score: 2 | Accepted answer

Charles: I still haven't had time to look carefully at tdm's soluton but I did make my own so, assuming mine is correct, you can have two choices for what to do. I also still plan on going over tdm's solution when I have more time.

The original model is an AR(2): $y\_{t} = \phi\_1 y\_{t-1} + \phi\_2 y\_{t-2}$.

Using the backshift operator, this can be re-written as

$y\_t(1 - \phi\_{1} L) = \phi\_2 y\_{t-2} $

$y\_{t} = \frac{\phi\_{2}}{(1 - \phi\_{1} L)} y\_{t-2}$

Assuming that $|\phi\_{1}| < 1$, the denominator in the equation immediately above can be written as an infinite sum so that the expression for $y\_{t}$ becomes:

`$y\_{t} = \phi\_{2} \sum\_{i=0}^{\infty} \phi\_{1}^{i} y\_{t-2-i}$

So, given that one is at time $t$, an expression for the prediction of $y\_{t+1}$ can be written that is made up of the past $y\_{t}$. Specifically, if one wants to calculate the prediction of $y\_{t+1}$, then using the expression derives above but increasing the index by 1, results in:

$\hat{y}\_{t+1} = \phi\_{2} \sum\_{i=0}^{\infty} \phi\_{1}^{i} y\_{t - 2 + 1 - i}$

Note that the first term in the infinite sum above, is $y\_{t-1}$ so everything in the sum is known at time $t$.

Similarly, if one is at time $t$ and wants to calculate the prediction of $y\_{t+2}$, then using the same expression but increasing the index by 2, results in:

$\hat{y}\_{t+2} = \phi\_{2} \sum\_{i=0}^{\infty} \phi\_{1}^{i} y\_{t - 2 + 2 -i}$

Again note that the first term in the infinite sum above, is $y\_{t}$ so everything in the sum is known at time $t$.

Similarly, if one is at time $t$ and wants to calculate the prediction of $y\_{t+3}$, then using the
same expression but increasing the index by 3, results in:

$\hat{y}\_{t+3} = \phi\_{2} \sum\_{i=0}^{\infty} \phi\_{1}^{i} y\_{t - 2 + 3 -i}$

Now notice that the first term in the infinite sum is $y\_{t+1}$ which is not available at time $t$. Therefore, for the first term in the sum, the prediction at time $t+1$, $\hat{y}\_{t+1}$, needs to be used in place than the actual value, $y\_{t+1}$, since it is not known at time $t$.

Similarly, for $\hat{y}\_{t+4}$, the predictions $\hat{y}\_{t+1}$ and $\hat{y}\_{t+2}$ will need to be used in the summation, in place of $y\_{t+1}$ and $y\_{t+2}$ since they are also not available at time $t$.

Using the same argument, the same forecasting procedure can to be used all the way upto and including $\hat{y}\_{t+k}$.

$\hat{y}\_{t+k} = \phi\_{2} \sum\_{i=0}^{\infty} \phi\_{1}^{i} y\_{t - 2 + k - i}$

Note though that the previous predictions need to be used in place of $y\_{t+1},y\_{t+2},\ldots, y\_{t+k-1}$ in the expression for the infinite sum. I hope this helps. It seems like there should be an easier way but I could not discern a pattern when I played around so this seemed like the only way.

> **Comments:**
> **username_1**: No problem Charles: I hope it helps. one way to test the infinite sum formula is to run it and compare its output to the first couple that you derived. Of course, you need to simulate some AR(2) data in order to do that.  

---

### Answer by username_2 on 2021-05-14. Score: 3

Let's define $C\_k$ such that:
$$
\mathbb{E}(y\_{t+k}|y\_t) = C\_k y\_t.
$$
Then:
$$
\begin{align\*}
\mathbb{E}(y\_{t+k+1}|y\_t) &= \phi\_1 \mathbb{E}(y\_{t+k}|y\_t) + \phi\_2 \mathbb{E}(y\_{t+k-1}|y\_t),\\
&= \phi\_1 C\_k y\_t + \phi\_2 C\_{k-1} y\_{t},\\
&= (\phi\_1 C\_k + \phi\_2 C\_{k-1}) y\_t
\end{align\*}
$$
This gives us the following recursive second order difference equation:
$$
C\_{k+1} = \phi\_1 C\_k + \phi\_2 C\_{k-1}.
$$
Or, updated one period:
$$
C\_{k+2}- \phi\_1 C\_{k+1} - \phi\_2 C\_k = 0.
$$
This is a second order homogeneous difference equation, which is of the form $C\_k = \alpha a\_1^k + \beta a\_2^k$. Computing $a\_1$ and $a\_2$ can be done by solving the following characteristic function:
$$
(a^2- \phi\_1 a - \phi\_2) = 0
$$
This gives the following two roots:
$$
a\_1 = \frac{\phi\_1 + \sqrt{\phi\_1^2 + 4 \phi\_2}}{2} \text{ and } a\_2 = \frac{\phi\_1 - \sqrt{\phi\_1^2 + 4 \phi\_2}}{2}.
$$
So in general we have:
$$
C\_k = \alpha a\_1^k + \beta a\_2^k
$$
To find $\alpha$ and $\beta$, we need two starting values, say $C\_0 = 1$ and $C\_1 = \phi\_1$. In other words, we assume that $\mathbb{E}(y\_t|y\_t) = y\_t$ and $\mathbb{E}(y\_{t+1}|y\_t) = \phi\_1 y\_t$.

This gives the following two conditions:
$$
\alpha + \beta = 1\\
\alpha \left(\frac{\phi\_1 + \sqrt{\phi\_1^2 + 4 \phi\_2}}{2}\right) + \beta \left(\frac{\phi\_1 - \sqrt{\phi\_1^2 + 4 \phi\_2}}{2}\right) = \phi\_1.\\
$$

Solving this system in terms of $\alpha$ and $\beta$ gives:
$$
\beta = \frac{\sqrt{\phi\_1^2 + 4 \phi\_2} - \phi\_1}{2 \sqrt{\phi\_1^2 + 4 \phi\_2}}\\
\alpha = \frac{\phi\_1 + \sqrt{\phi\_1^2 + 4 \phi\_2} }{2 \sqrt{\phi\_1^2 + 4 \phi\_2}}
$$

This gives the following closed form expression condition:
$$
\begin{align\*}
\mathbb{E}(y\_{t+k}|y\_t) &= C\_k y\_t,\\
&=\left[\begin{array}{ll} &\frac{\phi\_1 + \sqrt{\phi\_1^2 + 4 \phi\_2} }{2 \sqrt{\phi\_1^2 + 4 \phi\_2}}\left(\frac{\phi\_1 + \sqrt{\phi\_1^2 + 4 \phi\_2}}{2}\right)^k\\
+ &\frac{\sqrt{\phi\_1^2 + 4 \phi\_2} - \phi\_1}{2 \sqrt{\phi\_1^2 + 4 \phi\_2}} \left(\frac{\phi\_1 - \sqrt{\phi\_1^2 + 4 \phi\_2}}{2}\right)^k\end{array}\right] y\_t
\end{align\*}
$$

> **Comments:**
> **username_1**: that was n nice derivation but the OP was looking for a general non-recursive formula for the k-step ahead forecast.  
> **username_2**: @mark leeds : The $k$ step ahead should be equal to $\mathbb{E}(y_{t+k}|y_t) = (\alpha a_1^t + \beta a_2^t) y_t$.  
> **username_1**: Thanks. Did you mean to raise the $a's$ the $k$ and not to the $t$.  Charles: I have to look at it more carefully when I have time ( looks interesting ) but I'm not sure if it was what you were looking for based on what you first wrote in your question ? Also, tdm, why does $\alpha + \beta = 1 $ ?  
> **username_2**: yes sorry , the $t$'s have to be $k$'s I will change it. The values of $\alpha$ and $\beta$ have to be determined based on two values of $C_k$. An example is $C_0$ and $C_1$ but other values are also possible. Have a look at how to solve 2nd order difference equations. Any math book for economists should have a chapter on this.  
> **username_1**: thanks for correction. I'll definitely look more closely at what you did and do my best to follow it. What I'm not getting right now is that the optimal  k-step ahead prediction should not be random so it doesn't "feel right" that $C_{0}$ and C_{1}$ can have more than one value. But let me check it out more closely before you bother explaining more.  

---

