# Autoregressive moving average model

Autoregressive moving average model

In statistics, autoregressive moving average (ARMA) models, sometimes called Box-Jenkins models after the iterative Box-Jenkins methodology usually used to estimate them, are typically applied to time series data.

Given a time series of data "X""t", 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_\left\{i=1\right\}^p varphi_i X_\left\{t-i\right\}+ varepsilon_t .,$

where $varphi_1, ldots, varphi_p$ are the "parameters" of the model, $c$ is a constant and $varepsilon_t$ is white noise. The constant term is omitted by many authors for simplicity.

An autoregressive model is essentially an all-pole 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| &ge; 1 are not stationary.

Example: An AR(1)-process

An AR(1)-process is given by:

:$X_t = c + varphi X_\left\{t-1\right\}+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 wide sense 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 wide sense stationary.) Assuming $|varphi|<1$ and denoting the mean by $mu$, we get

:$mbox\left\{E\right\}\left(X_t\right)=mbox\left\{E\right\}\left(c\right)+varphimbox\left\{E\right\}\left(X_\left\{t-1\right\}\right)+mbox\left\{E\right\}\left(varepsilon_t\right)Rightarrow mu=c+varphimu+0.$

Thus

:$mu=frac\left\{c\right\}\left\{1-varphi\right\}.$

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

The variance can be shown to equal

:$extrm\left\{var\right\}\left(X_t\right)=E\left(X_t^2\right)-mu^2=frac\left\{sigma^2\right\}\left\{1-varphi^2\right\}.$

The autocovariance is given by

:$B_n=E\left(X_\left\{t+n\right\}X_t\right)-mu^2=frac\left\{sigma^2\right\}\left\{1-varphi^2\right\},,varphi^=e^$

which yields a Lorentzian profile for the spectral density:

:$Phi\left(omega\right)=frac\left\{1\right\}\left\{sqrt\left\{2pi,frac\left\{sigma^2\right\}\left\{1-varphi^2\right\},frac\left\{gamma\right\}\left\{pi\left(gamma^2+omega^2\right)\right\}$

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

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

:$X_t=csum_\left\{k=0\right\}^\left\{N-1\right\}varphi^k+varphi^NX_\left\{t-N\right\}+sum_\left\{k=0\right\}^\left\{N-1\right\}varphi^kvarepsilon_\left\{t-k\right\}.$

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

:$X_t=frac\left\{c\right\}\left\{1-varphi\right\}+sum_\left\{k=0\right\}^inftyvarphi^kvarepsilon_\left\{t-k\right\}.$

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.

Calculation of the AR parameters

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

:$X_t = sum_\left\{i=1\right\}^p varphi_i X_\left\{t-i\right\}+ 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:

:$gamma_m = sum_\left\{k=1\right\}^p varphi_k gamma_\left\{m-k\right\} + sigma_varepsilon^2delta_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 $delta_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

:

=

egin{bmatrix}gamma_0 & gamma_{-1} & gamma_{-2} & dots \gamma_1 & gamma_0 & gamma_{-1} & dots \gamma_2 & gamma_{1} & gamma_{0} & dots \vdots & vdots & vdots & ddots \end{bmatrix}

egin{bmatrix}varphi_{1} \varphi_{2} \varphi_{3} \ vdots \end{bmatrix}

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

:$gamma_0 = sum_\left\{k=1\right\}^p varphi_k gamma_\left\{-k\right\} + sigma_varepsilon^2$

which allows us to solve $sigma_varepsilon^2$.

The above equations (the Yule-Walker equations) provide one route to estimating the parameters of an AR(p) model, by replacing the theoretical covariances with estimated values. One way of specificying the estimated covariances is equivalent to a calculation using least squares regression of values "X""t" on the "'p" previous values of the same series.

Derivation

The equation defining the AR process is

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

Multiplying both sides by "X""t" − "m" and taking expected value yields

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

Now, E ["X""t""X""t" − "m"] = γ"m" by definition of the autocorrelation function. The values of the noise function are independent of each other, and "X""t" − "m" is independent of εt where "m" is greater than zero. For "m" > 0, E [ε"t""X""t" − "m"] = 0. For "m" = 0,

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

Now we have, for "m" ≥ 0,

:$gamma_m = Eleft \left[sum_\left\{i=1\right\}^p varphi_i,X_\left\{t-i\right\} X_\left\{t-m\right\} ight\right] + sigma_varepsilon^2 delta_m.$

Furthermore,

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

which yields the Yule-Walker equations:

:$gamma_m = sum_\left\{i=1\right\}^p varphi_i gamma_\left\{m-i\right\} + sigma_varepsilon^2 delta_m.$

for "m" ≥ 0. For "m" < 0,

:$gamma_m = gamma_\left\{-m\right\} = sum_\left\{i=1\right\}^p varphi_i gamma_\left\{|m|-i\right\} + 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_\left\{i=1\right\}^q heta_i varepsilon_\left\{t-i\right\},$

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_\left\{i=1\right\}^p varphi_i X_\left\{t-i\right\} + sum_\left\{i=1\right\}^q heta_i varepsilon_\left\{t-i\right\}.,$

The error terms εt are generally assumed to be independent identically-distributed random variables (i.i.d.) sampled from a normal distribution with zero mean: εt ~ N(0,σ2) where σ2 isthe 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\left(1 - sum_\left\{i=1\right\}^p varphi_i L^i ight\right) X_t = varphi X_t,$

where φ represents the polynomial

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

The MA("q") model is given by

:$X_t = left\left(1 + sum_\left\{i=1\right\}^q heta_i L^i ight\right) varepsilon_t = heta varepsilon_t , ,$

where θ represents the polynomial

:$heta= 1 + sum_\left\{i=1\right\}^q heta_i L^i .,$

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

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

or more concisely,

:$varphi X_t = heta varepsilon_t ,$

Alternative notation

Some authors, including Box, Jenkins & Reinsel (1994) use a different convention for the autoregression coefficients. This allows all the polynomials involving the lag operator to appear in a similar form throughout. Thus the ARMA model would be written as:$left\left(1 + sum_\left\{i=1\right\}^p phi_i L^i ight\right) X_t = left\left(1 + sum_\left\{i=1\right\}^q heta_i L^i ight\right) 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 the Yule-Walker equations may be used to provide a fit.

Implementations in statistics packages

* In R, library "tseries" includes an "arma" function. The function is documented in [http://finzi.psych.upenn.edu/R/library/tseries/html/arma.html "Fit ARMA Models to Time Series"] .
* MATLAB includes a function "ar" to estimate AR models, [http://www.mathworks.com/access/helpdesk/help/toolbox/ident/index.html?/access/helpdesk/help/toolbox/ident/ref/ar.html see here for more details] .
* gretl probably can also estimate ARMA models, [http://constantdream.wordpress.com/2008/03/16/gnu-regression-econometrics-and-time-series-library-gretl/ see here where it's mentioned] .

Applications

ARMA is appropriate when a system is a function of a series of unobserved shocks (the MA part)Clarifyme|date=March 2008 as well as its own behavior. For example, stock prices may be shocked by fundamental information as well as exhibiting technical trending and mean-reversion effects due to market participants.

Generalizations

The dependence of "X""t" 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 vector ARIMA (or VARIMA) model may be fitted. If the time-series in question exhibits long memory then fractional ARIMA (FARIMA, sometimes called ARFIMA) modelling may be appropriate: see Autoregressive fractionally integrated moving average. If the data is thought to contain seasonal effects, it may be modeled by a SARIMA (seasonal ARIMA) or a periodic ARMA 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.

Note that the ARMA model is an univariate model. Extensions for the multivariate case are the Vector Autoregression (VAR) and Vector Autoregression Moving-Average (VARMA).

Autoregressive moving average model with exogenous inputs model (ARMAX model)

The notation ARMAX("p", "q", "b") refers to the model with "p" autoregressive terms, "q" moving average terms and "b" eXogenous inputs terms. This model contains the AR("p") and MA("q") models and a linear combination of the last "b" terms of a known and external time series $d_t$. It is given by:

:$X_t = varepsilon_t + sum_\left\{i=1\right\}^p varphi_i X_\left\{t-i\right\} + sum_\left\{i=1\right\}^q heta_i varepsilon_\left\{t-i\right\} + sum_\left\{i=1\right\}^b eta_i d_\left\{t-i\right\}.,$where $eta_1, ldots, eta_b$ are the "parameters" of the exogenous input $d_t$.

Some nonlinear variants of models with exogenous variables have been defined: see for example Nonlinear autoregressive exogenous model.

ee also

*ARIMA
*Predictive analytics
*Linear predictive coding

References

*George Box, Gwilym M. Jenkins, and Gregory C. Reinsel. "Time Series Analysis: Forecasting and Control", third edition. Prentice-Hall, 1994.
*Mills, Terence C. "Time Series Techniques for Economists." Cambridge University Press, 1990.
*Percival, Donald B. and Andrew T. Walden. "Spectral Analysis for Physical Applications." Cambridge University Press, 1993.
*Pandit, Sudhakar M. and Wu, Shien-Ming. "Time Series and System Analysis with Applications." John Wiley & Sons, Inc., 1983.

* [http://www.statsoft.com/textbook/stathome.html Electronic Statistics Textbook]

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Moving-average model — In time series analysis, the moving average (MA) model is a common approach for modeling univariate time series models. The notation MA(q) refers to the moving average model of order q: where μ is the mean of the series, the θ1, ..., θq are the… …   Wikipedia

• Autoregressive integrated moving average — In statistics, an autoregressive integrated moving average (ARIMA) model is a generalisation of an autoregressive moving average or (ARMA) model. These models are fitted to time series data either to better understand the data or to predict… …   Wikipedia

• Autoregressive fractionally integrated moving average — In statistics, autoregressive fractionally integrated moving average models are time series models that generalize ARIMA ( autoregressive integrated moving average ) models by allowing non integer values of the differencing parameter and are… …   Wikipedia

• Autoregressive Integrated Moving Average - ARIMA — A statistical analysis model that uses time series data to predict future trends. It is a form of regression analysis that seeks to predict future movements along the seemingly random walk taken by stocks and the financial market by examining the …   Investment dictionary

• Autoregressive conditional heteroskedasticity — ARCH redirects here. For the children s rights organization, see Action on Rights for Children. In econometrics, AutoRegressive Conditional Heteroskedasticity (ARCH) models are used to characterize and model observed time series. They are used… …   Wikipedia

• Economic model — A diagram of the IS/LM model In economics, a model is a theoretical construct that represents economic processes by a set of variables and a set of logical and/or quantitative relationships between them. The economic model is a simplified… …   Wikipedia

• Box-Jenkins Model — A mathematical model designed to forecast data within a time series. The Box Jenkin model alters the time series to make it stationary by using the differences between data points. This allows the model to pick out trends, typically using… …   Investment dictionary

• Generalized AutoRegressive Conditional Heteroskedasticity (GARCH) Process — An econometric term developed in 1982 by Robert F. Engle, an economist and 2003 winner of the Nobel Memorial Prize for Economics to describe an approach to estimate volatility in financial markets. There are several forms of GARCH modeling. The… …   Investment dictionary

• List of statistics topics — Please add any Wikipedia articles related to statistics that are not already on this list.The Related changes link in the margin of this page (below search) leads to a list of the most recent changes to the articles listed below. To see the most… …   Wikipedia

• Predictive analytics — encompasses a variety of techniques from statistics and data mining that analyze current and historical data to make predictions about future events. Such predictions rarely take the form of absolute statements, and are more likely to be… …   Wikipedia