#install.packages("astsa") require(astsa) help(package = astsa) w1 = rnorm(200, sd=1) # Simulate some random normals w2 = rnorm(200, sd=1) f1 = c(1, .5, .5, .2) # MA coefficients f2 = c(1, -.5, -.5, .2) # MA coefficients # Simulate two MA(3) series; omit the two NAs at the beginning ma3.1 = na.omit(filter(w1, f1, side=1)) ma3.2 = na.omit(filter(w2, f2, side=1)) par(mfrow=c(2,1)) acf(ma3.1) acf(ma3.2)