Problem

AR(2) Process : \(\mathrm{Y}_{t}=0.8 \mathrm{Y}_{t-1}+0.9 \mathrm{Y}_{t-2}+\sum_{t}\). Obtain mean, variance, ACVF and ACF.Is the process stationary?

Theory

An autoregressive (AR) model is a representation of a type of random process; as such, it is used to describe certain time-varying processes in nature, economics, etc. The autoregressive model specifies that the output variable depends linearly on its own previous values and on a stochastic term (an imperfectly predictable term); thus the model is in the form of a stochastic difference equation (or recurrence relation which should not be confused with differential equation). This process is defined by \[ X_t =a_1 x_{t-1}+a_2 x_{t-2} + w_t\]

ACVF:

\[\gamma_{\mathbf{v}}(t, t+k)=E[(y(t)-E(y(t))) *(y(t+k)-E(y(t+k)))]\]

ACF:

\[\rho(t, t-k)=\frac{\tau(t, t-k)}{\sqrt{(\gamma(t, t)+\gamma(t-E, t-k))}}\]

R Code

set.seed(123)
par(mfrow=c(1,2))
ar2<-arima.sim(model=list(order=c(2,0,0),ar=c(0.8,0.09)),n=100)
ar2
## Time Series:
## Start = 1 
## End = 100 
## Frequency = 1 
##   [1]  1.357359341  1.580152258  0.883960694  0.516174875 -0.526079021
##   [6] -1.446198704 -0.900777434 -0.402570052 -0.350121784  0.605938736
##  [11]  2.503324714  1.566163091 -0.830939178  0.481941860 -0.398431801
##  [16] -0.963379289  0.219009076 -0.196269882 -1.358022801 -0.922779051
##  [21] -0.999336655 -0.876755253 -0.406064100 -0.774419285 -0.011704648
##  [26] -0.299548016  0.091090133  1.142751798  1.357581041  0.862980909
##  [31]  1.961374640  2.640271849  2.837138157  2.746066727  1.824289740
##  [36]  3.067230246  2.017710686  4.077552264  4.976246399  4.112276464
##  [41]  2.711262447  1.828708275  1.963863950  1.488983026  1.020391577
##  [46] -0.001296833  0.045770050 -0.748405144 -2.262546747 -2.257620381
##  [51] -1.090728903 -1.651115919 -0.811094015 -2.415358353 -2.060847109
##  [56] -1.346652735 -0.961645066 -0.784838605 -1.355124948 -2.004439779
##  [61] -2.749641859 -2.262466470 -3.004915558 -3.098111872 -3.005024090
##  [66] -0.838987335 -1.593591938 -1.114995838 -0.957459095 -1.828173536
##  [71] -1.620018233 -0.015999347  0.292902935  0.274115329 -0.176843305
##  [76] -2.170051486 -0.620619873 -2.152440603 -1.037860760  0.885095307
##  [81] -0.829224384  0.118063406 -0.242376959 -1.755420020 -2.940817596
##  [86] -4.112178052 -4.085322548 -5.100109648 -3.759849975 -1.366780907
##  [91] -2.718841700 -1.510344794 -0.683929347 -0.350871930 -1.350627794
##  [96] -1.231533315 -1.387178489 -0.657591256 -1.023357825  0.099103914
mean(ar2)
## [1] -0.4061182
var(ar2)
## [1] 3.38727
acf<-acf(ar2,lag.max=20,main="acfplot",type=c("correlation"), col='orange')
acvf<-acf(ar2,lag.max=20,main="acvfplot",type=c("covariance"),col='orange')

Conclusion

Hence we can conclude that \(Y_t\) has mean=0.4061182, variance=3.38727.Also ACVF and ACF are plotted in the figure above. We can see that the ACVF of AR(2) process at lag 0, 1,2,3,4,5 is 2.936 ,2.419, 1.867, 1.382 ,0.932, 0.529 resectively and so on.