### Simulate the three models in Problem 2.6 and save them. # a. # Simulated in ASTSA. Splus will not simulate non-stationary time series. par(mfrow=c(2,3)) x <- scan("E:\\Stat207\\Homework\\Ch2\\Problem2.6\\data1.dat") tsplot(x,main="AR(2), ar = c(-1.6,-.64)") acf(x, 20) acf(x, 20, "partial") # b. x <- arima.sim(400,model=list(ar=c(.4,.45))) write(x, file="E:\\Stat207\\Homework\\Ch2\\Problem2.6\\data2.dat", ncolumns=1, append=F) tsplot(x,main="AR(2), ar = c(.4,.45)") acf(x, 20) acf(x, 20, "partial") # c. par(mfrow=c(2,3)) x <- arima.sim(400,model=list(ar=c(1.2,-.85))) write(x, file="E:\\Stat207\\Homework\\Ch2\\Problem2.6\\data3.dat", ncolumns=1, append=F) tsplot(x,main="AR(2), ar = c(1.2,-.85)") acf(x, 20) acf(x, 20, "partial")