Problem

Generate a time series of size 500 from AR(1) process with coefficient \(\alpha=-0.75\) and \(\alpha=0.8\).Obtain the mean ,variance, ACVF and ACF .Is the process stationary?

The model AR(1) is about the correlation between an error and the previous error. First consider white noise. In this case there should be no correlation between the errors and the shifted errors.

R Code

For \(\alpha=-0.75\)

set.seed(123)
par(mfrow=c(1,2))
ar2<-arima.sim(model=list(order=c(1,0,0),ar=-0.75),n=500)
head(ar2,n=100)
##   [1] -0.73093878 -0.18068715 -0.48952391 -1.31955038  1.82744983 -1.21721425
##   [7] -0.22522625  1.42273461 -0.64058673  0.18536857  0.75609924  0.31105906
##  [13]  0.58828679  0.24742516  0.36834878 -0.33817330 -0.05233269 -0.34122148
##  [19] -0.43879087  0.12117587 -1.35627826  3.18616466 -1.18166149 -0.23686246
##  [25] -0.22523799 -0.29772686  1.00326026 -0.83581427  0.88017921 -0.68868117
##  [31]  0.47364042  1.01337197 -0.98579996  2.25582058 -3.24061824  3.01507743
##  [37] -2.13745383  1.81903194 -0.98463447  0.23615240 -0.51032168 -0.63583412
##  [43] -0.59491564  0.74971537 -0.11407675  0.13856179  0.81834613  1.43632509
##  [49] -1.56827498 -1.13296264  1.85546050 -2.10079614  0.88758849  0.35988000
##  [55] -0.55468301 -0.80470546  0.78483257 -0.72751579  0.55140103 -0.02827037
##  [61] -0.34945725  0.90646949 -0.90033868  1.00703597  0.34156203  0.17900997
##  [67] -0.46018906  1.49394941 -0.12695820  0.64361561 -0.24397997 -0.44492110
##  [73]  1.69434327 -1.87101704  3.59059577 -1.16033620  0.63455179 -1.50233475
##  [79]  0.41634450 -0.05537466 -0.20516088 -0.19367194 -0.80636461  0.55974574
##  [85] -1.20471377 -0.76440661  0.19307844  0.77418778 -1.15598780  1.47495517
##  [91] -2.72409909  1.98751235 -0.97122706  1.02957366 -0.66650405 -0.14082797
##  [97] -0.74408337 -0.46606627  0.46719630 -1.29787184
mean(ar2)
## [1] 0.01261932
var(ar2)
## [1] 2.062495
acf<-acf(ar2,lag.max=25,main="ACF_Plot",type=c("correlation"), col='orange')
acvf<-acf(ar2,lag.max=25,main="ACVF_Plot",type=c("covariance"),col='orange')

For \(\alpha=0.8\)

set.seed(123)
par(mfrow=c(1,2))
ar1<-arima.sim(model=list(order=c(1,0,0),ar=0.8),n=500)
head(ar1,n=100)
##   [1] -2.34381284 -0.62123535 -0.07052406 -0.35149073  0.61393308  1.36927995
##   [7]  1.91700504  2.22224429  2.33171308  1.80345876  1.13680434  0.52897247
##  [13] -0.27152900 -0.42514048 -1.60550874  0.88454898  1.91560118  0.40937236
##  [19] -0.07538695 -0.52696491  0.35839319  0.20334549  0.41599490  0.30424917
##  [25]  0.20052888  1.52902538  0.99744932  2.31443006  0.30279125  0.82684675
##  [31]  0.78533164  0.84420688  1.05500499  0.34168054 -0.05986295 -1.06646575
##  [37] -1.92496382 -1.23644242 -0.54094416 -0.37975110  0.61846659  2.54485796
##  [43]  1.54485520 -1.07328472  0.14711075 -0.59151216 -1.16121835  0.09659669
##  [49] -0.20749565 -1.38671423 -0.92806791 -0.88134569 -0.69931236 -0.17416949
##  [55] -0.50999562  0.23638005 -0.03138252  0.30667595  1.34217977  1.50892531
##  [61]  0.88120866  1.85377455  2.47652349  2.52961575  2.26242434  1.18203339
##  [67]  2.30627916  1.24476374  3.18314399  4.07912582  3.02760029  1.39565934
##  [73]  0.40612090  0.58178043  0.21873247 -0.17255663 -1.08966387 -0.91675882
##  [79] -1.51831152 -2.88259116 -2.68629945 -1.23004295 -1.55938132 -0.63954073
##  [85] -2.12951530 -1.75917420 -0.88793216 -0.40919236 -0.22167770 -0.81804817
##  [91] -1.50414288 -2.22744309 -1.66430788 -2.27892092 -2.31369418 -2.10704753
##  [97]  0.15822398 -0.52537072 -0.18491000 -0.06996715
mean(ar1)
## [1] 0.13709
var(ar1)
## [1] 2.017004
acf<-acf(ar1,lag.max=20,main="acfplot",type=c("correlation"), col='orange')
acvf<-acf(ar1,lag.max=20,main="acvfplot",type=c("covariance"),col='orange')

Conclusion

Mean and variance of AR(1) process qith \(\phi =-0.75\) is -0.0283 and 1.8866 respectively. ACVF of this model at lag 0 to 10 are 2.462, -1.920, 1.551 . . . and so on.