Autoregressive moving average

In statistics, autoregressive moving average (ARMA) models, sometimes called Box-Jenkins models after George Box and G. M. Jenkins, are typically applied to time series data.

Given a time series of data Xt, the ARMA model is a tool for understanding and, perhaps, predicting future values in this series. The model consists of two parts, an autoregressive (AR) part and a moving average (MA) part. The model is usually then referred to as the ARMA(p,q) model where p is the order of the autoregressive part and q is the order of the moving average part (as defined below).

Autoregressive model
The notation AR(p) refers to the autoregressive model of order p. The AR(p) model is written


 * $$ 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 an error term (see below). The constant term is omitted by many authors for simplicity.

An autoregressive model is essentially an infinite impulse response filter with some additional interpretation placed on it.

Some constraints are necessary on the values of the parameters of this model in order that the model remains stationary. For example, processes in the AR(1) model with |φ1| > 1 are not stationary.

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 variance $$\sigma^2$$. (Note: The subscript on $$\varphi_1$$ has been dropped.) The process is covariance-stationary if $$|\varphi|<1$$. If $$\varphi=1$$ then $$X_t$$ exhibits a unit root and can also be considered as a random walk, which is not covariance-stationary. Otherwise, the calculation of the expectation of $$X_t$$ is straightforward. Assuming covariance-stationarity we get


 * $$\mbox{E}(X_t)=\mbox{E}(c)+\varphi\mbox{E}(X_{t-1})+\mbox{E}(\varepsilon_t)\Rightarrow \mu=c+\varphi\mu+0.$$

thus:


 * $$\mu=\frac{c}{1-\varphi},$$

where $$\mu$$ is the mean. For c = 0, then the mean = 0 and the variance is found to be:


 * $$\textrm{var}(X_t)=E(X_t^2)-\mu^2=\frac{\sigma^2}{1-\varphi^2}.$$

The autocovariance is given by


 * $$B_n=E(X_{t+n}X_t)-\mu^2=\frac{\sigma^2}{1-\varphi^2}\,\,\varphi^{|n|}.$$

It can be seen that the autocovariance function decays with a decay time of $$\tau=-1/\ln(\varphi)$$. The spectral density function is the inverse Fourier transform of the autocovariance function. In discrete terms this will be the discrete-time inverse 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^2}{1+\varphi^2-2\varphi\cos(\omega)}\right). $$

This expression contains aliasing due to the discrete nature of the $$X_j$$. 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^2}{1-\varphi^2}\,\,\varphi^{|t|}$$

which yields a Lorentzian profile for the spectral density:


 * $$\Phi(\omega)=

=\frac{1}{\sqrt{2\pi}}\,\frac{\sigma^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_{\varphi-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. By the central limit theorem, the $$X_t$$ will be normally distributed as will any sample of $$X_t$$ which is much longer than the decay time of the autocorrelation function.

Calculation of the AR parameters
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. Those parameters may be calculated using Yule-Walker equations:



\gamma_m = \sum_{k=1}^p \varphi_k \gamma_{m-k} + \sigma_\varepsilon^2\delta_m $$

where m = 0, ..., p, yielding p + 1 equations. $$\gamma_m$$ is the autocorrelation function of X, $$\sigma_\varepsilon$$ is the standard deviation of the input noise process, and δm is the Kronecker delta function.

Because the last part of the equation is non-zero only if m = 0, the equation is usually solved by representing it as a matrix for m > 0, thus getting equation


 * $$\begin{bmatrix}

\gamma_1 \\ \gamma_2 \\ \gamma_3 \\ \vdots \\ \end{bmatrix}

=

\begin{bmatrix} \gamma_0 & \gamma_{-1} & \gamma_{-2} & \dots \\ \gamma_1 & \gamma_0 & \gamma_{-1} & \dots \\ \gamma_2 & \gamma_{1} & \gamma_{0} & \dots \\ \dots     & \dots         & \dots       & \dots \\ \end{bmatrix}

\begin{bmatrix} \varphi_{1} \\ \varphi_{2} \\ \varphi_{3} \\ \vdots \\ \end{bmatrix}

$$

solving all $$\varphi$$. For m = 0 have



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

which allows us to solve $$\sigma_\varepsilon^2$$.

Derivation
The equation defining the AR process is


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

Multiplying both sides by Xt-m and taking expected value yields


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

Now, $$E[X_t X_{t-m}] =\gamma_m$$ by definition of the autocorrelation function. The values of the noise function are independent of each other, and Xt &minus; m is independent of εt where m is greater than zero. For m ≠ 0, $$E[\varepsilon_t X_{t-m}] = 0$$. For m = 0,


 * $$E[\varepsilon_t X_{t}]

= E\left[\varepsilon_t (\sum_{i=1}^p \varphi_i\,X_{t-i}+ \varepsilon_t)\right] = \sum_{i=1}^p \varphi_i\, E[\varepsilon_t\,X_{t-i}] + E[\varepsilon_t^2] = 0 + \sigma_\varepsilon^2, $$

Now we have


 * $$\gamma_m = E\left[\sum_{i=1}^p \varphi_i\,X_{t-i} X_{t-m}\right] + \sigma_\varepsilon^2 \delta_m.$$

Furthermore,


 * $$E\left[\sum_{i=1}^p \varphi_i\,X_{t-i} X_{t-m}\right]

= \sum_{i=1}^p \varphi_i\,E[X_{t} X_{t-m+i}] = \sum_{i=1}^p \varphi_i\,\gamma_{m-i}, $$

which yields the Yule-Walker equations:


 * $$\gamma_m = \sum_{i=1}^p \varphi_i \gamma_{m-i} + \sigma_\varepsilon^2 \delta_m.$$

Moving average model
The notation MA(q) refers to the moving average model of order q:


 * $$ X_t = \varepsilon_t + \sum_{i=1}^q \theta_i \varepsilon_{t-i}\,$$

where the θ1, ..., θq are the parameters of the model and the εt, εt-1,... are again, the error terms. The moving average model is essentially a finite impulse response filter with some additional interpretation placed on it.

Autoregressive moving average model
The notation ARMA(p, q) refers to the model with p autoregressive terms and q moving average terms. This model contains the AR(p) and MA(q) models,


 * $$ X_t = \varepsilon_t + \sum_{i=1}^p \varphi_i X_{t-i} + \sum_{i=1}^q \theta_i \varepsilon_{t-i}.\,$$

Note about the error terms
The error terms εt are generally assumed to be independent identically-distributed random variables sampled from a normal distribution with zero mean: εt ~ N(0,σ2) where σ2 is the variance. These assumptions may be weakened but doing so will change the properties of the model. In particular, a change to the i.i.d. assumption would make a rather fundamental difference.

Specification in terms of lag operator
In some texts the models will be specified in terms of the lag operator L. In these terms then the AR(p) model is given by


 * $$ \varepsilon_t = \left(1 - \sum_{i=1}^p \varphi_i L^i\right) X_t = \varphi X_t\,$$

where φ represents polynomial


 * $$ \varphi = 1 - \sum_{i=1}^p \varphi_i L^i.\,$$

The MA(q) model is given by


 * $$ X_t = \left(1 + \sum_{i=1}^q \theta_i L^i\right) \varepsilon_t = \theta \varepsilon_t\,$$

where θ represents the polynomial


 * $$ \theta= 1 + \sum_{i=1}^q \theta_i L^i.\,$$

Finally, the combined ARMA(p, q) model is given by


 * $$ \left(1 - \sum_{i=1}^p \varphi_i L^i\right) X_t = \left(1 + \sum_{i=1}^q \theta_i L^i\right) \varepsilon_t\,$$

or more concisely,


 * $$ \varphi X_t = \theta \varepsilon_t.\,$$

Fitting models
ARMA models in general can, after choosing p and q, be fitted by least squares regression to find the values of the parameters which minimize the error term. It is generally considered good practice to find the smallest values of p and q which provide an acceptable fit to the data. For a pure AR model then the Yule-Walker equations may be used to provide a fit.

Generalizations
The dependence of Xt on past values and the error terms εt is assumed to be linear unless specified otherwise. If the dependence is nonlinear, the model is specifically called a nonlinear moving average (NMA), nonlinear autoregressive (NAR), or nonlinear autoregressive moving average (NARMA) model.

Autoregressive moving average models can be generalized in other ways. See also autoregressive conditional heteroskedasticity (ARCH) models and autoregressive integrated moving average (ARIMA) models. If multiple time series are to be fitted then a vectored ARIMA (or VARIMA) model may be fitted. If the time-series in question exhibits long memory then fractional ARIMA (FARIMA, sometimes called ARFIMA) modelling is appropriate. If the data is thought to contain seasonal effects, it may be modeled by a SARIMA (seasonal ARIMA) model.

Another generalization is the multiscale autoregressive (MAR) model. A MAR model is indexed by the nodes of a tree, whereas a standard (discrete time) autoregressive model is indexed by integers. See multiscale autoregressive model for a list of references.