Autoregressive model
In statistics and signal processing, an autoregressive (AR) model is a type of random process which is often used to model and predict various types of natural phenomena. The autoregressive model is one of a group of linear prediction formulas that attempt to predict an output of a system based on the previous outputs.
Definition
The notation AR(p) indicates an autoregressive model of order p. The AR(p) model is defined as
where are the parameters of the model, is a constant (often omitted for simplicity) and is white noise.
An autoregressive model can thus be viewed as the output of an all-pole infinite impulse response filter whose input is white noise.
Some constraints are necessary on the values of the parameters of this model in order that the model remains wide-sense stationary. For example, processes in the AR(1) model with |φ1| ≥ 1 are not stationary. More generally, for an AR(p) model to be wide-sense stationary, the roots of the polynomial must lie within the unit circle, i.e., each root must satisfy .
Characteristic polynomial
The autocorrelation function of an AR(p) process can be expressed as [citation needed]
where are the roots of the polynomial
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 , only the previous term in the process and the noise term contribute to the output. If is close to 0, then the process still looks like white noise, but as 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 and are positive, the output will resemble a low pass filter, with the high frequency part of the noise decreased. If is positive while is negative, then the process favors changes in sign between terms of the process. The output oscillates.
Example: An AR(1)-process
An AR(1)-process is given by:
where is a white noise process with zero mean and variance . (Note: The subscript on has been dropped.) The process is wide-sense stationary if since it is obtained as the output of a stable filter whose input is white noise. (If then has infinite variance, and is therefore not wide sense stationary.) Consequently, assuming , the mean is identical for all values of t. If the mean is denoted by , it follows from
that
and hence
In particular, if , then the mean is 0.
The variance is
where is the standard deviation of . This can be shown by noting that
and then by noticing that the quantity above is a stable fixed point of this relation.
The autocovariance is given by
It can be seen that the autocovariance function decays with a decay time (also called time constant) of [to see this, write where is independent of . Then note that and match this to the exponential decay law ].
The spectral density function is the Fourier transform of the autocovariance function. In discrete terms this will be the discrete-time Fourier transform:
This expression is periodic due to the discrete nature of the , which is manifested as the cosine term in the denominator. If we assume that the sampling time () is much smaller than the decay time (), then we can use a continuum approximation to :
which yields a Lorentzian profile for the spectral density:
where is the angular frequency associated with the decay time .
An alternative expression for can be derived by first substituting for in the defining equation. Continuing this process N times yields
For N approaching infinity, will approach zero and:
It is seen that is white noise convolved with the kernel plus the constant mean. If the white noise is a Gaussian process then is also a Gaussian process. In other cases, the central limit theorem indicates that will be approximately normally distributed when is close to one.
Calculation of the AR parameters
There are many ways to estimate the coefficients, such as the ordinary least squares procedure, method of moments (through Yule Walker equations), or Markov chain Monte Carlo methods.[citation needed]
The AR(p) model is given by the equation
It is based on parameters 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 are the following set of equations.[citation needed]
where m = 0, ..., p, yielding p + 1 equations. Here is the autocovariance function of Xt, is the standard deviation of the input noise process, and 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
which can be solved for all The remaining equation for m = 0 is
which, once are known, can be solved for
An alternative formulation is in terms of the autocorrelation function. The AR parameters are determined by the first p+1 elements of the autocorrelation function. The full autocorrelation function can then be derived by recursively calculating [1]
Examples for some Low-order AR(p) processes
- p=1
- Hence
- p=2
- The Yule-Walker equations for an AR(2) process are
- Remember that
- Using the first equation yields
- Using the recursion formula yields
- The Yule-Walker equations for an AR(2) process are
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.[citation needed] 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:
- Here predicted of 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,[2] and call the Burg method:[3] Burg and later authors called these particular estimates "maximum entropy estimates",[4] 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.[5]
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 corrresponding 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 corrresponding 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.
Spectrum


The power spectral density of an AR(p) process with noise variance is[1]
AR(0)
For white noise (AR(0))
AR(1)
For AR(1)
- If there is a single spectral peak at f=0, often referred to as red noise. As becomes nearer 1, there is stronger power at low frequencies, i.e. larger time lags.
- If there is a minimum at f=0, often referred to as blue noise
AR(2)
AR(2) processes can be split into three groups depending on the characteristics of their roots:
- When , the process has a pair of complex-conjugate roots, creating a mid-frequency peak at:
Otherwise the process has real roots, and:
- When it acts as a low-pass filter on the white noise with a spectral peak at
- When it acts as a high-pass filter on the white noise with a spectral peak at .
The process is stable when the roots are within the unit circle, or equivalently when the coefficients are in the triangle .
The full PSD function can be expressed in real form as:
Implementations in statistics packages
- R, the stats package includes an ar function.[6]
- Matlab and Octave: the TSA toolbox contains several estimation functions for uni-variate, multivariate and adaptive autoregressive models.[7]
n-step-ahead forecasting
Once the parameters of the autoregression
have been estimated, the autoregression can be used to forecast an arbitrary number of periods into the future. First use t to refer to the first period for which data is not yet available; substitute the known prior values Xt-i for i=1, ..., p into the autoregressive equation while setting the error term equal to zero (because we forecast Xt to equal its expected value, and the expected value of the unobserved error term is zero). The output of the autoregressive equation is the forecast for the first unobserved period. Next, use t to refer to the next period for which data is not yet available; again the autoregressive equation is used to make the forecast, with one difference: the value of X one period prior to the one now being forecast is not known, so its expected value—the predicted value arising from the previous forecasting step—is used instead. Then for future periods the same procedure is used, each time using one more forecast value on the right side of the predictive equation until, after p predictions, all p right-side values are predicted values from prior steps.
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.
See also
- Moving average model
- Autoregressive moving average model
- Predictive analytics
- Linear predictive coding
![]() | This article includes a list of general references, but it lacks sufficient corresponding inline citations. (March 2011) |
This article needs additional citations for verification. (March 2011) |
Notes
- ^ a b Von Storch, H. (2001). Statistical analysis in climate research. Cambridge Univ Pr. ISBN 0-521-01230-9.
{{cite book}}
: Unknown parameter|coauthors=
ignored (|author=
suggested) (help)[page needed] - ^ Burg, J. P. (1968). "A new analysis technique for time series data". In Modern Spectrum Analysis (Edited by D. G. Childers), NATO Advanced Study Institute of Signal Processing with emphasis on Underwater Acoustics. IEEE Press, New York.
- ^ Brockwell, Peter J.; Dahlhaus, Rainer; Trindade, A. Alexandre (2005). "Modified Burg Algorithms for Multivariate Subset Autoregression" (PDF). Statistica Sinica. 15: 197–213.
- ^ Burg, J.P. (1967) "Maximum Entropy Spectral Analysis", Proceedings of the 37th Meeting of the Society of Exploration Geophysicists, Oklahoma City, Oklahoma.
- ^ Attention: This template ({{cite doi}}) is deprecated. To cite the publication identified by doi:10.1109/TIM.2002.808031, please use {{cite journal}} (if it was published in a bona fide academic journal, otherwise {{cite report}} with
|doi=10.1109/TIM.2002.808031
instead. - ^ "Fit Autoregressive Models to Time Series" (in R)
- ^ "Time Series Analysis toolbox for Matlab and Octave"
References
- Mills, Terence C. (1990) Time Series Techniques for Economists. Cambridge University Press
- Percival, Donald B. and Andrew T. Walden. (1993) Spectral Analysis for Physical Applications. Cambridge University Press
- Pandit, Sudhakar M. and Wu, Shien-Ming. (1983) Time Series and System Analysis with Applications. John Wiley & Sons
- Yule, G. Udny (1927) "On a Method of Investigating Periodicities in Disturbed Series, with Special Reference to Wolfer's Sunspot Numbers", Philosophical Transactions of the Royal Society of London, Ser. A, Vol. 226, 267–298.]
- Walker, Gilbert (1931) "On Periodicity in Series of Related Terms", Proceedings of the Royal Society of London, Ser. A, Vol. 131, 518–532.