Neas-Seminars

TS Module 6 Moving average and autoregressive scatterplots


http://33771.hs2.instantasp.net/Topic10061.aspx

By NEAS - 10/5/2010 1:31:12 PM

TS Module 6 Moving average and autoregressive scatterplots

 

(The attached PDF file has better formatting.)

 

Cryer and Chan chapter 4 shows scatterplots for one and two lags for autoregressive and moving average processes. The final exam shows similar scatterplots and asks you to identify the time series process.

 

Exhibits 4.3 and 4.4 on pages 59 and 60 show scatterplots for an MA(1) process with è = –0.9, so ñ1 is positive and ñ2 is zero. The autocorrelations are evident from the scatter of points. Graphics iike those in the textbook are shown below.

 

## MA(1) series with è = -0.9 of length n=100

ma1.n090 <- arima.sim(model = list(ma = -c(-0.90)), n=100)

 

par(mfrow=c(1,2))

plot(y = ma1.n090, x = zzlag(vec = ma1.n090, lag = 1), ylab = expression(Y[t]), xlab = expression (Y[t-1]), type = 'p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-1], " for MA(1) process with ", theta == -0.9, sep="") ), font = 2, cex = 1.2)

plot(y = ma1.n090, x = zzlag(vec = ma1.n090, lag = 2), ylab = expression(Y[t]), xlab = expression (Y[t-2]), type='p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-2], " for MA(1) process with ", theta == -0.9, sep="") ), font = 2, cex = 1.2)

 

## zzlag is like the zlag function in the TSA package

 

zzlag <- function (vec, lag =1) {

len <- length(vec)

res <- vec[-((len-lag+1):len)]

res <- c(rep(NA, lag),res)

return(res)

}

 


 


 

Exhibits 4.6 and 4.7 on pages 61 and 62 show scatterplots for an MA(1) process with è = +0.9, so ñ1 is negative and ñ2 is zero. The autocorrelations are evident from the scatter of points. Graphics iike those in the textbook are shown below.

 

## MA(1) series with è = 0.9 of length n=100

ma1.090 <- arima.sim(model = list(ma = -c(0.90)), n=100)

 

par(mfrow=c(1,2))

plot(y = ma1.090, x = zzlag(vec = ma1.090, lag = 1), ylab = expression(Y[t]), xlab = expression (Y[t-1]), type = 'p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-1], " for MA(1) process with ", theta == 0.9, sep="") ), font = 2, cex = 1.2)

plot(y = ma1.090, x = zzlag(vec = ma1.090, lag = 2), ylab = expression(Y[t]), xlab = expression (Y[t-2]), type='p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-2], " for MA(1) process with ", theta == 0.9, sep="") ), font = 2, cex = 1.2)

 

 


 

Exhibits 4.9 and 4.10 on page 64 show scatterplots for an MA(2) process. The values of è1 and è2 determine whether the autocorrelations are positive or negative. Final exam problems use parameter values that make the process clear.

 

Exhibits 4.14 and 4.15 on page 59 show scatterplots for an AR(1) process with è = +0.9, so ñ1 and ñ2 are both positive. Graphics iike those in the textbook are shown below.

 

## AR(1) series with è = 0.9 of length n=100

ar1.090 <- arima.sim(model = list(ar = c(0.90)), n=100)

 

par(mfrow=c(1,2))

plot(y = ar1.090, x = zzlag(vec = ar1.090, lag = 1), ylab = expression(Y[t]), xlab = expression (Y[t-1]), type = 'p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-1], " for AR(1) process with ", phi == 0.9, sep="") ), font = 2, cex = 1.2)

plot(y = ar1.090, x = zzlag(vec = ar1.090, lag = 2), ylab = expression(Y[t]), xlab = expression (Y[t-2]), type='p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-2], " for AR(1) process with ", phi == 0.9, sep="") ), font = 2, cex = 1.2)

 

 


 

Changing è to –0.9 makes ñ1 negative, but ñ2 stays positive.

 

## AR(1) series with è = –0.9 of length n=100

ar1.n090 <- arima.sim(model = list(ar = c(-0.90)), n=100)

 

par(mfrow=c(1,2))

plot(y = ar1.n090, x = zzlag(vec = ar1.n090, lag = 1), ylab = expression(Y[t]), xlab = expression (Y[t-1]), type = 'p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-1], " for AR(1) process with ", phi == -0.9, sep="") ), font = 2, cex = 1.2)

plot(y = ar1.n090, x = zzlag(vec = ar1.n090, lag = 2), ylab = expression(Y[t]), xlab = expression (Y[t-2]), type='p')

title(main = expression(paste("Scatterplot of ",Y[t], " vs ",Y[t-2], " for AR(1) process with ", phi == -0.9, sep="") ), font = 2, cex = 1.2)

 

 

Final exam problems test the algebra and graphics of moving average and autoregressive processes: MA(1), MA(2), AR(1), AR(2), and ARMA(1,1).