Photo by Annie Spratt on Unsplash
An autoregressive (AR) model predicts the future value based on previous values. Before jumping into the math behind AR models, we need to discuss a concept called stationarity.
Stationarity
A time series is stationary if its properties are independent of the times at which the time series is observed. For e.g. the properties of the stationary time series (rt1,…,rtk) is identical to that of (rt1+1,…,rtk+1) for all t.
More specifically, a time series (r1,r2,…,rt) is stationary if
E[rt]=μfor all t,
Cov(rt,rr−l)=γlwhich only depends on l.
Autoregressive Models
Now lets get back to AR models. An AR(p) is written as follows
yt=ϕ0+ϕ1yt−1+ϕ2yt−2+...+ϕpyt−p+ϵtwhere ϵt is white noise with E[ϵt] = 0 and Var[ϵt] = σ2
AR(1) Model
Now lets look at AR(1) model in detail
yt=ϕ0+ϕ1yt−1+ϵtTaking the expectation of this equation
E[yt]=E[ϕ0+ϕ1yt−1+ϵt]μ=E[ϕ0]+E[ϕ1yt−1]+E[ϵt]=E[ϕ0]+ϕ1E[yt−1]+E[ϵt]=ϕ0+ϕ1μSolving for μ we get
μ=ϕ01−ϕ1Now, lets take the variance of Eq. 4
Var[yt]=Var[ϕ0+ϕ1yt−1+ϵt]=Var[ϕ0]+Var[ϕ1yt−1]+Var[ϵt]=ϕ21Var[yt−1]+σ2using the property of stationarity (Var[yt]=Var[yt−1])
Var[yt]=σ21−phi21notice that ϕ21 < 1, because varaince needs to finite and is by definition nonnegative.
We can rearrange Eq. 6 to get
ϕ0=(1−ϕ1)μand rewrite Eq. 4 as
yt=ϕ0+ϕ1yt−1+ϵt=(1−ϕ1)μ+ϕ1yt−1+ϵtWe can rewrite the equation above as
yt−μ=−ϕ1μ+ϕ1yt−1+ϵt=ϕ1(yt−1−μ)+ϵtAutocorrelation Fucntion of AR(1) Model
The correlation between two random variable X and Y is defined as
ρx,y=Cov[X,Y]√Var[X]Var[Y]=E[(X−μx)(Y−μy))]√E[(X−μx)2]E[(Y−μy)2]Let
ρl=Cov[yt,yt−l]√Var[yl]Var[yt−l]=γlγ0where Var[yl]=Var[yt−l] because of stationarity and l is the lag.
γl=E[(yt−μ)(yt−l−μ)]=E[ϕ1(yt−1−μ)(yt−l−μ)+ϵt(yt−l−μ)]=ϕ1E[(yt−1−μ)(yt−l−μ)]+E[ϵt(yt−l−μ)]=ϕ1γl−1+E[ϵt(yt−l−μ)]if l=0
E[ϵt(yt−μ)]=E[ϵt((ϕ1(yt−1−μ)+ϵt))]=E[ϵt(ϕ1(yt−1−μ)]+E[ϵ2t]=σ2if l>0
E[ϵt(yt−l−μ)]=E[ϵt((ϕ1(yt−l−1−μ)+ϵt−l))]=0Therefore,
γl={ϕ1γ1+σ2, l=0ϕ1γl−1, l>0and
ρl={1, l=0ϕ1ρl−1, l>0For ρ>0, the ACF of a AR(1) series decays exponentially with rate ϕ1. While for a negative ρ, the plot consists of 2 alternating exponential decays with rate ϕ21.
References:
- Tsay, Ruey S. Analysis of financial time series, 3rd edition. John wiley & sons, 2010.
Comments