# AR and ARCH Models

In statistics, econometrics and signal processing, an autoregressive (AR) model is a representation of a type of random process; as such, it is used to describe certain time-varying processes in nature, economics, etc. The autoregressive model specifies that the output variable depends linearly on its own previous values and on a stochastic term (an imperfectly predictable term); thus the model is in the form of a stochastic difference equation (or recurrence relation which should not be confused with differential equation). Together with the moving-average (MA) model, it is a special case and key component of the more general autoregressive–moving-average (ARMA) and autoregressive integrated moving average (ARIMA) models of time series, which have a more complicated stochastic structure; it is also a special case of the vector autoregressive model (VAR), which consists of a system of more than one interlocking stochastic difference equation in more than one evolving random variable.

Contrary to the moving-average (MA) model, the autoregressive model is not always stationary as it may contain a unit root.

## Definition

The notation AR($p$) indicates an autoregressive model of order $p$. The AR($p$) model is defined as

[$] X_t = c + \sum_{i=1}^p \varphi_i X_{t-i}+ \varepsilon_t \,[$]

where $\varphi_1, \ldots, \varphi_p$ are the parameters of the model, $c$ is a constant, and $\varepsilon_t$ is white noise. This can be equivalently written using the backshift operator B as

[$] X_t = c + \sum_{i=1}^p \varphi_i B^i X_t + \varepsilon_t [$]

so that, moving the summation term to the left side and using polynomial notation, we have

[$]\phi [B]X_t= c + \varepsilon_t \, .[$]

Some parameter constraints are necessary for the model to remain wide-sense stationary. For example, processes in the AR(1) model with $|\varphi_1 | \geq 1$ are not stationary. More generally, for an AR($p$) model to be wide-sense stationary, the roots of the polynomial $\Phi(z):=\textstyle 1 - \sum_{i=1}^p \varphi_i z^{i}$ must lie outside the unit circle, i.e., each (complex) root $z_i$ must satisfy $|z_i |\gt1$ (see pages 89,92 ).

## Intertemporal effect of shocks

In an AR process, a one-time shock affects values of the evolving variable infinitely far into the future. For example, consider the AR(1) model $X_t = c + \varphi_1 X_{t-1} + \varepsilon_t$. A non-zero value for $\varepsilon_t$ at say time t=1 affects $X_1$ by the amount $\varepsilon_1$. Then by the AR equation for $X_2$ in terms of $X_1$, this affects $X_2$ by the amount $\varphi_1 \varepsilon_1$. Then by the AR equation for $X_3$ in terms of $X_2$, this affects $X_3$ by the amount $\varphi_1^2 \varepsilon_1$. Continuing this process shows that the effect of $\varepsilon_1$ never ends, although if the process is stationary then the effect diminishes toward zero in the limit.

Because each shock affects X values infinitely far into the future from when they occur, any given value Xt is affected by shocks occurring infinitely far into the past. This can also be seen by rewriting the autoregression

[$]\phi (B)X_t= \varepsilon_t \,[$]

(where the constant term has been suppressed by assuming that the variable has been measured as deviations from its mean) as

[$]X_t= \frac{1}{\phi (B)}\varepsilon_t \, .[$]

When the polynomial division on the right side is carried out, the polynomial in the backshift operator applied to $\varepsilon_t$ has an infinite order—that is, an infinite number of lagged values of $\varepsilon_t$ appear on the right side of the equation.

## Characteristic polynomial

The autocorrelation function of an AR($p$) process can be expressed as Template:Citation needed

[$]\rho(\tau) = \sum_{k=1}^p a_k y_k^{-|\tau|} ,[$]

where $y_k$ are the roots of the polynomial

[$]\phi(B) = 1- \sum_{k=1}^p \varphi_k B^k [$]

where $B$ is the backshift operator, where $\phi(\cdot)$ is the function defining the autoregression, and where $\varphi_k$ are the coefficients in the autoregression. The formula is valid only if all the roots have multiplicity 1.

The autocorrelation function of an AR($p$) process is a sum of decaying exponentials.

• Each real root contributes a component to the autocorrelation function that decays exponentially.
• Similarly, each pair of complex conjugate roots contributes an exponentially damped oscillation.

## Graphs of AR($p$) processes

The simplest AR process is AR(0), which has no dependence between the terms. Only the error/innovation/noise term contributes to the output of the process, so in the figure, AR(0) corresponds to white noise.

For an AR(1) process with a positive $\varphi$, only the previous term in the process and the noise term contribute to the output. If $\varphi$ is close to 0, then the process still looks like white noise, but as $\varphi$ approaches 1, the output gets a larger contribution from the previous term relative to the noise. This results in a "smoothing" or integration of the output, similar to a low pass filter.

For an AR(2) process, the previous two terms and the noise term contribute to the output. If both $\varphi_1$ and $\varphi_2$ are positive, the output will resemble a low pass filter, with the high frequency part of the noise decreased. If $\varphi_1$ is positive while $\varphi_2$ is negative, then the process favors changes in sign between terms of the process. The output oscillates. This can be likened to edge detection or detection of change in direction.

## Example: An AR(1) process

An AR(1) process is given by:

[$]X_t = c + \varphi X_{t-1}+\varepsilon_t\,[$]

where $\varepsilon_t$ is a white noise process with zero mean and constant variance $\sigma_\varepsilon^2$. (Note: The subscript on $\varphi_1$ has been dropped.) The process is wide-sense stationary if $|\varphi|\lt1$ since it is obtained as the output of a stable filter whose input is white noise. (If $\varphi=1$ then the variance of $X_t$ depends on time lag t, so that the variance of the series diverges to infinity as t goes to infinity, and is therefore not wide sense stationary.) Assuming $|\varphi|\lt1$, the mean $\operatorname{E} (X_t)$ is identical for all values of t by the very definition of wide sense stationarity. If the mean is denoted by $\mu$, it follows from

[$]\operatorname{E} (X_t)=\operatorname{E} (c)+\varphi\operatorname{E} (X_{t-1})+\operatorname{E}(\varepsilon_t), [$]

that

[$] \mu=c+\varphi\mu+0,[$]

and hence

[$]\mu=\frac{c}{1-\varphi}.[$]

In particular, if $c = 0$, then the mean is 0.

The variance is

[$]\textrm{var}(X_t)=\operatorname{E}(X_t^2)-\mu^2=\frac{\sigma_\varepsilon^2}{1-\varphi^2},[$]

where $\sigma_\varepsilon$ is the standard deviation of $\varepsilon_t$. This can be shown by noting that

[$]\textrm{var}(X_t) = \varphi^2\textrm{var}(X_{t-1}) + \sigma_\varepsilon^2,[$]

and then by noticing that the quantity above is a stable fixed point of this relation.

The autocovariance is given by

[$]B_n=\operatorname{E}(X_{t+n}X_t)-\mu^2=\frac{\sigma_\varepsilon^2}{1-\varphi^2}\,\,\varphi^{|n|}.[$]

It can be seen that the autocovariance function decays with a decay time (also called time constant) of $\tau=-1/\ln(\varphi)$ [to see this, write $B_n=K\varphi^{|n|}$ where $K$ is independent of $n$. Then note that $\varphi^{|n|}=e^{|n|\ln\varphi}$ and match this to the exponential decay law $e^{-n/\tau}$].

The spectral density function is the Fourier transform of the autocovariance function. In discrete terms this will be the discrete-time Fourier transform:

[$]\Phi(\omega)= \frac{1}{\sqrt{2\pi}}\,\sum_{n=-\infty}^\infty B_n e^{-i\omega n} =\frac{1}{\sqrt{2\pi}}\,\left(\frac{\sigma_\varepsilon^2}{1+\varphi^2-2\varphi\cos(\omega)}\right). [$]

This expression is periodic due to the discrete nature of the $X_j$, which is manifested as the cosine term in the denominator. If we assume that the sampling time ($\Delta t=1$) is much smaller than the decay time ($\tau$), then we can use a continuum approximation to $B_n$:

[$]B(t)\approx \frac{\sigma_\varepsilon^2}{1-\varphi^2}\,\,\varphi^{|t|}[$]

which yields a Lorentzian profile for the spectral density:

[$]\Phi(\omega)= \frac{1}{\sqrt{2\pi}}\,\frac{\sigma_\varepsilon^2}{1-\varphi^2}\,\frac{\gamma}{\pi(\gamma^2+\omega^2)}[$]

where $\gamma=1/\tau$ is the angular frequency associated with the decay time $\tau$.

An alternative expression for $X_t$ can be derived by first substituting $c+\varphi X_{t-2}+\varepsilon_{t-1}$ for $X_{t-1}$ in the defining equation. Continuing this process N times yields

[$]X_t=c\sum_{k=0}^{N-1}\varphi^k+\varphi^NX_{t-N}+\sum_{k=0}^{N-1}\varphi^k\varepsilon_{t-k}.[$]

For N approaching infinity, $\varphi^N$ will approach zero and:

[$]X_t=\frac{c}{1-\varphi}+\sum_{k=0}^\infty\varphi^k\varepsilon_{t-k}.[$]

It is seen that $X_t$ is white noise convolved with the $\varphi^k$ kernel plus the constant mean. If the white noise $\varepsilon_t$ is a Gaussian process then $X_t$ is also a Gaussian process. In other cases, the central limit theorem indicates that $X_t$ will be approximately normally distributed when $\varphi$ is close to one.

For $c = \varepsilon_t = 0$, the process $X_t = \varphi X_{t-1}$ will be a geometric progression (exponential growth or decay). In this case, the solution can be found analytically: $X_t = a \varphi^t$ whereby $a$ is an unknown constant (initial condition).

## Calculation of the AR parameters

There are many ways to estimate the coefficients, such as the ordinary least squares procedure or method of moments (through Yule–Walker equations).

The AR($p$) model is given by the equation

[$] X_t = \sum_{i=1}^p \varphi_i X_{t-i}+ \varepsilon_t.\,[$]

It is based on parameters $\varphi_i$ where i = 1, ..., $p$. There is a direct correspondence between these parameters and the covariance function of the process, and this correspondence can be inverted to determine the parameters from the autocorrelation function (which is itself obtained from the covariances). This is done using the Yule–Walker equations.

### Yule–Walker equations

The Yule–Walker equations, named for Udny Yule and Gilbert Walker, are the following set of equations.

[$]\gamma_m = \sum_{k=1}^p \varphi_k \gamma_{m-k} + \sigma_\varepsilon^2\delta_{m,0},[$]

where m = 0, …, $p$, yielding $p$ + 1 equations. Here $\gamma_m$ is the autocovariance function of Xt, $\sigma_\varepsilon$ is the standard deviation of the input noise process, and $\delta_{m,0}$ is the Kronecker delta function.

Because the last part of an individual equation is non-zero only if m = 0, the set of equations can be solved by representing the equations for m > 0 in matrix form, thus getting the equation

[$]\begin{bmatrix} \gamma_1 \\ \gamma_2 \\ \gamma_3 \\ \vdots \\ \gamma_p \\ \end{bmatrix} = \begin{bmatrix} \gamma_0 & \gamma_{-1} & \gamma_{-2} & \cdots \\ \gamma_1 & \gamma_0 & \gamma_{-1} & \cdots \\ \gamma_2 & \gamma_1 & \gamma_0 & \cdots \\ \vdots & \vdots & \vdots & \ddots \\ \gamma_{p-1} & \gamma_{p-2} & \gamma_{p-3} & \cdots \\ \end{bmatrix} \begin{bmatrix} \varphi_{1} \\ \varphi_{2} \\ \varphi_{3} \\ \vdots \\ \varphi_{p} \\ \end{bmatrix} [$]

which can be solved for all $\{\varphi_m; m=1,2, \dots ,p\}.$ The remaining equation for m = 0 is

[$]\gamma_0 = \sum_{k=1}^p \varphi_k \gamma_{-k} + \sigma_\varepsilon^2 ,[$]

which, once $\{\varphi_m ; m=1,2, \dots ,p \}$ are known, can be solved for $\sigma_\varepsilon^2 .$

An alternative formulation is in terms of the autocorrelation function. The AR parameters are determined by the first $p$+1 elements $\rho(\tau)$ of the autocorrelation function. The full autocorrelation function can then be derived by recursively calculating 

[$]\rho(\tau) = \sum_{k=1}^p \varphi_k \rho(k-\tau).[$]

Examples for some Low-order AR($p$) processes:

 $p=1$ $\gamma_1 = \varphi_1 \gamma_0$ $p=2$ The Yule–Walker equations for an AR(2) process are []\begin{align*}\gamma_1 &= \varphi_1 \gamma_0 + \varphi_2 \gamma_{-1} \\ \gamma_2 &= \varphi_1 \gamma_1 + \varphi_2 \gamma_0\end{align*}[] Remember that $\gamma_{-k} = \gamma_k$. Using the first equation yields $\rho_1 = \gamma_1 / \gamma_0 = \frac{\varphi_1}{1-\varphi_2}$. Using the recursion formula yields $\rho_2 = \gamma_2 / \gamma_0 = \frac{\varphi_1^2 - \varphi_2^2 + \varphi_2}{1 - \varphi_2}$

### Estimation of AR parameters

The above equations (the Yule–Walker equations) provide several routes to estimating the parameters of an AR($p$) model, by replacing the theoretical covariances with estimated values. Some of these variants can be described as follows:

• Estimation of autocovariances or autocorrelations. Here each of these terms is estimated separately, using conventional estimates. There are different ways of doing this and the choice between these affects the properties of the estimation scheme. For example, negative estimates of the variance can be produced by some choices.
• Formulation as a least squares regression problem in which an ordinary least squares prediction problem is constructed, basing prediction of values of Xt on the $p$ previous values of the same series. This can be thought of as a forward-prediction scheme. The normal equations for this problem can be seen to correspond to an approximation of the matrix form of the Yule–Walker equations in which each appearance of an autocovariance of the same lag is replaced by a slightly different estimate.
• Formulation as an extended form of ordinary least squares prediction problem. Here two sets of prediction equations are combined into a single estimation scheme and a single set of normal equations. One set is the set of forward-prediction equations and the other is a corresponding set of backward prediction equations, relating to the backward representation of the AR model:

[$] X_t = c + \sum_{i=1}^p \varphi_i X_{t-i}+ \varepsilon^*_t \,.[$]

Here predicted values of Xt would be based on the $p$ future values of the same series. This way of estimating the AR parameters is due to Burg, and is called the Burg method: Burg and later authors called these particular estimates "maximum entropy estimates", but the reasoning behind this applies to the use of any set of estimated AR parameters. Compared to the estimation scheme using only the forward prediction equations, different estimates of the autocovariances are produced, and the estimates have different stability properties. Burg estimates are particularly associated with maximum entropy spectral estimation.

Other possible approaches to estimation include maximum likelihood estimation. Two distinct variants of maximum likelihood are available: in one (broadly equivalent to the forward prediction least squares scheme) the likelihood function considered is that corresponding to the conditional distribution of later values in the series given the initial $p$ values in the series; in the second, the likelihood function considered is that corresponding to the unconditional joint distribution of all the values in the observed series. Substantial differences in the results of these approaches can occur if the observed series is short, or if the process is close to non-stationarity.

## Evaluating the quality of forecasts

The predictive performance of the autoregressive model can be assessed as soon as estimation has been done if cross-validation is used. In this approach, some of the initially available data was used for parameter estimation purposes, and some (from available observations later in the data set) was held back for out-of-sample testing. Alternatively, after some time has passed after the parameter estimation was conducted, more data will have become available and predictive performance can be evaluated then using the new data.

In either case, there are two aspects of predictive performance that can be evaluated: one-step-ahead and n-step-ahead performance. For one-step-ahead performance, the estimated parameters are used in the autoregressive equation along with observed values of X for all periods prior to the one being predicted, and the output of the equation is the one-step-ahead forecast; this procedure is used to obtain forecasts for each of the out-of-sample observations. To evaluate the quality of n-step-ahead forecasts, the forecasting procedure in the previous section is employed to obtain the predictions.

Given a set of predicted values and a corresponding set of actual values for X for various time periods, a common evaluation technique is to use the mean squared prediction error; other measures are also available (see forecasting#forecasting accuracy).

The question of how to interpret the measured forecasting accuracy arises—for example, what is a "high" (bad) or a "low" (good) value for the mean squared prediction error? There are two possible points of comparison. First, the forecasting accuracy of an alternative model, estimated under different modeling assumptions or different estimation techniques, can be used for comparison purposes. Second, the out-of-sample accuracy measure can be compared to the same measure computed for the in-sample data points (that were used for parameter estimation) for which enough prior data values are available (that is, dropping the first $p$ data points, for which $p$ prior data points are not available). Since the model was estimated specifically to fit the in-sample points as well as possible, it will usually be the case that the out-of-sample predictive performance will be poorer than the in-sample predictive performance. But if the predictive quality deteriorates out-of-sample by "not very much" (which is not precisely definable), then the forecaster may be satisfied with the performance.

## Autoregressive conditional heteroskedasticity

In econometrics, the autoregressive conditional heteroskedasticity (ARCH) model is a statistical model for time series data that describes the variance of the current error term or innovation as a function of the actual sizes of the previous time periods' error terms; often the variance is related to the squares of the previous innovations. The ARCH model is appropriate when the error variance in a time series follows an autoregressive (AR) model; if an autoregressive moving average (ARMA) model is assumed for the error variance, the model is a generalized autoregressive conditional heteroskedasticity (GARCH) model.

ARCH models are commonly employed in modeling financial time series that exhibit time-varying volatility and volatility clustering, i.e. periods of swings interspersed with periods of relative calm. ARCH-type models are sometimes considered to be in the family of stochastic volatility models, although this is strictly incorrect since at time t the volatility is completely pre-determined (deterministic) given previous values.

### Model specification

To model a time series using an ARCH process, let $~\epsilon_t~$denote the error terms (return residuals, with respect to a mean process), i.e. the series terms. These $~\epsilon_t~$ are split into a stochastic piece $z_t$ and a time-dependent standard deviation $\sigma_t$ characterizing the typical size of the terms so that

[$] ~\epsilon_t=\sigma_t z_t ~[$]

The random variable $z_t$ is a strong white noise process. The series $\sigma_t^2$ is modeled by

[$] \sigma_t^2=\alpha_0+\alpha_1 \epsilon_{t-1}^2+\cdots+\alpha_q \epsilon_{t-q}^2 = \alpha_0 + \sum_{i=1}^q \alpha_{i} \epsilon_{t-i}^2 [$]

, where $~\alpha_0\gt0~$ and $\alpha_i\ge 0,~i\gt0$.

An ARCH($q$) model can be estimated using ordinary least squares. A method for testing whether the residuals $\epsilon_t$ exhibit time-varying heteroskedasticity using the Lagrange multiplier test was proposed by Engle (1982). This procedure is as follows:

Heteroskedasticity Test
1. Estimate the best fitting autoregressive model AR($q$)
[$] y_t = a_0 + a_1 y_{t-1} + \cdots + a_q y_{t-q} + \epsilon_t = a_0 + \sum_{i=1}^q a_i y_{t-i} + \epsilon_t. [$]
2. Obtain the squares of the error $\hat \epsilon^2$ and regress them on a constant and $q$ lagged values:
[$] \hat \epsilon_t^2 = \hat \alpha_0 + \sum_{i=1}^{q} \hat \alpha_i \hat \epsilon_{t-i}^2[$]
where $q$ is the length of ARCH lags.
3. The null hypothesis is that, in the absence of ARCH components, we have $\alpha_i = 0$ for all $i = 1, \cdots, q$. The alternative hypothesis is that, in the presence of ARCH components, at least one of the estimated $\alpha_i$ coefficients must be significant. In a sample of T residuals under the null hypothesis of no ARCH errors, the test statistic T'R² follows $\chi^2$ distribution with $q$ degrees of freedom, where $T'$ is the number of equations in the model which fits the residuals vs the lags (i.e. $T'=T-q$). If T'R² is greater than the Chi-square table value, we reject the null hypothesis and conclude there is an ARCH effect in the ARMA model. If T'R² is smaller than the Chi-square table value, we do not reject the null hypothesis.