Algorithm Search⌘K

Modelintro

Autoregressive model

Also called AR model, AR(p) process.

A model in which each value is a linear combination of the previous p values plus white noise. It has a causal stationary solution when the roots of phi(z) lie outside the unit circle.

An autoregressive model of order pp, written AR(pp), says that each value of a time series is a linear combination of its pp previous values plus a new white noise shock: Xt=ϕ1Xt−1+⋯+ϕpXt−p+εtX_t = \phi_1 X_{t-1} + \cdots + \phi_p X_{t-p} + \varepsilon_t. It is a regression of the series on its own past, which gives the name. When the roots of the polynomial ϕ(z)=1−ϕ1z−⋯−ϕpzp\phi(z) = 1 - \phi_1 z - \cdots - \phi_p z^p lie outside the unit circle, the equation has one stationary solution, and that solution depends only on present and past shocks. The coefficients follow from the autocovariances through the Yule-Walker equations, and the partial autocorrelation function is zero after lag pp, which is how the order is chosen. The AR model is the simplest member of the ARMA family and the base of linear prediction in signal processing.

The machine

Notation. {εt}∼WN(0,σ2)\{\varepsilon_t\} \sim \mathrm{WN}(0, \sigma^2) is white noise: mean 0, variance σ2\sigma^2, uncorrelated at different times. IID(0,σ2)\mathrm{IID}(0, \sigma^2) means independent and identically distributed with the same moments. BB is the backshift operator, BXt=Xt−1B X_t = X_{t-1}.

Definition. {Xt:t∈Z}\{X_t : t \in \mathbb{Z}\} is an AR(pp) process with mean μ\mu if it is weakly stationary and

Xt−μ=∑i=1pϕi(Xt−i−μ)+εt,that is,ϕ(B)(Xt−μ)=εt,X_t - \mu = \sum_{i=1}^{p} \phi_i (X_{t-i} - \mu) + \varepsilon_t, \qquad \text{that is,} \qquad \phi(B)(X_t - \mu) = \varepsilon_t,

with ϕp≠0\phi_p \ne 0. With an intercept cc, the equation reads Xt=c+∑iϕiXt−i+εtX_t = c + \sum_i \phi_i X_{t-i} + \varepsilon_t and μ=c/(1−ϕ1−⋯−ϕp)=c/ϕ(1)\mu = c/(1 - \phi_1 - \cdots - \phi_p) = c/\phi(1).

Parameter space. ϕ=(ϕ1,…,ϕp)∈Rp\phi = (\phi_1, \ldots, \phi_p) \in \mathbb{R}^p, σ2>0\sigma^2 > 0 and μ∈R\mu \in \mathbb{R}. The model is usually restricted to the causal region below, which is open and bounded.

Existence and causality. The equation ϕ(B)Xt=εt\phi(B) X_t = \varepsilon_t has a stationary solution if and only if ϕ(z)≠0\phi(z) \ne 0 for ∣z∣=1|z| = 1, and then the solution is unique. The solution is causal, Xt=∑j≥0ψjεt−jX_t = \sum_{j \ge 0} \psi_j \varepsilon_{t-j} with ∑j∣ψj∣<∞\sum_j |\psi_j| < \infty, if and only if every root of ϕ(z)\phi(z) satisfies ∣z∣>1|z| > 1 (Brockwell and Davis 1991, Section 3.1). The weights solve ψ(z)=1/ϕ(z)\psi(z) = 1/\phi(z), that is ψ0=1\psi_0 = 1 and ψj=∑i=1min⁡(j,p)ϕiψj−i\psi_j = \sum_{i=1}^{\min(j, p)} \phi_i \psi_{j-i}. Some roots inside the unit circle and none on it give a stationary but noncausal solution, which depends on future shocks. A root on the unit circle gives no stationary solution at all: the random walk Xt=Xt−1+εtX_t = X_{t-1} + \varepsilon_t is the case p=1p = 1, ϕ1=1\phi_1 = 1.

For AR(1) the proof is short. If ∣ϕ∣<1|\phi| < 1, iterate the equation kk times: Xt=∑j=0k−1ϕjεt−j+ϕkXt−kX_t = \sum_{j=0}^{k-1} \phi^j \varepsilon_{t-j} + \phi^k X_{t-k}. For a stationary XX, E[(ϕkXt−k)2]=ϕ2kγ(0)→0\mathbb{E}[(\phi^k X_{t-k})^2] = \phi^{2k}\gamma(0) \to 0, so Xt=∑j≥0ϕjεt−jX_t = \sum_{j \ge 0} \phi^j \varepsilon_{t-j} in mean square, and this series is a solution. If ∣ϕ∣>1|\phi| > 1, write Xt=ϕ−1Xt+1−ϕ−1εt+1X_{t} = \phi^{-1} X_{t+1} - \phi^{-1}\varepsilon_{t+1} and iterate forward to get Xt=−∑j≥1ϕ−jεt+jX_t = -\sum_{j \ge 1} \phi^{-j} \varepsilon_{t+j}.

AR(2). The causal region is the triangle ϕ1+ϕ2<1\phi_1 + \phi_2 < 1, ϕ2−ϕ1<1\phi_2 - \phi_1 < 1, ∣ϕ2∣<1|\phi_2| < 1. The roots are complex when ϕ12+4ϕ2<0\phi_1^2 + 4\phi_2 < 0, and then the autocorrelation is a damped cosine.

Markov form. Let Yt=(Xt,Xt−1,…,Xt−p+1)⊤Y_t = (X_t, X_{t-1}, \ldots, X_{t-p+1})^\top. Then Yt=AYt−1+(εt,0,…,0)⊤Y_t = A Y_{t-1} + (\varepsilon_t, 0, \ldots, 0)^\top, where AA has first row (ϕ1,…,ϕp)(\phi_1, \ldots, \phi_p) and ones on the subdiagonal. The eigenvalues of AA are the reciprocals of the roots of ϕ(z)\phi(z), so causality means that all eigenvalues lie inside the unit circle. With Gaussian IID noise, {Yt}\{Y_t\} is a Gaussian Markov chain and a state-space model with no observation noise.

A worked case. Take ϕ=(0.5,0.3)\phi = (0.5, 0.3) and σ2=1\sigma^2 = 1. The roots of 1−0.5z−0.3z21 - 0.5z - 0.3z^2 are 1.17361.1736 and −2.8403-2.8403, both outside the unit circle, so the process is causal. The weights are ψ=1,0.5,0.55,0.425,0.3775,0.3163,…\psi = 1, 0.5, 0.55, 0.425, 0.3775, 0.3163, \ldots. The variance is γ(0)=1−ϕ2(1+ϕ2)[(1−ϕ2)2−ϕ12]σ2=0.71.3×0.24=2.2436\gamma(0) = \frac{1 - \phi_2}{(1 + \phi_2)[(1 - \phi_2)^2 - \phi_1^2]}\sigma^2 = \frac{0.7}{1.3 \times 0.24} = 2.2436. The autocorrelations are ρ(1)=ϕ1/(1−ϕ2)=0.7143\rho(1) = \phi_1/(1 - \phi_2) = 0.7143, ρ(2)=0.6571\rho(2) = 0.6571, ρ(3)=0.5429\rho(3) = 0.5429, each from ρ(h)=0.5ρ(h−1)+0.3ρ(h−2)\rho(h) = 0.5\rho(h-1) + 0.3\rho(h-2).

What it counts

The model has p+2p + 2 parameters (ϕ,σ2,μ)(\phi, \sigma^2, \mu). Everything else is a function of them.

quantity formula cost from the parameters
autocovariance γ(0),…,γ(p)\gamma(0), \ldots, \gamma(p) the Yule-Walker system γ(k)−∑iϕiγ(k−i)=σ2[k=0]\gamma(k) - \sum_i \phi_i \gamma(k - i) = \sigma^2 [k = 0], k=0,…,pk = 0, \ldots, p O(p3)O(p^3) by elimination, O(p2)O(p^2) by the step-down recursion
autocovariance at lag h>ph > p γ(h)=∑iϕiγ(h−i)\gamma(h) = \sum_i \phi_i \gamma(h - i) O(p)O(p) per lag
ψ\psi weights ψj=∑iϕiψj−i\psi_j = \sum_i \phi_i \psi_{j-i} O(p)O(p) per weight
partial autocorrelation ϕhh\phi_{hh}; equals ϕp\phi_p at h=ph = p and 0 for h>ph > p O(p2)O(p^2)
spectral density f(λ)=σ22π ∣ϕ(e−iλ)∣2f(\lambda) = \dfrac{\sigma^2}{2\pi\, \lvert \phi(e^{-i\lambda}) \rvert^2} O(p)O(p) per frequency
one-step forecast, n≥pn \ge p X^n+1=μ+∑iϕi(Xn+1−i−μ)\hat X_{n+1} = \mu + \sum_i \phi_i (X_{n+1-i} - \mu), error variance σ2\sigma^2 O(p)O(p)
hh-step forecast the same recursion with forecasts in place of unknown values; error variance σ2∑j=0h−1ψj2\sigma^2 \sum_{j=0}^{h-1} \psi_j^2 O(hp)O(hp)
Gaussian likelihood the density of (X1,…,Xp)(X_1, \ldots, X_p) times ∏t>p\prod_{t > p} of the one-step densities O(np+p3)O(np + p^3)

Three properties follow from the table. The autocorrelation decays geometrically: ∣ρ(h)∣≤Crh|\rho(h)| \le C r^h for any rr larger than the reciprocal of the smallest root modulus. The partial autocorrelation cuts off after lag pp. The best linear predictor of Xn+1X_{n+1} from all of the past uses only the last pp values, so the one-step prediction error of the Wold decomposition is σ2\sigma^2 and the AR noise is the Wold innovation.

Relation to other models

  • Moving-average model. A causal AR(pp) is an MA(∞\infty) with weights ψj\psi_j, and an invertible MA(qq) is an AR(∞\infty). AR and MA models are dual: the AR autocorrelation decays and the AR partial autocorrelation cuts off, and the MA has the opposite pattern.
  • ARMA model. AR(pp) is ARMA(pp, 0). Every stationary process with a continuous spectral density is approximated by causal AR processes in the sense that the spectral densities can be made uniformly close (Brockwell and Davis 1991, Section 4.4), but an ARMA model often needs far fewer parameters.
  • ARIMA model. An AR polynomial with a factor (1−z)(1 - z) is a unit root; ARIMA moves that factor into a difference.
  • Vector autoregression. The same equation with vectors XtX_t and matrix coefficients.
  • ARX model. The control version, with a known input utu_t added on the right. Least squares identification of an ARX model is the conditional least squares fit of an AR model with regressors.
  • Linear predictive coding. In speech processing the same model is fitted to short frames, and the coefficients are called the predictor coefficients.
  • GARCH model. The squared residuals of a GARCH process follow an ARMA equation. The AR model describes the mean, and GARCH describes the conditional variance.

Known results in the model

  • Yule-Walker equations. For a causal AR(pp), Γpϕ=γp\Gamma_p \phi = \gamma_p and σ2=γ(0)−ϕ⊤γp\sigma^2 = \gamma(0) - \phi^\top \gamma_p, where Γp=[γ(i−j)]i,j=1p\Gamma_p = [\gamma(i - j)]_{i,j=1}^p and γp=(γ(1),…,γ(p))⊤\gamma_p = (\gamma(1), \ldots, \gamma(p))^\top. Multiply the equation by Xt−kX_{t-k} and take expectations; causality makes εt\varepsilon_t uncorrelated with Xt−kX_{t-k} for k≥1k \ge 1. The Yule-Walker estimator puts the sample autocovariance into this system and solves it with the Levinson-Durbin recursion in O(p2)O(p^2).
  • The fitted model is causal. With the divisor-nn sample autocovariance, Γ^p\hat\Gamma_p is positive definite whenever the data are not all equal, and the Yule-Walker fit is always causal (Brockwell and Davis 1991, Section 8.1). Conditional least squares does not guarantee this, and the exact likelihood must be maximized over the causal region.
  • Asymptotic normality. For a causal AR(pp) with IID noise of finite variance, the Yule-Walker, Burg, conditional least squares and Gaussian maximum likelihood estimators all satisfy n(ϕ^−ϕ)→N(0,σ2Γp−1)\sqrt{n}(\hat\phi - \phi) \to N(0, \sigma^2 \Gamma_p^{-1}) (Brockwell and Davis 1991, Section 8.10). For AR(1) the variance is (1−ϕ2)/n(1 - \phi^2)/n. For Gaussian noise this is the inverse Fisher information, so all four are efficient. They differ in finite samples: the Yule-Walker estimator has the largest bias when a root is near the unit circle, because the divisor nn shrinks the sample autocovariance (see the table on the Whittle likelihood page).
  • Order selection. Under an AR(pp) model with IID noise, the sample partial autocorrelation at each lag h>ph > p is approximately N(0,1/n)N(0, 1/n) (Quenouille 1949). So the order is the last lag outside ±1.96/n\pm 1.96/\sqrt{n}, or the minimizer of the Akaike information criterion or the Bayesian information criterion.
  • A unit root changes the rate. When ϕ=1\phi = 1 in AR(1), least squares converges at rate nn, not n\sqrt{n}, and the limit is not normal. Tests of ϕ=1\phi = 1 use the Dickey-Fuller distribution; see the augmented Dickey-Fuller test.
  • Noncausal models are not identified by second moments. If ∣ϕ∣>1|\phi| > 1, the AR(1) process has the same autocovariance as the causal AR(1) with coefficient 1/ϕ1/\phi and noise variance σ2/ϕ2\sigma^2/\phi^2. For AR(pp), reflecting a root zz to 1/zˉ1/\bar z keeps the autocovariance up to a scale. Gaussian methods therefore fit only the causal model.
  • Maximum entropy. Among all stationary processes with the given γ(0),…,γ(p)\gamma(0), \ldots, \gamma(p), the Gaussian AR(pp) process with those autocovariances has the largest entropy rate. This is why the Burg method and other AR spectral estimators are called maximum entropy methods.

A hand example. Take x=(3,5,6,4,2,1,3,6,7,5)x = (3, 5, 6, 4, 2, 1, 3, 6, 7, 5), n=10n = 10. The mean is 4.24.2, and the divisor-nn autocovariances are γ^(0)=3.36\hat\gamma(0) = 3.36 and γ^(1)=1.656\hat\gamma(1) = 1.656. The Yule-Walker AR(1) fit is ϕ^=1.656/3.36=69/140=0.4929\hat\phi = 1.656/3.36 = 69/140 = 0.4929 and σ^2=3.36(1−ϕ^2)=2.5438\hat\sigma^2 = 3.36(1 - \hat\phi^2) = 2.5438. The one-step forecast is 4.2+0.4929×(5−4.2)=4.5944.2 + 0.4929 \times (5 - 4.2) = 4.594, with error variance 2.54382.5438 if the parameters were known. The Yule-Walker equations page continues this example to p=2p = 2 and p=3p = 3.

References

  1. G. Udny Yule, On a method of investigating periodicities in disturbed series, with special reference to Wolfer's sunspot numbers, Philosophical Transactions of the Royal Society A 226, 1927, pp. 267 to 298 (the second-order autoregression fitted to the sunspot numbers)
  2. Gilbert Walker, On periodicity in series of related terms, Proceedings of the Royal Society A 131, 1931, pp. 518 to 532 (the equations between the autoregressive coefficients and the autocorrelations)
  3. Peter J. Brockwell and Richard A. Davis, Time Series: Theory and Methods, second edition, Springer, 1991, Section 3.1 (causality and invertibility, pp. 77 to 88), Section 3.3 (computing the autocovariance, p. 91), Section 3.4 (the partial autocorrelation function, pp. 98 to 102), Section 8.1 (the Yule-Walker estimates, p. 239) and Section 8.10 (their asymptotic behaviour, p. 262)
  4. Peter J. Brockwell and Richard A. Davis, Introduction to Time Series and Forecasting, third edition, Springer, 2016, Section 3.1 (ARMA processes, p. 73), Section 3.2 (ACF and PACF, p. 77) and Section 5.1.1 (Yule-Walker estimation, p. 123)
  5. James D. Hamilton, Time Series Analysis, Princeton University Press, 1994, Chapter 3 (stationary ARMA processes, pp. 43 to 71) and Chapter 5 (maximum likelihood estimation, pp. 117 to 151)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/7EKFM3/text.yaml