Plots of Sample Autocorrelation Function rain.nyc1: A dataset included in Splus. It is the yearly total of New York City precipitation, in inches, from 1869-1957. > par(mfrow=c(2,2)) # Sets up a 2 x 2 plotting region > tsplot(rain.nyc1) > mtext("Annual Rainfall: NY City") "acf" is the Splus command for calculating, and plotting, the sample autocorrelation function. It has a default setting for deciding at how many lags the sample autocorrelation is calculated. > acf(rain.nyc1) Call: acf(x = rain.nyc1) Autocorrelation matrix: lag rain.nyc1 1 0 1.0000 2 1 0.1091 3 2 -0.0655 4 3 -0.2355 5 4 0.0507 6 5 0.0519 7 6 0.0496 8 7 -0.0167 9 8 -0.0630 . . . 20 19 0.0019 ############################################## The data say.wavelet is the signal of a voice saying the word "wavelet" , sampled at 11025 Hz. There are 8192 samples, ranging in time from 0 to approximately 0.7429 seconds. We will look at 50 of the samples for illustration. > plot(say.wavelet[2501:2550,]) In acf, we can tell Splus the maximum number of lags at which to calculate the acf. We do this using the "lag.max" option. > acf(say.wavelet[2501:2550,], lag.max = 7) Call: acf(x = say.wavelet[2501:2550, ], lag.max = 7) Autocorrelation matrix: lag say.wavelet 1 0 1.0000 2 1 0.6997 3 2 0.3161 4 3 0.1302 5 4 0.2183 6 5 0.2288 7 6 0.0426 8 7 -0.1740