Autoregressive Models

Quick Summary

Autoregressive Models

Once the data is made stationary (or if the data is stationary by default) we can move into a class of models called stationary models. One of the common stationary models, is the autoregressive (AR) model.

Often you can forecast a series based solely on the past values of the data. We are going to start by focusing on the most basic case with only one lag value of \(Y_t\), called the AR(1) model:

\[ Y_t = \omega + \phi Y_{t-1} + e_t \]

where \(e_t\) is the error remaining in the model and assumed to by white noise as defined in the previous section on stationarity.

With the AR(1) model, this relationship between t and t-1 exists for all one time period differences across the dataset. Therefore, we can recursively solve for \(Y_t\). We do this because we know that the equation for \(Y_{t-1}\) is:

\[ Y_{t-1} = \omega + \phi Y_{t-2} + e_t \]

By plugging this equation into the original equation of \(Y_t\) we have:

\[ Y_t = \omega + \phi (\omega + \phi Y_{t-2} + e_{t-1}) + e_t \]

\[ Y_t = \omega^* + \phi^2 Y_{t-2} + \phi e_{t-1} + e_t \]

We also know the equation for \(Y_{t-2}\) is the following:

\[ Y_{t-2} = \omega + \phi Y_{t-3} + e_{t-2} \]

By plugging this equation in the recursive solution of \(Y_t\) above we get:

\[ Y_t = \omega^* + \phi^2 (\omega + \phi Y_{t-3} + e_{t-2}) + \phi e_{t-1} + e_t \]

\[ Y_t = \omega^{**} + \phi^3 Y_{t-3} + \phi^2 e_{t-2} + \phi e_{t-1} + e_t \]

We can continue this process until we get back to the first data point at \(t=1\) in our dataset.

\[ Y_t = \frac{\omega}{1 - \phi} + \phi^t Y_1 + \phi^{t-1} e_2 + \phi^{t-2} e_3 + \cdots + e_t \]

We can see that the effect of shocks that happened long ago has little effect on the present value, \(Y_t\), as long as the value for \(|\phi| < 1\). This goes back to our idea of this being a stationary model. The dependence of previous observations declines over time. This means that although \(Y_1\) has some effect at \(Y_t\), that effect gets smaller the further away in time we are from \(Y_1\).

Correlation Functions

For data that follows an AR(1) structure, there are specific patterns we see in the autocorrelation and partial autocorrelation function. For a review of these functions, please see the previous section on correlation functions. With an AR(1) structure to our data, the autocorrelation function (ACF) decreases exponentially as the number of lags increases. The partial autocorrelation function (PACF) has a significant spike at the number one lag in the model, followed by nothing after.

Let’s imagine our data follows the following AR(1) process:

\[ Y_t = 0 + 0.8 Y_{t-1} + e_t \]

The following plots would be be the ACF and PACF of the data that follows the above structure.

In the ACF plot on the left above, the first lag takes a value of \(0.8\). The second lag is \(0.8^2 = 0.64\). The third lag is \(0.8^3 = 0.512\) and the pattern continues from there to get smaller as the lags go further back in time. For the PACF plot, the first lag takes a value of \(0.8\). The rest of the lags in the PACF take the value of zero because after accounting for the first lag, the remaining lags have no impact on the current time period.

AR(p) Model

This autoregressive model can be extended to include \(p\) lags instead of just one lag:

\[ Y_t = \omega + \phi_1 Y_{t-1} + \phi_2 Y_{t-2} + \cdots + \phi_p Y_{t-p} + e_t \]

With an autoregressive structure to our data, the autocorrelation function (ACF) decreases exponentially in the long run as the number of lags increases but with a variety of patterns. The partial autocorrelation function (PACF) has a significant spike up to \(p\) lags in the model, followed by nothing after.

The stationarity assumption still holds for this model as well with a slightly different requirement. Let’s look back at the AR(1) model after we recursively built it back into time:

\[ Y_t = \frac{\omega}{1 - \phi} + \phi^t Y_1 + \phi^{t-1} e_2 + \phi^{t-2} e_3 + \cdots + e_t \]

Look at the intercept in the previous equation. If the value of \(\phi = 1\), then the intercept would be \(\infty\). This is why we required \(|\phi| < 1\) for our model to be a stationary model.

Let’s now expand the AR(2) model back into time and see what it would look like:

\[ Y_t = \frac{\omega}{1 - \phi_1 - \phi_2} + \cdots + e_t \]

where \(\phi_1\) and \(\phi_2\) are the coefficients on the first two lags of \(Y_t\). In this scenario we would need \(|\phi_1 + \phi_2|<1\) for the model to have have an intercept take the value of \(\infty\). That is our stationarity condition for the AR(2) model.

Let’s now expand the AR(p) model back into time and see what it would look like:

\[ Y_t = \frac{\omega}{1 - \phi_1 - \cdots - \phi_p} + \cdots + e_t \]

where \(\phi_1\) through \(\phi_p\) are the coefficients on the first \(p\) lags of \(Y_t\). In this scenario we would need \(|\phi_1 + \cdots + \phi_p|<1\) for the model to have have an intercept take the value of \(\infty\). That is our stationarity condition for the AR(p) model.

Let’s see how to build this in each of our softwares!